[FFmpeg-devel] Why does vp56_init() sets avctx->width and avctx->height to 0?

Aurelien Jacobs aurel
Sun Aug 31 16:16:14 CEST 2008


On Sat, 30 Aug 2008 17:44:52 +0200
Stefano Sabatini <stefano.sabatini-lala at poste.it> wrote:

> On date Saturday 2008-08-30 16:55:57 +0200, Aurelien Jacobs encoded:
> > Stefano Sabatini wrote:
> > 
> > > Hi,
> > > 
> > > this causes a bug both in ffprobe (prints widht=size=0) and causes
> > > a division by 0 exception in libavfilter/vf_scale when it tryies
> > > to set the parameters for the filter.
> > > 
> > > What's the point into setting those values to 0?
> > 
> > The point is that the actual frame width and height are not known
> > at this point. They only get known after parsing the header of the
> > first key frame.
> > And also don't forget that those value may change at every key frame.
> > The width/height is not an intrinsic property of a video stream, it's
> > a property of each individual frame.
> 
> Thanks, it makes sense.
> 
> I wonder if this is a property of some some codecs, and if it would be
> useful to mark somewhere this capability (for example
> CODEC_CAP_VARIABLE_VIDEO_FRAME_SIZE).
> 
> And for what regards libavfilter: for what I understood, the
> capabilities negotiation between the filters happens during the
> initialization of the filters graph, is libavfilter supposed to manage
> cases when the video frame size may change after the initialization?

I haven't look at how libavfilter manage this, but it shouldn't consider
frame size as something fixed which can be initialized once.
It should consider that frame size can change at every frame, and
modify the filter chain setup accordingly if frame size changes.

Aurel




More information about the ffmpeg-devel mailing list