[FFmpeg-devel] [RFC] AVFilter Parser

Vitor Sessak vitor1001
Sun Mar 23 16:21:57 CET 2008


Hi

vmrsss wrote:
> Hi Michael,
> 
> On 21 Mar 2008, at 21:02, Michael Niedermayer wrote:
>> 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.
> 
> Yes, we are converging, I like this much better, and I am glad the  
> idea of user-defined filters has survived.

In a way it survived, but in another way that idea was never been born. 
The idea is to first have a good filter chain syntax for getting 
libavfilter into main SVN. One of things that make a good syntax is the 
possibility of been expandable to, in the future, allow for user-defined 
filters.

Finally, what I _really_ don't understand is why do you think 
user-defined filters should be parsed by simple string substitution? Why 
couldn't be parsed by another parser context (another context == no name 
clashes)?

> 
> (1) Why not to had a conditional expression on filters parameters to  
> do the kind of thing Vitor suggested a few emails ago:
> 
>> static void init(char *args, AVFilter *ctx) {
>>     int ang= atoi(args);
>>     switch (ang) {
>>     case 90:
>>         ctx->actual_filter = "transpose,vflip";
>>         break;
>>     case 180:
>>         ctx->actual_filter = "hflip,vflip";
>>         break;
>>     case 270:
>>         ctx->actual_filter = "vflip,transpose";
>>         break;
>>     else
>>         snprintf(ctx->actual_filter, "rotate_slow=%d", ang);
>>         break;
>>     }
>> }
> 
> at the filter-scripting/combination stage? Eg it could be:
> 
> filter ::= .... | conditional_filter
> 
> conditional_filter ::=  case(parameter) of v1 -> filter1 , v2 ->  
> filter2 , .... , vk -> filterk
> 
> where v1, ..., vk are constants and all filter1,...,filterk have the  
> same number of input and of output streams.

It may be a good idea, depending on how it is implemented. Anyway, I 
won't be working at any expansion of the syntax before lavfi is in SVN. 
Priorities first.

> (2) is it OK to send a pdf attachment to the list? just in case one  
> needs to draw a complex graph...

I don't think there is any problem if it has a reasonable size (a pdf of 
a graph can have less than 100 kb)...

-Vitor




More information about the ffmpeg-devel mailing list