[Ffmpeg-devel] possible bug - ac3 transcoding

Víctor Paesa wzrlpy
Tue Dec 19 09:10:16 CET 2006


Hi,
> On Sat, Dec 16, 2006 at 08:39:45PM +0000, Rui Correia wrote:
>> Hello there,
>> I have XP Pro SP2 and I'm using a ffmpeg for windows binary that I
>> downloaded
>> here http://tirnanog.fate.jp/mirror/ffmpeg/.
>> It is not the latest SVN but since I don't know how to build the latest
>> SVN on
>> cygwin/mingw I have to post my results with SVN-7260.
>> This is the CLI that I'm using.
>> It was taken from BeHappy a windows frontend for many encoders, namely
>> FFmpeg.
>>
>> ffmpeg.exe -i gotk448.ac3 -y -acodec ac3 -ab 384 gotk384.ac3
>>
>> And here is the log
>>
>> FFmpeg version SVN-r7260, Copyright (c) 2000-2006 Fabrice Bellard, et
>> al.
>> configuration:  --enable-mp3lame --enable-libnut --enable-libogg
>> --enable-vorbis --enable-faad --enable-faac --enable-libgsm
>> --enable-xvid
>> --enable-x264 --enable-mingw32 --enable-a52 --enable-dts --enable-pp
>> --enable-amr_nb --enable-amr_wb --enable-swscaler --enable-avisynth
>> --enable-gpl --enable-memalign-hack --cpu=i686 --extra-ldflags=-static
>>   libavutil version: 49.1.0
>>   libavcodec version: 51.26.0
>>   libavformat version: 51.6.0
>>   built on Dec  8 2006 17:40:35, gcc: 4.0.3
>> Input #0, ac3, from 'gotk448.ac3':
>>   Duration: 01:34:06.9, start: 0.000000, bitrate: 448 kb/s
>>   Stream #0.0: Audio: ac3, 48000 Hz, 5 channels, 448 kb/s
>> Output #0, ac3, to 'gotk384.ac3':
>>   Stream #0.0: Audio: ac3, 48000 Hz, 5 channels, 384 kb/s
>> Stream mapping:
>>   Stream #0.0 -> #0.0
>> Press [q] to stop encoding
>> size=  317640kB time=6776.3 bitrate= 384.0kbits/s
>> video:0kB audio:317640kB global headers:0kB muxing overhead 0.000000%
>>
>> Note: I'm only using ffmpeg for audio transcoding.
>> I use a different encoder for the video part.
>> In the end I'll just mux them back with DVDLab Pro or Muxman Std..
>> In the above test the source movie is a original DVD PAL 25fps and it
>> has a
>> total of 141175 frames.
>> I extracted the ac3 stream using DGMPGDec/DGIndex 1.4.8. which reports
>> the ac3
>> stream as a 5.1 448kbps stream and it uses 308819KB of disc space.
>> After transcoding to 384kbit ac3 using the above CLI I get a file with
>> 317640KB
>> thus making it _even_bigger_than_the_original_.
>> For me this doesn't make sense because if my math is right I should be
>> getting
>> a file from ffmpeg with ~264703KB.
>> My math for the transcoded ac3:
>> ((141175/25)*(384/8))/1024*1000=264703,125
>> And for the source ac3:
>> ((141175/25)*(448/8))/1024*1000=308820,3125
>> Plus if I try to play the ffmpeg-transcoded file with either
>> foobar2000 0.9.4.1 or MediaPlayerClassic 6.4.9.0 my PC crashes and
>> reboots.
>
> well, get a real OS, sorry but a system crash is _always_ your OSs fault
> unless your hardware is broken but then again that too is off topic here
>
> does ffmpeg/ffplay play the resulting file? do the regression tests pass?

The problem seems easy to reproduce, I downloaded
from http://samples.mplayerhq.hu/A-codecs/AC3-samples/
the file Broadway-5.1-48khz-448kbit.ac3

The original is 33.9 seconds long, but trancoding produces a 40.7 seconds
duration:

$ ffmpeg.exe -i Broadway-5.1-48khz-448kbit.ac3 -ab 384 broad384.ac3
FFmpeg version SVN-r7317, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-mp3lame --enable-a52 --disable-static
--enable-shared --enable-pthreads --enable-swscaler --enable-avisynth
--enable-gpl --extra-cflags=-DX_DISPLAY_MISSING -march=pentium4
  libavutil version: 49.1.0
  libavcodec version: 51.26.0
  libavformat version: 51.6.0
  built on Dec 14 2006 12:58:18, gcc: 3.4.4 (cygming special) (gdc 0.12,
using dmd 0.125)
Input #0, ac3, from 'Broadway-5.1-48khz-448kbit.ac3':
  Duration: 00:00:33.9, start: 0.000000, bitrate: 448 kb/s
  Stream #0.0: Audio: ac3, 48000 Hz, 5 channels, 448 kb/s
Output #0, ac3, to 'broad384.ac3':
  Stream #0.0: Audio: ac3, 48000 Hz, 5 channels, 384 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=    1910kB time=40.7 bitrate= 384.0kbits/s
video:0kB audio:1910kB global headers:0kB muxing overhead 0.000000%

$ ffmpeg -i broad384.ac3
FFmpeg version SVN-r7317, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-mp3lame --enable-a52 --disable-static
--enable-shared --enable-pthreads --enable-swscaler --enable-avisynth
--enable-gpl --extra-cflags=-DX_DISPLAY_MISSING -march=pentium4
  libavutil version: 49.1.0
  libavcodec version: 51.26.0
  libavformat version: 51.6.0
  built on Dec 14 2006 12:58:18, gcc: 3.4.4 (cygming special) (gdc 0.12,
using dmd 0.125)
Input #0, ac3, from 'broad384.ac3':
  Duration: 00:00:40.7, start: 0.000000, bitrate: 384 kb/s
  Stream #0.0: Audio: ac3, 48000 Hz, 5 channels, 384 kb/s
Must supply at least one output file


And the file encoded at 384k is larger than the one at 448k:
$ ls -l
total 3772
-rwx------+ 1 me Users 1903104 Dec 19 08:47 Broadway-5.1-48khz-448kbit.ac3
-rw-r--r--  1 me Users 1955328 Dec 19 08:55 broad384.ac3

MPlayer 1.0pre8-3.4.4 reproduced broad384.ac3 without crashes, but sounds
garbled (the original sounded OK).

The AC3 regression tests for my SVN-r7317 passed correctly.

Regards,
V?ctor





More information about the ffmpeg-devel mailing list