[FFmpeg-user] AC-3 Dolby Digital 5.1 Encoding

Chase Patterson chapatt at gmail.com
Sun May 27 16:44:28 CEST 2012


Thanks everybody! It turns out, Totem (the Gnome Movie Player) doesn't
recognize it as surround sound correctly, but vlc does.

There was only a small difference in ffmpeg's output to the terminal
with the different commands, that is not warning about not specifying
a channel layout anymore, and it says "5.1" rather than "5.1(side)".

ffmpeg -i Session.wav -vn -acodec ac3 -ac 6 -ar 48000 -ab 640k
-dialnorm -24 -dsur_mode 0 -original 1 -dmix_mode 2 -channel_layout 63
Session.ac3
ffmpeg version 0.10.3 Copyright (c) 2000-2012 the FFmpeg developers
  built on May  9 2012 17:51:07 with gcc 4.7.0 20120505 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis
--enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora
--enable-libgsm --enable-libspeex --enable-postproc --enable-shared
--enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb
--enable-libschroedinger --enable-libopenjpeg --enable-librtmp
--enable-libpulse --enable-gpl --enable-version3
--enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[wav @ 0x9493a0] max_analyze_duration 5000000 reached at 5003458
Input #0, wav, from 'Session.wav':
  Duration: 00:00:14.00, bitrate: 6912 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 6
channels, s32, 6912 kb/s
Incompatible sample format 's32' for codec 'ac3', auto-selecting format 'flt'
Output #0, ac3, to 'Session.ac3':
  Metadata:
    encoder         : Lavf53.32.100
    Stream #0:0: Audio: ac3, 48000 Hz, 5.1, flt, 640 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le -> ac3)
Press [q] to stop, [?] for help
size=    1095kB time=00:00:14.01 bitrate= 640.0kbits/s
video:0kB audio:1095kB global headers:0kB muxing overhead 0.000000%


ffmpeg -i Session.wav -s:a 48k -ab 640k -acodec ac3 -ac 6 Session2.ac3
ffmpeg version 0.10.3 Copyright (c) 2000-2012 the FFmpeg developers
  built on May  9 2012 17:51:07 with gcc 4.7.0 20120505 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis
--enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora
--enable-libgsm --enable-libspeex --enable-postproc --enable-shared
--enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb
--enable-libschroedinger --enable-libopenjpeg --enable-librtmp
--enable-libpulse --enable-gpl --enable-version3
--enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[wav @ 0x1bcc3a0] max_analyze_duration 5000000 reached at 5003458
Input #0, wav, from 'Session.wav':
  Duration: 00:00:14.00, bitrate: 6912 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 6
channels, s32, 6912 kb/s
Incompatible sample format 's32' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x1bcd240] channel_layout not specified
[ac3 @ 0x1bcd240] No channel layout specified. The encoder will guess
the layout, but it might be incorrect.
Output #0, ac3, to 'Session2.ac3':
  Metadata:
    encoder         : Lavf53.32.100
    Stream #0:0: Audio: ac3, 48000 Hz, 5.1(side), flt, 640 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le -> ac3)
Press [q] to stop, [?] for help
size=    1095kB time=00:00:14.01 bitrate= 640.0kbits/s
video:0kB audio:1095kB global headers:0kB muxing overhead 0.000000%

I don't know if there's actually a difference in the outputted file,
or in its metadata, but both ways turn out to work in the long run.
Thank you again!


Chase


More information about the ffmpeg-user mailing list