[FFmpeg-devel] [RFC] libavfilter-soc and variable-frame-size video streams

Aurelien Jacobs aurel
Mon Dec 15 01:02:39 CET 2008


Michael Niedermayer wrote:

> On Sun, Dec 14, 2008 at 04:56:53PM +0100, Stefano Sabatini wrote:
> > On date Sunday 2008-12-14 01:40:11 +0100, Michael Niedermayer encoded:
> > > On Sun, Dec 14, 2008 at 12:48:14AM +0100, Stefano Sabatini wrote:
> > [...]
> > > > Now my problem is that the config_props of the scale filter will fail
> > > > when called the first time during configuration in the case the input
> > > > filter set values of w and h to 0 in the input link, which happens in
> > > > the already mentioned case (VP6), and the scaler cannot be initialized
> > > > with meaningful values.
> > > 
> > > what exactly are you doing?
> > 
> > Setting up the chain before the actual processing. The scale filter
> > cannot be initialized with w,h values set to 0, since those values
> > cannot be used for initing the swscale context. In order to test I was
> > bluffing, making config_props always return 0 (as long as when the
> > first frame arrives a frame size change is detected and the filter is
> > reconfigured, this time with a valid value).
> > 
> > > by the time the filter layer is initialized some width&height should be
> > > available. I mean av_find_stream_info() will not return before this is
> > > available.
> > 
> > So maybe we should change the vp56.c code to make it set some value in
> > the codec context even before the first frame is actually decoded.
> 
> no, there is a bug somewhere.
> 
> * either you init the avfilters too early
> * vp6 sets w/h to 0 after they have been set to non 0
>   this violates the API and iam not sure how anything could work if this is
>   what happens

Not sure it really violated the API, but I've just modified vp6 so that it
don't set dimensions to 0x0 at codec init.
Now, libavfilter shouldn't need to care about this issue anymore.
It "only" need to support dimensions change during playback.
If you need a sample to test this:
http://samples.mplayerhq.hu/V-codecs/VP6/size_change.nsv

Aurel




More information about the ffmpeg-devel mailing list