[Ffmpeg-devel] Re: AMR bitrate

Martin marthi
Mon Nov 13 10:57:25 CET 2006


Hi,

Benjamin Larsson wrote:
> Martin skrev:
> 
>> Hi,
>>
>> gravsten at yahoo.com wrote:
>>
>>>>> I have a question regarding encoding and decoding of AMR using
>>>>> ffmpeg. To me it seems that the bitrate mode is fixed after
>>>>> avcodec_open(). Is that correct (the bitrate mode cannot be changed
>>>>> on the fly)?
>>>>
>>>> No the bitrate can't be changed on the fly and user questions
>>>> to the user list.
>>>
>>>
>>> Actually, the standard let one negotiation a set of AMR bit rates
>>> beforehand,
>>> and the transmitter may arbitrarily change bitrate within the agreed
>>> set on an
>>> AMR frame boundary (20ms).
>>>
>>> I am unsure whether ffmpeg let you change the bitrate on-the-fly
>>> (i.e. without
>>> close/open codec), but if not, you should be able to fix this by
>>> merely making
>>> the AMR codec access a bitrate value in the avctx structure directly
>>> (ffmpeg
>>> only serves as a proxy to an external AMR library originally from the
>>> ITU).
>>
>>
>> thanks for clarifying that!
>> I tested it and it worked. Would you accept a patch for that? There
>> shouldn't be a downside in directly accessing the avctx structure, right?
>>
>> Martin
> 
> 
> Send the patch for review.

Attached a patch for amr bitrate mode which can now be changed "on the
fly" through avctx->bitrate.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-6883-patch-amr_bitrate_mode.diff
Type: text/x-patch
Size: 731 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061113/2d1f1634/attachment.bin>



More information about the ffmpeg-devel mailing list