Bug#736088: libavcodec54: file command reports wrong bitrate on mp3 file encoded by libav

Alessandro Ghedini ghedo at debian.org
Fri Mar 7 11:04:25 UTC 2014


Control: reassing -1 libavformat54
Control: retitle libavcodec54: wrongly set bitrate in XING header (mp3enc)

On dom, gen 19, 2014 at 11:33:13 -0500, Reinhard Tartler wrote:
> Also note that avprobe does report the "correct" bitrate:
> 
> avprobe version 0.8.9-6:0.8.9-0ubuntu0.13.04.1, Copyright (c)
> 2007-2013 the Libav developers
>   built on Nov  9 2013 19:09:48 with gcc 4.7.3
> Input #0, mp3, from 'noise_avconv.mp3':
>   Metadata:
>     encoder         : Lavf53.21.1
>   Duration: 00:00:05.04, start: 0.000000, bitrate: 320 kb/s
>     Stream #0.0: Audio: mp3, 48000 Hz, mono, s16, 320 kb/s

So, I've done a bit of investigation, and it turns out that this is caused by
the way libavformat writes the XING header to mp3 files. Essentially, it uses
a fixed value for bitrate_idx... for any bitrate values.

This also makes tools like mediainfo detect an avconv-encoded mp3 file as
using constant bitrate, while in fact it might be using a variable bitrate
(though I'm not sure if this is actually the same bug, or a different bug in the
same code).

More or less copy-pasting the mp3_write_xing() function (libavformat/mp3enc.c)
from ffmpeg to libav seems to fix the problem.

Cheers

-- 
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20140307/0cac61f4/attachment.sig>


More information about the pkg-multimedia-maintainers mailing list