[FFmpeg-devel] [PATCH] Configure graph filters with more than one output
Stefano Sabatini
stefano.sabatini-lala
Sun May 31 18:51:31 CEST 2009
On date Sunday 2009-05-31 16:47:57 +0200, Vitor Sessak encoded:
> Stefano Sabatini wrote:
>> On date Saturday 2009-05-30 20:56:16 +0200, Vitor Sessak encoded:
>>> Stefano Sabatini wrote:
>>>> Hi all,
>>>>
>>>> I'm experimenting with a graph chain of this kind:
>>>> ffplay in.avi -vfilters "split [out] [select], [select] select='eq(mod(N, 10), 0)', snapshot"
>>> I suppose you mean
>>>
>>> ffplay in.avi -vfilters "split [out] [select]; [select] select='eq(mod(N, 10), 0)', snapshot"
>>>
>>> (note the ';')
>>
>> It's equivalent to the previous syntax in this specific case.
>>
>>> or
>>>
>>> ffplay in.avi -vfilters "split [out] select='eq(mod(N, 10), 0)', snapshot"
>>
>> This is wrong syntax.
>
> Indeed, 100l. I meant
>
> "split [out], select='eq(mod(N, 10), 0)', snapshot"
>
>> stefano at geppetto ~/s/l/ffmpeg> ffplay in.avi -vfilters "split [out] select='eq(mod(N, 10), 0)', snapshot"
>> FFplay version SVN-r18854, Copyright (c) 2003-2009 Fabrice Bellard, et al.
>> [...]
>> Unable to parse graph description substring: "select='eq(mod(N, 10), 0)', snapshot"
>>
>>> ?
>>>
>>>> the problem is that the config_props of the snapshot is never called,
>>>> since the code which do the configuration:
>>>>
>>>> if(avfilter_config_links(filt_out)) goto the_end;
>>>>
>>>> only configure the part of the graph from the application output
>>>> filers towards the beginning.
>>>>
>>>> Suggested function call avfilter_config_links(filt_out) on all the
>>>> output filters of a graph (that is filters which one input and no
>>>> output).
>>>> +int avfilter_graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
>>>> +{
>>>> + AVFilterContext *filt;
>>>> + int i, ret;
>>>> +
>>>> + for (i=0; i < graph->filter_count; i++) {
>>>> + filt = graph->filters[i];
>>>> +
>>>> + if (!filt->output_count) {
>>>> + if ((ret = avfilter_config_links(filt)))
>>>> + return ret;
>>>> + }
>>>> + }
>>> Hmmm... I'm fine with the patch, but I think this makes the
>>> recursiveness of avfilter_config_links() useless.
>>
>> Why?
>>
>> avfilter_config_list() recursiveness works in the direction from an
>> output link towards all the connected sources in input, but you need
>> to call it on each output if you have a graph with more than one
>> output.
>
> For what could such a function be useful? I imagine that one wants
> either to configure the whole graph or a single link, but what is the
> use of configuring a specific subgraph of the whole chain?
>
>>> Since it doesn't work for the example you've given, I'd say it
>>> should be removed (but it can be another patch).
>>
>> I really cannot understand this, should we keep it or should we remove
>> it, what is not working?
>
> I think the initial idea of this function was of recursively initialize
> the whole graph. Of course, it does not do that right now, as your
> example shows. So my opinion is that the recursion should be removed.
Thanks for the explanation.
And patch applied.
--
FFmpeg = Fantastic & Fundamental Mind-dumbing Portable Esoteric Glue
More information about the ffmpeg-devel
mailing list