[FFmpeg-devel] [PATCH] List supported video size and rate abbreviations

Michael Niedermayer michaelni
Fri Jun 29 11:01:34 CEST 2007


On Thu, Jun 21, 2007 at 12:47:34PM +0200, Stefano Sabatini wrote:
> > > > > and iam not completely sure if i like this implementation, somehow i
> > > > > dont ...
> > > 
> > > what i meant here is that it might make more sense to export a
> > > size and a framerate table directly
> > > with pix_fmt the information which is stored is likely going t change so
> > > directly exporting the table cant be done but here, hell what do you want
> > > to store in a table of abbreviations and width/height?
> > > (and yes the size and framerate tables should be split)
> > 
> > Thank you Michael for the much needed explanations.
> > 
> > I think the best thing to do is to redesign the abbreviations system,
> > which I'll discuss into another thread, *then* eventually I'll jump
> > back to this one.
> Here I am again!
> I moved the video size/rate abbreviations system from libavformat to
> libavcodec and splitted video frame size and rate abbreviations table
> in previous patches. 
> Suggested log message:
> "Add support for listing the supported video size and rate abbreviations".
> In order to support this functionality, this patch does:
> * defines the functions
>   libavcodec/utils.c:av_video_frame_{size,rate}_abbr_string, modeled
>   after avcodec_string and avcodec_pix_fmt_string, which fill a string
>   buffer with the corresponding abbreviation info, and exports them in
>   libavcodec/avcodec.h.
> * defines the functions list_video_frame_{size,frame}_abbrs in
>   ffmpeg.c, modifies opt_frame_{size,rate} to get them support the
>   'list' argument, and updates the corresponding documentation strings
>   in the options struct.
>   Once applied another patch is required for reindentation.
> * updates doc/ffmpeg-doc.texi accordingly
> Please note that rather than export the abbreviations tables in
> avcodec.h as Michael suggested, I preferred to define the
> av_video_frame_{size,rate}_abbr_string functions, which seemed to me
> more consistent with the avcodec_pix_fmt_string/list_pix_fmts method,
> please let me know if you prefer Michael's suggestion (export
> video_frame_{rate,size}_abbrs in avcodec.h, no need for av_*_string
> corresponding functions).

ive thought about this again and the functions are unacceptable as is
adding list_foobar() functions for everything is bloated and very unflexible

how to find an abbreviaion correspoding to a width/height? how to
convert the table to whatever command line parsing system a
application uses, ...

we cant add 5 functions for every field in every struct we have to make
it possible to use named values, thats very significantly too messy

for the frame_rates i would suggest to add the values to the AVOption
array in utils.c

for width/height i would rather see some improvements done to AVOption
to support arrays of values

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070629/57b7fae5/attachment.pgp>

More information about the ffmpeg-devel mailing list