[FFmpeg-devel] Command-line parameters used too late for has_codec_parameters()

Luca Abeni lucabe72
Fri Jan 16 12:07:09 CET 2009

Hi Alexandre,

> Hi,
> Currently in av_find_stream_info(), the logic deciding whether or not to 
> engage into parameter-guessing (by pre-reading several frames), which 
> calls  has_codec_parameters(), comes _before_ command-line parameters 
> like -pix_fmt get copied into the fields of the codec.

I think parameters like width, height, and pixel format are encoded in the
H.263 bitstream... In particular, I suspect pix_fmt is always PIX_FMT_YUV420P.
Such value is immediately set in ff_h263_decode_init() (which, if I understand
well, is called as soon as you start decoding the bitstream). Hence, I think
that if you see PIX_FMT_NONE after parsing more than 1 frame there is a
problem somewhere.

width and height should also be set as soon as their value appear in the
bitstream... I suspect there is a frame encoding width and height at the
beginning of every GOP? (so, after parsing at most one GOP such values should
be set, I think...).

Anyway, I think you can set width and height in rtp_parse_open()...
In this way, av_find_stream_info() should see the parameters as properly set,
and you have no delay (uhm... You probably also have to set the codec's time


More information about the ffmpeg-devel mailing list