[FFmpeg-devel] [PATCH 3/5] ffmpeg: flush and drain video filters.

Mark Himsley mark at mdsh.com
Thu Mar 15 00:02:51 CET 2012


On 13/03/2012 20:13, Michael Niedermayer wrote:
> On Tue, Mar 13, 2012 at 07:26:56PM +0100, Nicolas George wrote:

>> Maybe I can be more clear by stating it the other way: a filter should
>> output its frame as soon at it can, as a reaction from one of its input, and
>> not wait for a request on its output.
>
> This sounds much better indeed

Sorry - I've come back into this thread a bit late.

I have a problem with push only. With push only how does a filter know 
that it has reached the end of the input?

Take as an example a filter that creates some form of average of the 
previous and current frames.

For the first frame of the stream the filter will know that there is no 
previous frame and will take the appropriate steps of caching the first 
frame and outputting nothing.

For the second and all subsiquent frames (except for the last) the 
filter will output it's average, cache a new frame and discard the previous.

But what is going to signal to the filter that there will never be 
another frame? Surely the filter will just hang waiting for the next 
frame, that will never come.

As I've said before, there needs to be a "there are no more incoming 
frames so please flush your output" flag somewhere.


I like the idea of the return of the pull indicating EOF or AGAIN.

An alternative for push only would be to mandate that there will always 
be an extra push that indicates EOF.

-- 
Mark


More information about the ffmpeg-devel mailing list