[Ffmpeg-devel] [PATCH] fix -ab default

Benoit Fouet benoit.fouet
Tue Mar 6 22:29:52 CET 2007


Hi (it's been a while since i posted :) ),

Michael Niedermayer wrote:
> Hi
>
> attached patch adds a new avcodec_get_context_defaults2() and 
> avcodec_alloc_context2() which take an additional CodecType as argument
>
> it adds a av_opt_set_defaults2() which has a flags parameter so only
> specific defaults are used
>
> and it adds a -ab to AVOption whos flags specify that it only applies for
> audio and -b only applies to video
>   
i just wanted to add, as a precision, that the audio bitrate resulting
from the following command line:
ffmpeg -i in.whatever -ab foo -b bar something.else
will be bar bits/s, and not foo bits/s

> and last it makes ffmpeg.c use the new code
>
> all that together fixes the -ab default (note the recent changes to
> command line option handling did not truly introduce this bug it was
> rather hidden by the old code ...)
>
> so everyone who flamed please now read and comment! that is
> comment now not after i applied it!
>
> is CodecType a good choice as argument for the default setting function?
> i choose it as it was slightly easier, alternatives are AVCodec and
> CodecID, the advantage of the later 2 would be that we would move
> toward being able to have per codec defaults which could come in handy
> for x264
>
> is the flag parameter as ive implemented for av_opt_set_defaults2() ideal
> or does anyone has a better more flexible idea?
>
> PS: yes this patch matters independant of the recent change, even if
> its reverted this change is still usefull ...
>
>   
well, now that i have finally compiled all that, with your patch, it
appears that default video bitrate is set to 64kb/s...
i've been looking at it for a while but i don't find how/why it is so...
if you have any pointers, i'll look at it tomorrow, after some sleep :)

Ben





More information about the ffmpeg-devel mailing list