Changes between Version 1 and Version 2 of FancyFilteringExamples


Ignore:
Timestamp:
May 30, 2012, 1:58:58 AM (7 years ago)
Author:
ubitux
Comment:

Add an audio aevalsrc example

Legend:

Unmodified
Added
Removed
Modified
  • FancyFilteringExamples

    v1 v2  
    11= Fancy Filtering Examples =
    22
    3 == mandelbrot ==
     3== Video ==
     4
     5=== mandelbrot ===
    46{{{
    57ffplay -f lavfi -i mandelbrot
     
    79}}}
    810
    9 == cellauto ==
     11=== cellauto ===
    1012{{{
    1113ffplay -f lavfi -i cellauto
     
    1315}}}
    1416
    15 == life ==
     17=== life ===
    1618{{{
    1719ffplay -f lavfi life=s=640x480:mold=10:r=100:ratio=0.1:death_color=blue:life_color=#00ff00,boxblur=2:2
    1820}}}
     21
     22== Audio ==
     23
     24=== aevalsrc ===
     25
     26Making some random "musical" keys:
     27
     28{{{
     29% cat expr
     30# floor(t): 0 0 0 0 0 ... 1 1 1 1 1 ... 2 2 2 2 2
     31#  => set a random key when floor(t) changes
     32if(eq(floor(t),ld(2)),
     33    st(0,random(4)*3000+1000));
     34
     35# the next value to compare floor(t) with
     36st(2,floor(t)+1);
     37
     38# mod(t,1) makes t always in the range [0;1) for each key
     39st(1,mod(t,1));
     40
     41# 0.6*... + 0.4*... for "echo" effect
     42# exp() to mitigate the sound according to the time
     43(0.6*sin(1*ld(0)*ld(1))+
     44 0.4*sin(2*ld(0)*ld(1)))*exp(-4*ld(1))
     45}}}
     46
     47And to test it:
     48
     49{{{
     50ffplay -f lavfi -i "aevalsrc=$(grep -v '^#' expr|tr -d '\n'|sed 's/\([,;]\)/\\\1/g')"
     51}}}