[FFmpeg-devel] [PATCH]Fix AC3-in-avi for the remaining cases

Justin Ruggles justin.ruggles
Sun Jan 2 18:30:42 CET 2011


On 01/02/2011 03:09 AM, Reimar D?ffinger wrote:

> On 2 jan 2011, at 05:04, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Sat, Jan 01, 2011 at 10:41:15PM -0500, Justin Ruggles wrote
>>>
>>> The exact value can be
>>> calculated if it is CBR.
>>
>> IIRC that only works for some cases of AC3 CBR as some dont have exactly
>> matching packet size for the target rate & sample rate ?

For some sample rates (11025, 22050, 44100) it varies back and forth by
2 bytes, but it is easy to calculate the maximum of the 2 sizes.

> I think there is also the issue that in the muxer we only have the sample rate to be set for the stream, which does not have to be the same as the sample rate the AC-3 data is encoded for, and the correct value depends on the latter...


In that case, none of these methods works except chosing the largest
size for AC-3 all the time.  I think some people put AC-3 (or maybe
AC3-in-SPDIF) in WAV at 44100Hz stereo no matter what the AC-3 data is
so that it can be burned to a CD, then the Dolby-compatible receiver
playing the CD detects that it's AC-3 and plays it correctly (or so I've
heard).  I don't know if our muxers would even support that though.

-Justin



More information about the ffmpeg-devel mailing list