Version 12 (modified by richardpl, 8 years ago) (diff) |
---|
Fancy Filtering Examples
Contents
Video
cellauto
ffplay -f lavfi -i cellauto=rule=110
Other interesting cellauto rule values: 9, 18, 22, 26, 30, 41, 45, 50, 54, 60, 62, 73, 75, 77, 82, 86, 89, 90, 97, 99, 101, 102, 105, 107, 109, 110 (default), 124, 126, 129, 131, 133, 135, 137, 145, 146, 149, 150, 151, 153, 154, 161, 167, 169, 181, 182, 183, 193, 195, 210, 218, 225.
life
ffplay -f lavfi -i life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
ffplay -f lavfi -i life=s=640x480:mold=10:r=100:ratio=0.1:death_color=blue:life_color=#00ff00,boxblur=2:2
mandelbrot
ffplay -f lavfi -i mandelbrot
mirror effect
ffplay -i INPUT -vf "crop=iw/2:ih:0:0,split[tmp],pad=2*iw[left]; [tmp]hflip[right]; [left][right] overlay=W/2"
video channel separation effect with lut filter
ffmpeg -f lavfi -i testsrc=d=10 -filter_complex "split=4[a][b][c][d];[a]pad=iw*4:ih[w];[b]lutrgb=g=0:b=0[x];[c]lutrgb=r=0:b=0[y];[d]lutrgb=r=0:g=0[z];[w][x]overlay=w:0[wx];[wx][y]overlay=w*2:0[wxy];[wxy][z]overlay=w*3:0" -f nut - | ffplay -
ffmpeg -f lavfi -i testsrc -filter_complex "split=4[a][b][c][d];[a]pad=iw*4:ih[w];[b]lutyuv=u=128:v=128[x];[c]lutyuv=y=0:v=128[y];[d]lutyuv=y=0:u=128[z];[w][x]overlay=w:0[wx];[wx][y]overlay=w*2:0[wxy];[wxy][z]overlay=w*3:0" -f nut - | ffplay -
histogram
ffmpeg -f lavfi -i mandelbrot -vf "split=4[a][b][c][d],[d]histogram=display_mode=overlay:level_height=244[dd],[a]histogram=mode=waveform:waveform_mode=row:display_mode=overlay[aa],[b]histogram=mode=waveform:waveform_mode=column:display_mode=overlay[bb],[c]pad=iw+256:ih+256[cc],[cc][aa]overlay=x=W-256[ccc],[ccc][bb]overlay=y=H-256[x],[x][dd]overlay=y=H-256:x=W-256" -f nut - | ffplay -
Audio
aevalsrc
Making some random "musical" keys:
% cat expr # floor(t): 0 0 0 0 0 ... 1 1 1 1 1 ... 2 2 2 2 2 # => set a random key when floor(t) changes if(eq(floor(t),ld(2)), st(0,random(4)*3000+1000)); # the next value to compare floor(t) with st(2,floor(t)+1); # mod(t,1) makes t always in the range [0;1) for each key st(1,mod(t,1)); # 0.6*... + 0.4*... for "echo" effect # exp() to mitigate the sound according to the time (0.6*sin(1*ld(0)*ld(1))+ 0.4*sin(2*ld(0)*ld(1)))*exp(-4*ld(1))
And to test it:
ffplay -f lavfi -i "aevalsrc=$(grep -v '^#' expr|tr -d '\n'|sed 's/\([,;]\)/\\\1/g')"
showwaves and showspectrum
Given the audio file april.flac:
ffplay -f lavfi 'amovie=april.flac,asplit=3[out1][a][b]; [a]showwaves=s=640x240,pad=iw:ih*2[waves]; [b]showspectrum=s=640x240[spectrum]; [waves][spectrum] overlay=0:h [out0]'
Attachments (22)
-
mandelbrot.png
(99.4 KB) -
added by llogan 9 years ago.
mandelbrot image
-
life.png
(8.8 KB) -
added by llogan 9 years ago.
life image
-
cellauto.png
(4.9 KB) -
added by llogan 9 years ago.
cellauto image
-
ffplay-mirror.jpg
(19.6 KB) -
added by ubitux 9 years ago.
Mirror effect with lavfi
-
life2.png
(86.9 KB) -
added by ubitux 9 years ago.
Second example for life filter (blue & blur)
-
ffplay-waves-spectrum.png
(220.9 KB) -
added by ubitux 8 years ago.
FFplay with showwaves and showspectrum
-
rgb_sep.jpg
(22.7 KB) -
added by dericed 8 years ago.
original image plus images of the separations of the R, G, and B channels
-
yuv_sep.jpg
(17.0 KB) -
added by dericed 8 years ago.
original image plus images of the separations of the Y, U, and V channels
- histograms.png (835.6 KB) - added by richardpl 8 years ago.
- waveform.jpg (41.2 KB) - added by dericed 7 years ago.
- waveforms_vectorscope.png (504.4 KB) - added by richardpl 5 years ago.
- polar_avectorscope.png (56.6 KB) - added by richardpl 5 years ago.
- waveforme.png (367.9 KB) - added by richardpl 5 years ago.
- showcqt.png (208.6 KB) - added by richardpl 5 years ago.
- mcspectrum.jpeg (178.0 KB) - added by richardpl 5 years ago.
- firespectrum.jpeg (116.3 KB) - added by richardpl 5 years ago.
- showspectrumpic.jpg (732.3 KB) - added by richardpl 5 years ago.
- wfmg.jpg (284.2 KB) - added by richardpl 5 years ago.
- wfmgc.jpg (220.4 KB) - added by richardpl 5 years ago.
- datascope.jpg (638.1 KB) - added by richardpl 4 years ago.
-
showcqt-sidebyside.jpg
(345.3 KB) -
added by varenc 8 weeks ago.
Visualizing a video's audio side by side with showcqt
-
showcqt-sidebyside.2.jpg
(309 bytes) -
added by varenc 8 weeks ago.
delete this, it's just a duplicate. Attempting to overwrite the bad one now