View Single Post
Old 14th March 2017, 07:34   #1  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 2,132
Getting ffmpeg eac3 encoding to work

Summary: I've used ffmpeg to encode an eac3 5.1 audio stream, but the video editing program VideoReDo does not like the result.

I use the following to do the encoding:
Code:
ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav \
-i back_left.wav -i back_right.wav \
-filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[aout]" \
-map "[aout]" -acodec eac3 -ab 999k outputfile.ac3
The output from such an encode:
Code:
ffmpeg version N-52837-g399f6ef Copyright (c) 2000-2013 the FFmpeg developers
built on May  7 2013 01:09:00 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib
--enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 29.100 / 52. 29.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[wav @ 027f8420] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'g:\\test 00 (Left).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[wav @ 029a1320] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, wav, from 'g:\\test 01 (Right).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #1:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[wav @ 02a76180] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #2.0 : mono
Input #2, wav, from 'g:\\test 02 (Center).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #2:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[wav @ 02b4c1c0] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #3.0 : mono
Input #3, wav, from 'g:\\test 03 (LFE).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #3:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[wav @ 02c172a0] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #4.0 : mono
Input #4, wav, from 'g:\\test 04 (Left Surround).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #4:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[wav @ 02cd87c0] max_analyze_duration 5000000 reached at 5005000 microseconds
Guessed Channel Layout for  Input Stream #5.0 : mono
Input #5, wav, from 'g:\\test 05 (Right Surround).wav':
  Duration: 00:12:22.84, bitrate: 1152 kb/s
    Stream #5:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
[Parsed_amerge_0 @ 02dae380] No channel layout for input 1
[Parsed_amerge_0 @ 02dae380] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, ac3, to 'g:\\test.ac3':
  Metadata:
    encoder         : Lavf55.4.101
    Stream #0:0: Audio: eac3, 48000 Hz, 5.1, fltp, 1280 kb/s
Stream mapping:
  Stream #0:0 (pcm_s24le) -> amerge:in0
  Stream #1:0 (pcm_s24le) -> amerge:in1
  Stream #2:0 (pcm_s24le) -> amerge:in2
  Stream #3:0 (pcm_s24le) -> amerge:in3
  Stream #4:0 (pcm_s24le) -> amerge:in4
  Stream #5:0 (pcm_s24le) -> amerge:in5
  amerge -> Stream #0:0 (eac3)
Press [q] to stop, [?] for help
size=  116070kB time=00:12:22.84 bitrate=1280.0kbits/s    
video:0kB audio:116070kB subtitle:0 global headers:0kB muxing overhead 0.000000%
Here is what ffmpeg thinks of the file:
Code:
ffmpeg -i test.ac3
ffmpeg version N-52837-g399f6ef Copyright (c) 2000-2013 the FFmpeg developers
built on May  7 2013 01:09:00 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib
--enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 29.100 / 52. 29.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[eac3 @ 027f7ce0] max_analyze_duration 5000000 reached at 5008000 microseconds
[eac3 @ 027f7ce0] Estimating duration from bitrate, this may be inaccurate
Input #0, eac3, from 'test.ac3':
  Duration: 00:12:22.85, start: 0.000000, bitrate: 1280 kb/s
    Stream #0:0: Audio: eac3, 48000 Hz, 5.1(side), fltp, 1280 kb/s
At least one output file must be specified
And this is what eac3to thinks of the file:
Code:
eac3to test.ac3
E-AC3, 5.1 channels, 0:12:23, 1280kbps, 48kHz
All looks good to me, but VideoReDo refuses to mux the MPEG-2 video stream file with this eac3 stream. If I mux it with tsMuxer, VideoReDo refuses to open the TS file, complaining about no PIDs.

If I create a MKV file from the TS file, VideoReDo complains that no audio was found.

But, VLC will play it with sound.

Lastly, I have MKV files with eac3 audio that others have created and VideoReDo has no problems opening them.

Any ideas as to what I could be doing wrong? Other things to try?

Side note: I tried using ffmpeg 3.2.4, but it crashed on my XP system, not being able to find an entry point in the kernel.

Update: While version 2.8.6 runs, the results are the same.

Last edited by MrVideo; 14th March 2017 at 07:52.
MrVideo is offline   Reply With Quote