[FFmpeg-devel] [RFC] AVFilter Parser

Michael Niedermayer michaelni
Fri Mar 21 22:02:35 CET 2008


Hi

Well, after various flames, discussions, some implementation and so on.
Heres yet another proposal, this time mostly properly defined, i hope this
will avoid flames and misuderstandings.
This one is quite similar to the previous proposals, the main difference
besides a clear definition of things is the feedback/feedforward syntax.
The new syntax avoids the often cited problem with string insertion of
predefined filter graphs and name colissions.

------------------------

filter_id:
    any alpha numeric string identifying a filter

parameters:
    any string

filter_with_parameters:
    filter_id
    filter_id=parameters
    Such a filter has a unique number of inputs and outputs.

input_redirector
    num<id
        redirects input from id from the right into stream num
    id>num
        redirects input from id from the left into stream num
    The specified stream num is inserted thus there is 1 input more
    for each input_redirector. The renumbering though is delayed after
    all input_redirectors are processed.

output_redirector
    num>id
        redirects output from stream num into id rightward
    id<num
        redirects output from stream num into id leftward
    The specified stream num is removed thus there is 1 output less
    for each output_redirector.The renumbering though is delayed after
    all output_redirectors are processed.

redirection example:
1<T picInPic, split T<1, split 1>T, scale, T>1 picInPic
or
1<T picInPic, split T<1, split , scale;nop , picInPic


--> picInPic -> split--> split --> scale --> picInPic -->
  >                  \        \            >
/                     \        \_________/
\_____________________/



2<X 0<L Filter0 L<0 2>Y ; Y>0 2<L Filter1 L<2 X<0

   _________
  /         \
  \          |
   >        /
---> Filter0 --->
   >        \
  /          |
  \____  ___/
       \/
   ____/\___
  /         \
  \          |
   >        /
---> Filter1 --->
   >        \
  /          |
  \_________/


atomic_filter:
    filter_with_parameters
    input_redirector atomic_filter
    atomic_filter output_redirector

paralel_filter:
    filter1;filter2;...;filterN
    N paralelly placed filters. N can be 1 or larger.
    The inputs to the paralel_filter will be routed in order begining with
    the first input of the filter filter, second input of the first filter, ...
    outputs will be routed similarly.

filter_chain:
    paralel_filter1,paralel_filter2,...,paralel_filterN
    A chain of N filters. N can be 1 or larger.
    All outputs of each filter are routed in order to
    the next (more to the right) filters inputs.
    The inputs of the filter_chain are exactly the inputs of paralel_filter1
    The outputs of the filter_chain are exactly the outputs of paralel_filterN

filter:
    atomic_filter
    (filter_chain)


Permutation filter:
    p=a1:a2:...:aN
        N inputs, N outputs
        output n is matched to input an
        not all inputs have to be used
    p=b::a1:a2:...:aN
        b inputs, N outputs
        output n is matched to input an
        not all inputs have to be used

nop=N
    N inputs, N outputs
    inputs passed through unchanged
    if =N is ommited N=1 is assumed

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080321/6015ea36/attachment.pgp>



More information about the ffmpeg-devel mailing list