[Ffmpeg-devel] changing frame rate and bit rate after openingcodec

leon z leonleon77
Wed Aug 16 08:53:22 CEST 2006


> > Hi all,
> >
> > a quick question on Lavc - if I need to modulate frame rate (or bit 
>rate)
> > of some codec after I have already opened it - is it possible without 
>say
> > closing and reopening the codec? If it is possible - is there anything 
>more
> > to it than setting the relevant structure variables?
>
>you can change the timestamps of the frames and you can change the 
>quantizer
>which will do what you want, there is no such thing as a framerate there is
>just a time base and that cannot be chaged within a stream, not even with
>reopening the codec (ok you can probably change it but the file would be
>broken)

mmm - I am not writing anything to any files - just calling encode_video for 
each of the images (then decoding the data in another app - one encoded 
image data at a time by calling decode_video) ...

my understanding is that Lavc will automatically adjust the quality of its 
encoding based on the required bit_rate and time base settings... what I 
want to do is to tell lavc on the fly (i.e. between two calls to 
encode_video) that my bandwidth requirements have changed and expect it to 
automatically recalculate its quantizer settings so that the ongoing calls 
to encode_video will produce lesser size output as to conform to the new 
bit_rate... am I missing something? Or are you saying that I should then 
control the bit_rate manually by adjusting the quality of the codec 
explicitly (i.e. turn off lavc's rate control)?

By the way - what are the units for bit_rate in the AVCodecContext struct? I 
was presuming them to be bits per second, but then (even with strict 
bit_tolerance values) I cannot really get to anything really low like 11 
kb/s at 8 fps on 300x200 sizes or thereabouts...


leon.

_________________________________________________________________
Need FREE FUEL? Become a member of Qualified Opinions 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Equalifiedopinions%2Ecom%2Fsurvey%2Ephp%3Fsource%3Dhml%5Ftgl%5F1&_t=757739466&_r=emailtagline_july_harris&_m=EXT





More information about the ffmpeg-devel mailing list