[FFmpeg-devel] [PATCH] make av_get_bit_rate part of public API

Robert Krüger krueger
Fri Nov 27 13:32:19 CET 2009

On 25.11.2009, at 01:28, Michael Niedermayer wrote:

> On Sat, Nov 21, 2009 at 03:10:38PM +0100, Robert Kr?ger wrote:
>> Hi,
>> this patch adds a prototype for av_get_bit_rate (implemented in
>> libavcodec/utils.c) to avcodec.h.
> why is AVCodecContext.bit_rate not set?

you mean instead of returning it or do both, return the value and set  
it in AVCodecContext (in the audio case because in all others it is  
taken as the source of this information)?

The primary reason I didn't set it was that I attempted a refactoring,  
i.e. didn't want to change behaviour. if you say it makes sense to set  
it there, the next question would be, where it is called because it  
seems a bit strange to have the field set as a side effect of calling  
something like avcodec_string. I don't know enough about ffmpeg or  
libav yet to decide where that would make sense. However, if it would  
happen in some initialization code which is typically called before  
someone obtains an AVCodecContext pointer, there would be no reason to  
have this function in the API (which I personally would also be OK  
with as my main motivation for the changes is to have libav expose the  
same bit rate information via API that ffmpeg shows as output on the  
command line).


More information about the ffmpeg-devel mailing list