Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th March 2017, 07:34   #1  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
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
Old 14th March 2017, 07:53   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,483
I don't have any answers, but there's a newer XP compatible flavour of ffmpeg here:
https://sourceforge.net/projects/ffmpegwindowsbi/
hello_hello is offline   Reply With Quote
Old 14th March 2017, 08:32   #3  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
Quote:
Originally Posted by hello_hello View Post
I don't have any answers, but there's a newer XP compatible flavour of ffmpeg here:
https://sourceforge.net/projects/ffmpegwindowsbi/
It too has the entry point error.
MrVideo is offline   Reply With Quote
Old 14th March 2017, 08:59   #4  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
Added tidbits...

eac3to declares the third-party MKV file's audio to be:
Code:
EAC3, English, 5.1 channels, 48kHz
No bitrate.
The ffmpeg generated file is listed as:
Code:
E-AC3, 5.1 channels, 1280kbps, 48kHz
Notice that the one that works is EAC3, while ffmpeg is E-AC3.
MrVideo is offline   Reply With Quote
Old 20th June 2017, 02:43   #5  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
Bump. Hopefully this will fall under fresh eyes.
MrVideo is offline   Reply With Quote
Old 20th June 2017, 23:19   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,483
This is newer than the last ffmpeg build I linked to, and like that one, it also runs on my XP PC.
https://github.com/rdp/ffmpeg-window...ment-306066471

I didn't notice before, but try specifying eac3 as the output file extension instead of ac3.
hello_hello is offline   Reply With Quote
Old 21st June 2017, 16:00   #7  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,278
Quote:
Originally Posted by MrVideo View Post
Added tidbits...

eac3to declares the third-party MKV file's audio to be:
Code:
EAC3, English, 5.1 channels, 48kHz
No bitrate.
The ffmpeg generated file is listed as:
Code:
E-AC3, 5.1 channels, 1280kbps, 48kHz
Notice that the one that works is EAC3, while ffmpeg is E-AC3.
Is a know problem related with eac3to and EAC3 tracks in MKV container. It is not a ffmpeg problem.

Original file:
Quote:
MKV, 1 video track, 1 audio tracks, 0:57:33, 24p /1.001
1: h264/AVC, 720p24 /1.001 (16:9)
2: EAC3, English, 5.1 channels, 48kHz "640 Kbps"
Bitstream parsing for track 2 failed. <WARNING>
Demuxing this track may still produce correct results - or not. <WARNING>
Recoded the EAC3 to EAC3 448 Kb/s with ffmpeg:

Quote:
E-AC3, 5.1 channels, 0:57:33, 448kbps, 48kHz
Muxed in mkv:

Quote:
MKV, 1 video track, 1 audio track, 0:57:33, 24p /1.001
1: h264/AVC, 720p24 /1.001 (16:9)
2: EAC3, English, 5.1 channels, 48kHz "448 Kbps"
Bitstream parsing for track 2 failed. <WARNING>
Demuxing this track may still produce correct results - or not. <WARNING>
Muxed in m2ts:

Quote:
M2TS, 1 video track, 1 audio track, 0:57:33, 24p /1.001
1: h264/AVC, 720p24 /1.001 (16:9)
2: E-AC3, English, 5.1 channels, 448kbps, 48kHz
Without warnings.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 21st June 2017, 16:26   #8  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,278
Quote:
Originally Posted by MrVideo View Post
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.
The same here with the m2ts (or ts).

But work with the mkv file (show PIDs for video and audio).

Maybe this is a problem of tsMuxeR
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 22nd June 2017, 14:56   #9  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 178
Try muxing with EasyBD Lite instead of tsMuxeR.
Richard1485 is offline   Reply With Quote
Old 4th July 2017, 07:36   #10  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
I've done a lot more digging into DDPlus and I've decided to abandon it. Why? Simply because it is not meant for 5.1 channels, but for having 7.1 channels. I wanted to use it do go from 640kbps to 1280kbps, but the 5.1 core can't go any higher than 640kbps.

Frankly, I do not know how any encoder can get away with just having 5.1, instead of 7.1. Yet streaming services are providing DD+ with only 5.1.

I'm confused. But, not to the point of digging into it any further. At least not for doing encoding.

What I'd like to be able to do now is that when I run across DD+, I'd like to know how to extract the 5.1 core and turn it into simple old DD 5.1, without recoding.

Thanks to those who have responded.
MrVideo is offline   Reply With Quote
Old 4th July 2017, 09:50   #11  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 8,989
Quote:
Originally Posted by MrVideo View Post
I wanted to use it do go from 640kbps to 1280kbps, but the 5.1 core can't go any higher than 640kbps
This is wrong. If you use an independent substream as the base of the eac3 encode you can use up to 6.144Mbps. You just cannot use a legacy substream, which is basically just plain ac3. Perhaps whatever encoder you're using is not very good if it doesn't allow this.
The ffmpeg encoder definitely allows the higher bandwidth encodes. You just have to be aware that this is not a Blu-ray compatible eac3 encode.

Additionally to allowing more bandwidth, eac3 also has additional coding tools that result in a more effective encode, ie. more quality for the same bits.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 4th July 2017, 10:03   #12  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
Quote:
Originally Posted by nevcairiel View Post
Perhaps whatever encoder you're using is not very good if it doesn't allow this.
The ffmpeg encoder definitely allows the higher bandwidth encodes. You just have to be aware that this is not a Blu-ray compatible eac3 encode.
It was the ffmpeg encoder, as indicated in my initial posts.

The Dolby Labs left a lot out of the paper I read about DD+. I guess they were being specific to Blu-ray, without coming out and directly saying so.
MrVideo is offline   Reply With Quote
Old 4th July 2017, 10:09   #13  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
I've learned a lot this morning (for me anyway) regarding EAC3. Between this thread and the eac3to thread, it has been a great learning experience.
MrVideo is offline   Reply With Quote
Old 4th July 2017, 14:04   #14  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 178
Quote:
Originally Posted by MrVideo View Post
What I'd like to be able to do now is that when I run across DD+, I'd like to know how to extract the 5.1 core and turn it into simple old DD 5.1, without recoding.
Obviously, the track that you recently posted about in the eac3to thread doesn't have such a core, but if you do find one that does, the explanation for how to extract it is given by tebasuna51 in this thread. The process is somewhat counterintuitive because of the .ec3 extension.
Richard1485 is offline   Reply With Quote
Old 4th July 2017, 20:22   #15  |  Link
MrVideo
Registered User
 
MrVideo's Avatar
 
Join Date: May 2007
Location: Wisconsin
Posts: 1,262
Quote:
Originally Posted by Richard1485 View Post
the explanation for how to extract it is given by tebasuna5
Yep, saw that posting.
MrVideo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.