[FFmpeg-devel] [RFC] Expose more legal encoding parameters from AVCodec

Stefano Sabatini stefano.sabatini-lala
Tue Apr 8 13:17:45 CEST 2008

On date Monday 2008-04-07 17:47:06 +0200, Michael Niedermayer encoded:
> On Mon, Apr 07, 2008 at 04:35:27PM +0200, Stefano Sabatini wrote:
> > Hi all,
> > 
> > AVCodec already contains the capabilities, pix_fmts and
> > supported_framerates fields, which tell (if specified) some of the
> > parameters which are supported for encoding/decoding.
> > 
> > I would like to extend such features, for example to expose: 
> > * a more verbose description of the codec, similiar to the
> >   long_description already implemented in libavformat.  Also relevant
> >   is [1].
> > 
> > * valid sizes for the video streams, for example as in the case of
> >   H263 which only supports a limited legal set of sizes
> > 
> > * legal audio samplerates (e.g. as in MP2)
> > 
> > * others?
> > 
> > This would be useful both for the command line user (if we provide
> > some way to convey this information to the user, I'm thinking for
> > example to extend ffprobe for this) and in a scenario of adaptive
> > encoding, where you have to programmatically choose which parameters
> > is better to use in function of the available
> > storage/computing/bandwidth resources, and reimplementing this in
> > every application doesn't sound that good.
> > 
> > If maintainers see this like a good idea I could start to elaborate
> > more on this.
> I think its a good idea in principle ...


Excellent, here it is a list of the fields I would like to see
implemented each one with a corresponding braindump, please comment on
them if you have suggestions/blames regarding them.


As in AV{Input|Output}Format, the names could sound
something like:

mpeg1video -> "Mpeg 1 video",
"wmv2" -> "Windows Media Video version 8"
"msmpeg4v2" -> "Mpeg 4 part 2 Microsoft variant version 2"
"flv" -> "Flash video"
"h264" -> "H.264 aka Mpeg 4 part 10 aka AVC (Advanced Video Codec)"

etc., I don't know if it is a good idea also to add
" encoder"/" decoder" at the end of each description.

Also how to document non native codecs? What about something like:
libfaac -> "libfaac based AAC (Advanced Audio Codec)" 


It could be a simple list of integers terminated by -1 like in


There isn't a structure used to define a video size in libavcodec, we
could create such thing then have a list as in supported_framerates,
otherwise we could use a simple array of strings then use
av_parse_video_frame_size() to parse them.


Should express the maximum and minimum number of channels supported by
the stream.

I don't know if it makes sense a min_audio_channels field, maybe there
is some codec which doesn't support for example less than 2 channels.

Best regards.
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)

More information about the ffmpeg-devel mailing list