1. 程式人生 > >FFmpeg濾鏡使用指南

FFmpeg濾鏡使用指南

目錄
1. FFmpeg濾鏡文件
2. 示例
  2.1 縮放
  2.2 視訊加速
  2.3 濾鏡圖,鏈和濾鏡關係
  2.4 多個輸入覆蓋同一個2x2 網格
  2.5 轉義字元
  2.6 燒錄時間碼
  2.7 描述命令列引數
  2.8 測試源
3. 濾鏡列表
4. 其它濾鏡示例
5. 開發自己的濾鏡

FFmpeg添加了很多濾鏡,檢視哪些濾鏡有效可用命令:
# ./ffmpeg -filters.
 
1. FFmpeg濾鏡文件
更多的資訊和每個濾鏡的使用示例可檢視FFmpeg的濾鏡文件: 
  http://ffmpeg.org/ffmpeg-filters.html

2. 示例
2.1 縮放

將輸入的640x480縮小到320x240輸出:  
# ./ffmpeg -i input -vf scale=iw/2:-1 output


iw  : 是輸入的寬度;在本例中,輸入寬度為640. 640/2 = 320. 
-1  : 通知縮放濾鏡在輸出時保持原始的寬高比,因此本例中縮放濾鏡將選擇240.

2.2 視訊加速
1. 加速/減慢視訊
可以使用 “setpts"(http://ffmpeg.org/ffmpeg.html#asetpts_002c-setpts)濾鏡來改變視訊速度。

加速視訊命令: 
# ./ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv

Note : 這個方法在實現你想要的速度時,會採取丟幀策略。
如果想避免丟幀,可以指定輸出的幀率比輸入的幀率高的辦法。
例如,輸入的幀率為4, 指定輸出的幀率為4x, 即16fps :
# ./ffmpeg -i input.mkv -r 16 -filter:v "setpts=0.125*PTS" -an output.mkv


減慢視訊命令: 
# ./ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv

2. 加速/減慢音訊
可以使用" atempo" 音訊濾鏡來加速或減慢音訊。如雙倍速音訊命令: 
# ./ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv

"atempo"濾鏡對音訊速度調整限制在0.5 到 2.0 之間,(即半速或倍速)。
如果有必要,可以使用多個atempo濾鏡來實現,如下面的命令實現四倍速音訊:
# ./ffmpeg -i input.mkv -filter:a "atempo=2.0,atempo=2.0" -vn output.mkv


使用更復雜的濾鏡圖,可以同時加速視訊和音訊:
# ./ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv

2.3 濾鏡圖,鏈,和濾鏡關係
FFmpeg命令列中,跟在 "-vf"之後的就是一個濾鏡圖。
濾鏡圖可以包含多個濾鏡鏈,而每個濾鏡鏈又可以包含多個濾鏡。

雖然一個完整的濾鏡圖描述很複雜,但可以簡化以避免歧義。
濾鏡鏈使用";"分隔,濾鏡鏈中濾鏡使用","分隔;
並且,濾鏡鏈如果沒有指定輸入或輸出,則預設使用前面的濾鏡鏈的輸出為輸入,並輸出給後面的濾鏡鏈做輸入。
 
下面的命令列是相等的:
ffmpeg -i input -vf [in]scale=iw/2:-1[out] output
ffmpeg -i input -vf scale=iw/2:-1 output               # the input and output are implied without ambiguity

對於下面: 
ffmpeg -i input -vf [in]yadif=0:0:0[middle];[middle]scale=iw/2:-1[out] output 
                                                       # 兩個鏈的方式,每個鏈一個濾鏡,鏈間使用[middle]填充
ffmpeg -i input -vf [in]yadif=0:0:0,scale=iw/2:-1[out] output                 
                                                       # 一個鏈的方式,鏈包含兩個濾鏡,使用預設連結
ffmpeg -i input -vf yadif=0:0:0,scale=iw/2:-1  output  # 輸入輸出也使用預設連結

2.4. 多個輸入覆蓋同一個2x2網格
下例中有四個輸入,並使用 -filter_complex濾鏡連結。
這個例子中四個輸入都是 "-f lavfi -i testsrc", 也可以用別的輸入代替。
在濾鏡圖中,第一個輸入被填充到右下角,並設定成高度的兩倍。
其它三個輸入使用獨立的濾鏡"hflip, negate,和 edgedetect"。
覆蓋視訊濾鏡被使用多次,後面三個都覆蓋到第一個之上。
覆蓋濾鏡的偏移量在輸入上形成一個網格。
# ./ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc -f lavfi -i testsrc 
-filter_complex "[0:0]pad=iw*2:ih*2[a];[1:0]negate[b];[2:0]hflip[c];
[3:0]edgedetect[d];[a][b]overlay=w[x];[x][c]overlay=0:h[y];[y][d]overlay=w:h" 
-y -c:v ffv1 -t 5 multiple_input_grid.avi

2.5 轉義字元
如文件中的描述,濾鏡間的","分隔符是必須的,但它也會出現在引數中,如下面的"select"濾鏡:
# ./ffmpeg -i input -vf select='eq(pict_type\,PICT_TYPE_I)' output        # to select only I frames

作為一個選擇,在濾鏡圖中同樣可以在雙引號中使用空格,這樣更方便閱讀:
# ./ffmpeg -i input -vf "select=eq(pict_type,PICT_TYPE_I)" output          # to select only I frames
# ./ffmpeg -i input -vf "yadif=0:-1:0, scale=iw/2:-1" output               # deinterlace then resize

2.6 燒錄時間碼
使用 "drawtext"視訊濾鏡。

PAL 25 fps non drop frame: 
ffmpeg -i in.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timecode='09\:57\:00\:00': r=25: \
x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: [email protected]" -an -y out.mp4

 NTSC 30 fps drop frame 
(change the : to a ; before the frame count)_________________________________________________________
                                                                                                     \
ffmpeg -i in.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timecode='09\:57\:00\;00': r=30: \
x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: [email protected]" -an -y out.mp4

2.7 描述命令列引數
構建複雜的濾鏡圖時,會使命令列看起來一團混亂,如何使濾鏡圖命令列可管理就變得很有用了。
下面的例子包含三個濾鏡,yadif, scale, drawtext的濾鏡圖的指令碼:
 
#!/bin/bash
# ffmpeg test script

path="/path/to/file/"

in_file="in.mp4"
out_file="out.mp4"

cd $path

filter="-vf \"yadif=0:-1:0, scale=400:226, drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: \
text='tod- %X':x=(w-text_w)/2:y=H-60 :fontcolor=white :box=1:[email protected]\""
codec="-vcodec libx264  -pix_fmt yuv420p -b:v 700k -r 25 -maxrate 700k -bufsize 5097k"

command_line="ffmpeg -i $in_file $filter $codec -an $out_file"

echo $command_line
eval $command_line
exit

NOTE: 包含整個濾鏡圖的雙引號需要使用轉義符 \", 
eval $command_line變數用於避免轉義符丟失。
 
2.8 測試源
testsrc源濾鏡生成一個測試視訊源,包含有顏色模式,灰度值和時間戳。它在用於測試目的時很有用。
下面的例子生成一個10秒的輸出,30fps,共300幀,幀大小為 1280x720:
# ./ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 output.mpg

使用 smptebars源濾鏡的例子:
# ./ffmpeg -f lavfi -i "smptebars=duration=5:size=1280x720:rate=30" output.mp4

ffplay同樣能用於檢視結果濾鏡圖:
ffplay -f lavfi -i "testsrc=duration=10:size=1280x720:rate=30"

3. 濾鏡列表
濾鏡和libavfilter繫結在一起,如 4.3.100(as configured with --enable-gpl). 
使用外部庫的濾鏡並未列在這裡,如frei0r.可以檢視FFMPEG的濾鏡文件。
濾鏡列表約定:
  T.. = Timeline support
  .S. = Slice threading
  ..C = Commmand support
  A = Audio input/output
  V = Video input/output
  N = Dynamic number and/or type of input/output
  | = Source or sink filter

濾鏡:
 ... aconvert         A->A       Convert the input audio to sample_fmt:channel_layout.
 T.. adelay           A->A       延遲一個或多個音訊通道
 ... aecho            A->A       給音訊添加回音
 ... aeval            A->A       Filter audio signal according to a specified expression.
 T.. afade            A->A       Fade in/out input audio.
 ... aformat          A->A       Convert the input audio to one of the specified formats.
 ... ainterleave      N->A       Temporally interleave audio inputs.
 ... allpass          A->A       Apply a two-pole all-pass filter.
 ... amerge           N->A       Merge two or more audio streams into a single multi-channel stream.
 ... amix             N->A       Audio mixing.
 ... anull            A->A       Pass the source unchanged to the output.
 T.. apad             A->A       Pad audio with silence.
 ... aperms           A->A       Set permissions for the output audio frame.
 ... aphaser          A->A       Add a phasing effect to the audio.
 ... aresample        A->A       重取樣音訊資料
 ... aselect          A->N       選擇音訊幀給輸出
 ... asendcmd         A->A       Send commands to filters.
 ... asetnsamples     A->A       Set the number of samples for each output audio frames.
 ... asetpts          A->A       Set PTS for the output audio frame.
 ... asetrate         A->A       Change the sample rate without altering the data.
 ... asettb           A->A       Set timebase for the audio output link.
 ... ashowinfo        A->A       Show textual information for each audio frame.
 ... asplit           A->N       Pass on the audio input to N audio outputs.
 ... astats           A->A       Show time domain statistics about audio frames.
 ... astreamsync      AA->AA     Copy two streams of audio data in a configurable order.
 ..C atempo           A->A       Adjust audio tempo.
 ... atrim            A->A       Pick one continuous section from the input, drop the rest.
 ... bandpass         A->A       Apply a two-pole Butterworth band-pass filter.
 ... bandreject       A->A       Apply a two-pole Butterworth band-reject filter.
 ... bass             A->A       Boost or cut lower frequencies.
 ... biquad           A->A       Apply a biquad IIR filter with the given coefficients.
 ... channelmap       A->A       Remap audio channels.
 ... channelsplit     A->N       Split audio into per-channel streams.
 ... compand          A->A       Compress or expand audio dynamic range.
 ... earwax           A->A       Widen the stereo image.
 ... ebur128          A->N       EBU R128 scanner.
 ... equalizer        A->A       Apply two-pole peaking equalization (EQ) filter.
 ... highpass         A->A       Apply a high-pass filter with 3dB point frequency.
 ... join             N->A       Join multiple audio streams into multi-channel output.
 ... lowpass          A->A       Apply a low-pass filter with 3dB point frequency.
 ... pan              A->A       Remix channels with coefficients (panning).
 ... replaygain       A->A       ReplayGain scanner.
 ... silencedetect    A->A       檢測靜音
 ... treble           A->A       Boost or cut upper frequencies.
 T.C volume           A->A       改變輸入音量
 ... volumedetect     A->A       檢測音訊音量
 ... aevalsrc         |->A       Generate an audio signal generated by an expression.
 ... anullsrc         |->A       Null audio source, return empty audio frames.
 ... sine             |->A       Generate sine wave audio signal.
 ... anullsink        A->|       Do absolutely nothing with the input audio.
 ... alphaextract     V->N       Extract an alpha channel as a grayscale image component.
 ... alphamerge       VV->V      Copy the luma value of the second input into the alpha channel of the first input.
 T.. bbox             V->V       Compute bounding box for each frame.
 ... blackdetect      V->V       Detect video intervals that are (almost) black.
 ... blackframe       V->V       檢測幾乎全黑的幀
 TS. blend            VV->V      Blend two video frames into each other.
 T.. boxblur          V->V       Blur the input.
 T.. colorbalance     V->V       Adjust the color balance.
 T.. colorchannelmixer V->V       Adjust colors by mixing color channels.
 T.. colormatrix      V->V       Convert color matrix.
 ... copy             V->V       複製輸入視訊到輸出
 ... crop             V->V       裁剪輸入視訊
 T.. cropdetect       V->V       自動檢測裁剪尺寸
 TS. curves           V->V       Adjust components curves.
 T.. dctdnoiz         V->V       Denoise frames using 2D DCT.
 ... decimate         N->V       Decimate frames (post field matching filter).
 ... dejudder         V->V       Remove judder produced by pullup.
 T.. delogo           V->V       去掉輸入視訊的logo
 ... deshake          V->V       Stabilize shaky video.
 T.. drawbox          V->V       在輸入視訊上畫一個顏色塊
 T.. drawgrid         V->V       在輸入視訊上畫一個顏色網格
 T.. edgedetect       V->V       檢測並畫邊緣
 ... elbg             V->V       Apply posterize effect, using the ELBG algorithm.
 ... extractplanes    V->N       Extract planes as grayscale frames.
 .S. fade             V->V       Fade in/out input video.
 ... field            V->V       Extract a field from the input video.
 ... fieldmatch       N->V       Field matching for inverse telecine.
 T.. fieldorder       V->V       Set the field order.
 ... format           V->V       Convert the input video to one of the specified pixel formats.
 ... fps              V->V       強制成常量幀率Force constant framerate.
 ... framepack        VV->V      Generate a frame packed stereoscopic video.
 T.. framestep        V->V       每N幀中選擇一幀
 T.. geq              V->V       Apply generic equation to each pixel.
 T.. gradfun          V->V       Debands video quickly using gradients.
 TS. haldclut         VV->V      Adjust colors using a Hald CLUT.
 .S. hflip            V->V       Horizontally flip the input video.
 T.. histeq           V->V       Apply global color histogram equalization.
 ... histogram        V->V       計算並畫直方圖
 T.. hqdn3d           V->V       Apply a High Quality 3D Denoiser.
 T.C hue              V->V       Adjust the hue and saturation of the input video.
 ... idet             V->V       隔行檢測濾鏡
 T.. il               V->V       去隔行或隔行場
 ... interlace        V->V       轉換逐行視訊成隔行視訊
 ... interleave       N->V       Temporally interleave video inputs.
 ... kerndeint        V->V       Apply kernel deinterlacing to the input.
 TS. lut3d            V->V       Adjust colors using a 3D LUT.
 T.. lut              V->V       Compute and apply a lookup table to the RGB/YUV input video.
 T.. lutrgb           V->V       Compute and apply a lookup table to the RGB input video.
 T.. lutyuv           V->V       Compute and apply a lookup table to the YUV input video.
 ... mcdeint          V->V       Apply motion compensating deinterlacing.
 ... mergeplanes      N->V       Merge planes.
 ... mp               V->V       Apply a libmpcodecs filter to the input video.
 ... mpdecimate       V->V       Remove near-duplicate frames.
 T.. negate           V->V       Negate input video.
 ... noformat         V->V       Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
 TS. noise            V->V       Add noise.
 ... null             V->V       Pass the source unchanged to the output.
 T.C overlay          VV->V      Overlay a video source on top of the input.
 T.. owdenoise        V->V       Denoise using wavelets.
 ... pad              V->V       Pad the input video.
 ... perms            V->V       Set permissions for the output video frame.
 T.. perspective      V->V       Correct the perspective of video.
 ... phase            V->V       Phase shift fields.
 ... pixdesctest      V->V       Test pixel format definitions.
 T.C pp               V->V       Filter video using libpostproc.
 ... psnr             VV->V      Calculate the PSNR between two video streams.
 ... pullup           V->V       Pullup from field sequence to frames.
 T.. removelogo       V->V       Remove a TV logo based on a mask image.
 TSC rotate           V->V       Rotate the input image.
 T.. sab              V->V       Apply shape adaptive blur.
 ... scale            V->V       Scale the input video size and/or convert the image format.
 ... select           V->N       選擇視訊幀並傳給輸出
 ... sendcmd          V->V       Send commands to filters.
 ... separatefields   V->V       Split input video frames into fields.
 ... setdar           V->V       Set the frame display aspect ratio.
 ... setfield         V->V       Force field for the output video frame.
 ... setpts           V->V       Set PTS for the output video frame.
 ... setsar           V->V       Set the pixel sample aspect ratio.
 ... settb            V->V       Set timebase for the video output link.
 ... showinfo         V->V       Show textual information for each video frame.
 ... shuffleplanes    V->V       Shuffle video planes
 T.. smartblur        V->V       Blur the input video without impacting the outlines.
 ... split            V->N       Pass on the input to N video outputs.
 T.C spp              V->V       Apply a simple post processing filter.
 ... stereo3d         V->V       Convert video stereoscopic 3D view.
 ... super2xsai       V->V       Scale the input by 2x using the Super2xSaI pixel art algorithm.
 ... swapuv           V->V       Swap U and V components.
 ... telecine         V->V       Apply a telecine pattern.
 ... thumbnail        V->V       Select the most representative frame in a given sequence of consecutive frames.
 ... tile             V->V       Tile several successive frames together.
 ... tinterlace       V->V       Perform temporal field interlacing.
 .S. transpose        V->V       Transpose input video.
 ... trim             V->V       Pick one continuous section from the input, drop the rest.
 T.. unsharp          V->V       Sharpen or blur the input video.
 ... vflip            V->V       Flip the input video vertically.
 T.. vignette         V->V       Make or reverse a vignette effect.
 T.. w3fdif           V->V       Apply Martin Weston three field deinterlace.
 TS. yadif            V->V       對輸入影象去隔行
 ... cellauto         |->V       Create pattern generated by an elementary cellular automaton.
 ..C color            |->V       Provide an uniformly colored input.
 ... haldclutsrc      |->V       Provide an identity Hald CLUT.
 ... life             |->V       Create life.
 ... mandelbrot       |->V       Render a Mandelbrot fractal.
 ... mptestsrc        |->V       Generate various test pattern.
 ... nullsrc          |->V       Null video source, return unprocessed video frames.
 ... rgbtestsrc       |->V       Generate RGB test pattern.
 ... smptebars        |->V       Generate SMPTE color bars.
 ... smptehdbars      |->V       Generate SMPTE HD color bars.
 ... testsrc          |->V       Generate test pattern.
 ... nullsink         V->|       Do absolutely nothing with the input video.
 ... avectorscope     A->V       Convert input audio to vectorscope video output.
 ... concat           N->N       Concatenate audio and video streams.
 ... showspectrum     A->V       Convert input audio to a spectrum video output.
 ... showwaves        A->V       Convert input audio to a video output.
 ... amovie           |->N       Read audio from a movie source.
 ... movie            |->N       Read from a movie source.
 ... ffbuffersink     V->|       Buffer video frames, and make them available to the end of the filter graph.
 ... ffabuffersink    A->|       Buffer audio frames, and make them available to the end of the filter graph.
 ... abuffer          |->A       Buffer audio frames, and make them accessible to the filterchain.
 ... buffer           |->V       Buffer video frames, and make them accessible to the filterchain.
 ... abuffersink      A->|       Buffer audio frames, and make them available to the end of the filter graph.
 ... buffersink       V->|       Buffer video frames, and make them available to the end of the filter graph.
 ... afifo            A->A       Buffer input frames and send them when they are requested.
 ... fifo             V->V       Buffer input images and send them when they are requested.

4. 其它濾鏡示例
Fancy Filtering Examples (http://trac.ffmpeg.org/wiki/FancyFilteringExamples)
– 各種迷幻效果和怪異濾鏡的示例
 
5. 開發自己的濾鏡
See FFmpeg filter HOWTO(http://blog.chinaunix.net/uid-26000296-id-3068068.html) 

相關推薦

FFmpeg使用指南

目錄 1. FFmpeg濾鏡文件 2. 示例   2.1 縮放   2.2 視訊加速   2.3 濾鏡圖,鏈和濾鏡關係   2.4 多個輸入覆蓋同一個2x2 網格   2.5 轉義字元   2.6 燒錄時間碼   2.7 描述命令列引數   2.8 測試源 3. 濾鏡列表

ffmpeg調整顏色明豔和亮度

1.亮度 eq 設定亮度、對比度、飽和度和近似伽馬(gamma)調整 濾鏡支援下面選項: contrast 設定contrast表示式,值必須是一個-2.0-2.0間的浮點數,預設為0 brightness 設定brightness表示式.值必須是一個-1.0-1.

FFmpeg中的(四):視訊 -- subtitles

subtitles 描述: 該濾鏡呼叫libass庫,講字幕添新增到輸入視訊中。如果要使用該濾鏡,需要在編譯FFmpeg時使用--enable-libass配置項。這個濾鏡需要配合使用 libavcodec和libavformat將輸入的字幕檔案轉換為ASS(ASS格式見

ffmpeg音訊

音訊濾鏡分離聲道1 轉碼(原始檔沒問題可以省略) ffmpeg -i jy.ts  -vcodec h264  -acodec aac jy1.ts2 取一個聲道 ffmpeg -i jy1.ts  -af "pan=stereo|c0=FL|c1=FL" -c:v copy

FFMPEG 最簡filter使用例項(實現視訊縮放,裁剪,水印等)

    FFMPEG官網給出了FFMPEG 濾鏡使用的例項,它是將視訊中的畫素點替換成字元,然後從終端輸出。我在該例項的基礎上稍微的做了修改,使它能夠儲存濾鏡處理過後的檔案。在上程式碼之前先明白幾個概念:     Filter:代表單個filter     FilterPa

FFmpeg一次同時多個處理

ffplay -i QQ視訊_4EB2BA95F40F7273B183B39B62EBCE3D.mp4 -vf delogo=x=30:y=50:w=25:h=100:show=1,delogo=x

新手學習FFmpeg - 呼叫API編寫實現多次淡入淡出效果的

前面幾篇文章聊了聊FFmpeg的基礎知識,我也是接觸FFmpeg不久,除了時間處理之外,很多高深(濾鏡)操作都沒接觸到。在學習時間處理的時候,都是通過在ffmpeg目前提供的avfilter基礎上面修修補補(補充各種debug log)來驗證想法。 而這次我將嘗試新建立一個avfilter,來實現一個新濾鏡。

FFmpeg libswscale原始碼分析2-轉碼命令列與

本文為作者原創,轉載請註明出處: libswscale 原始碼分析系列文章: [1]. [FFmpeg libswscale原始碼分析1-API介紹](https://www.cnblogs.com/leisure_chn/p/14349382.html) [2]. [FFmpeg libsws

HTML5----CSS3圖片(filter)特效

拖動 ner hot war str term min jquer onchange 支持Chrome: 暫不支持瀏覽器:FF,IE... 希望後者努力 效果圖: CSS: <style type="text/css"> @-webkit-key

CSS3

() rop add 書寫 mic bsp .com left filter h4 { background: #32afba; line-height: 36px; color: #fff; font-family: Microsoft YaHei; letter-spa

自己動手,實現“你的名字”

height 使用 圖片 很好 board courier mage margin ges 我喜歡《你的名字》這個故事,前一段時間在微信上使用過它的濾鏡,實現的效果很驚艷,應該類似於下面的這些結果 這三幅圖應該都是手機版本制作的,它們一個比較顯著的特點

Android平臺Camera實時實現方法探討(十一)--實時美顏

.net 兩個 其它 強人 突出 pad eight 地址 模式 上一章完畢了對圖片的磨皮處理。經過簡單算法流程優化,能夠達到非常快的速度。可是不能用於實時美顏。經實驗,若採用僅僅處理Y信號的方案。半徑極限大約是5-10,超過10則明顯感受到卡頓。但對於1920X1

Android平臺Camera實時實現方法探討(十)--代碼地址以及簡單介紹(20160118更新)

div iss 將在 spa 方法 target 用途 net dsm 簡單做了個相機和圖片編輯模塊,時間原因非常多功能還沒有做。尚有BUG,見諒,將在以後抽時間改動 代碼地址 PS:請點個Star^-^ -----------------------

PS 算法原理——碎片效果

net -a dsm 原理 -o span offset gravity == %%% Fragment %%% 對原圖做四個方向的平移。然後對平移的結果取平均 %%% 碎片效果 clc; clear all; Image=imread(‘4.jpg‘

GLSL/C++ 實現效果

概念 第一個 美麗 函數 form 一個 傳遞 eve 針對 入門效果之浮雕 "浮雕"圖象效果是指圖像的前景前向凸出背景。常見於一些紀念碑的雕刻上。要實現浮雕事實上很easy。我們把圖象的一個象素和左上方的象素進行求差運算。並加上一個灰度。這個

CoreImage 中的模糊

最好 make category emf down 句柄 效果 effective connect 1.CoreImage 中的模糊濾鏡 1.1CoreImage是蘋果用來簡化圖片處理的框架 1.2CIImage、CIFilter與CIContext三者聯系

css3效果

gid tran microsoft for 效果 image pix lte css filter:blur(3px); -webkit-filter:blur(3px); -moz-filter:blur(3px); -o-filter:blur(3px); filte

圖像像素基本操作——自然系列

風格 str uil ext image 查找表 stack load ati 主要代碼如下: package chapter5; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; impo

實現IE兼容方案之一(

alpha arp ie6 code pix fault 技術 bsp work 當 CSS3 遇上較低版本 IE,濾鏡就成了實現兼容性的折衷方案之一。雖然濾鏡是過時很久的技術了,但還是能看出微軟的高瞻遠矚——早在 IE6 就用濾鏡實現了 bug 叢

Qt與FFmpeg聯合開發指南(三)——編碼(1):代碼流程演示

開啟 fault 原因 上下 sizeof ffmpeg 不同步 目前 直接 前兩講演示了基本的解碼流程和簡單功能封裝,今天我們開始學習編碼。編碼就是封裝音視頻流的過程,在整個編碼教程中,我會首先在一個函數中演示完成的編碼流程,再解釋其中存在的問題。下一講我們會將編碼功能進