[FFmpeg-devel] [WIP] select filter

Stefano Sabatini stefano.sabatini-lala at poste.it
Sun May 22 01:14:01 CEST 2011


On date Saturday 2011-05-21 14:20:20 +0200, Michael Niedermayer encoded:
> On Fri, May 20, 2011 at 10:17:32AM +0200, Stefano Sabatini wrote:
> > Please comment on design and syntax, depends on patches:
> >     vsrc_buffer: return an error code if no frames are available
> >     ffmpeg: handle the case when get_filtered_frame() fails
> > 
> > Missing documentation.
> > -- 
> > FFmpeg = Funny Formidable Moronic Puristic Ecumenical Generator
> 
> >  Makefile     |    1 
> >  allfilters.c |    1 
> >  vf_select.c  |  264 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 266 insertions(+)
> > df88016805e3ef4a44d3c1bb95bef2a7263e7932  0003-lavfi-add-select-filter.patch
> > From 08880c08d188aa8c0528f69178716d9ad430bd61 Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > Date: Sat, 7 May 2011 02:06:25 +0200
> > Subject: [PATCH] lavfi: add select filter
> 
> IMO this filter should be commited
> 
> also a "skip similar frames" filter would be usefull, and should be
> able to share quite a bit of code with this

Extended with an idea which I had today.

If the source declares it has cached frames, select enables a "cache
mode", frames are requested and cached in the select filter in case
they meet the select condition, and immediately returned in
request_frame().

This should/can be improved, indeed now it caches only one frames, in
case poll_frame() declares N frames, request() in cache-mode should be
called N times, each selected frame should be cached, poll will
finally return the number of selected cached frames.

Seems to work fine in my mind simulator, I'll try to extend the idea
to N frames (which should be rather easy).

BTW buffer should also be extended to support multiple frames caching.
-- 
FFmpeg = Funny and Fantastic Miracolous Porno Empowered Gigant


More information about the ffmpeg-devel mailing list