Hi there
I've been tearing my hair out over this one for some time now, so any help would be appreciated!
I've been trying to convert an MP4 video (MediaInfo appended) to DVD whilst retaining the 6 channel surround sound. FAVC does an excellent job with the video and I've tweaked the title.bat file to get it to mux an ac3 audio file that I've prepared separately using ffmeg:
ffmpeg.exe -i D:\cdtemp\avi\video.mp4 -acodec ac3 -ac 6 -ab 384000 out.ac3
which gives the following results:
The problem is that the surround channels seem to be in the wrong order. Is there a way to tell ffmpeg to change the channel order? Or can anyone suggest another way around? Also, can I believe MediaInfo, above, is reporting the channel order for the file, or just what it expects it to be?Code:General Complete name : D:\tmp\out.ac3 Format : AC-3 Format/Info : Audio Coding 3 File size : 311 MiB Duration : 1h 53mn Overall bit rate : 384 Kbps Audio Format : AC-3 Format/Info : Audio Coding 3 Duration : 1h 53mn Bit rate mode : Constant Bit rate : 384 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Surround: L R, LFE Sampling rate : 48.0 KHz Stream size : 311 MiB (100%)
I've tried several methods to demux the ac3 file to separate wav files and then recombine to ac3 in a different order, but always seem to end up with a massive file
Sláinte
midders
===
Code:General Complete name : D:\cdtemp\avi\video.mp4 Format : MPEG-4 Format profile : Base Media / Version 2 Codec ID : mp42 File size : 4.34 GiB Duration : 1h 53mn Overall bit rate : 5 479 Kbps Encoded date : UTC 2009-03-02 00:29:47 Tagged date : UTC 2009-03-03 04:24:35 Writing application : HandBrake 0.9.3 2008112300 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 10 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1h 53mn Bit rate mode : Variable Bit rate : 5 091 Kbps Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16/9 Frame rate mode : Variable Frame rate : 23.976 fps Minimum frame rate : 23.810 fps Maximum frame rate : 24.390 fps Resolution : 24 bits Colorimetry : 4:2:0 Scan type : Progressive Bits/(Pixel*Frame) : 0.102 Stream size : 4.03 GiB (93%) Encoded date : UTC 2009-03-02 00:29:48 Tagged date : UTC 2009-03-03 04:24:35 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format version : Version 4 Format profile : LC Format settings, SBR : No Codec ID : 40 Duration : 1h 53mn Bit rate mode : Variable Bit rate : 384 Kbps Maximum bit rate : 628 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Rear: L R, LFE Sampling rate : 48.0 KHz Resolution : 16 bits Stream size : 311 MiB (7%) Encoded date : UTC 2009-03-02 00:29:48 Tagged date : UTC 2009-03-03 04:23:54
+ Reply to Thread
Results 1 to 13 of 13
-
-
The reason you have a big file was probably you forgot to encode the wav intermediate to 6-ch ac3, or used the wrong bitrate.
You can do custom channel mapping if you're familiar with avisynth, or wavwizard to map wav channels, or you can use eac3to. Eac3to has a gui that is pretty easy to use (once you set it up) to map channels and you can go straight from 6-ch aac to 6-ch ac3 without wav intermediate -
Volunteer for https://www.computersforkids.org.uk/
-
Yes you write a little script, and reorder in whatever way you want, then feed that script into an encoder (you could use soundout in avisynth , or behappy etc...which uses aften for ac3)
eg. for mono wavs
fl = WavSource("X:\Path\Test_FL.wav")
fr = WavSource("X:\Path\Test_FR.wav")
fc = WavSource("X:\Path\Test_C.wav")
lf = WavSource("X:\Path\Test_LFE.wav")
sl = WavSource("X:\Path\Test_SL.wav")
sr = WavSource("X:\Path\Test_SR.wav")
MergeChannels(fl, fr, fc, lf, sl, sr)
If you wanted to do it for 6-ch ac3 , you could use GetChannels() , MixAudio() and MergeChannels()
Note you don't really need the Nero plugin, you could convert 6-ch aac to 6-ch wav in foobar2000, then use that as input into eac3to for example. There are many ways to do this -
Thanks a lot; I'm checking out SoundOut() as I type. Weirdly it didn't like the ac3 file output from ffmpeg as an input, but when I gave it the original mp4 to chew on it worked straight away.
Thanks again
middersVolunteer for https://www.computersforkids.org.uk/ -
P.S. I didn't try FooBar2000 because of this thread http://forum.doom9.org/showpost.php?p=666226&postcount=57 and wasted a massive amount of time messing around with aacDecDrop, besweet and GraphEdit all without success.
-
Also note the convention for channel mapping is different for wav vs. ac3 and aac. It's best always to check each channel manually
http://avisynth.org/mediawiki/GetChannel -
This worked in the end:
Code:Audio=DirectShowSource("d:\cdtemp\avi\video.mp4") ch1 = getChannel(Audio,1) ch2 = getChannel(Audio,2) ch3 = getChannel(Audio,3) ch4 = getChannel(Audio,4) ch5 = getChannel(Audio,5) ch6 = getChannel(Audio,6) mergeChannels(ch2,ch3,ch1,ch4,ch5,ch6) SoundOut()
-
Dear Midders
could you explain me step by step how you have done this? your help would be highly appreciated.
Thanks -
For the above to work you need the following programs installed (all available from the tools section of this forum):
- AviSynth
- ffdshow
- SoundOut
Then create a .avs script (e.g. myfilm.avs) with the blue text in it, right-click on the .avs file and select Play. Once the soundout box pops up you can stop the video from playing and select the desired output options for the sound.
N.B.
Since my last post, I've found a better way of doing it:
- demux the mp4 using Yamb or MP4Muxer (or MKVToolnix for MKV files)
- use neroaacdec to convert to wav:
neroaacdec -if myfile.MP4 -of myfile.wav (N.B. error correction; must be MP4 file not AAC file for input)
- use eac3to for the conversion:
eac3to myfile.wav myfile.ac3 -448 -1,2,0,3,4,5
(by default eac3to uses 640kbps which is too high for my standalone DivX player, hence the -448).
eac3to sometimes needs two passes, but it will handle this automatically. With DTS sound and some 5.1 wav files (with proper header?) eac3to will automatically remap the channels to the coreect order for ac3.
I must admit, my experiences with this conversion so far have been somewhat confusing; it may well be that the channel order in some of the the original aac files has been done incorrectly by the author(s). In the end, unless you split the audio into 6 wavs and identify them individually, it's a case of suck it and see; a good test is to listen to the sound from your surround sound system through headphones and if the dalogue is only coming from one side, then the centre channel is in the wrong place!
Slainte
middersVolunteer for https://www.computersforkids.org.uk/ -
Code:
AVANTI 0.4.0 -- FFmpeg/Avisynth GUI -- Changelog 14-09-2009. ============================================================= 1. Added audio "Sync" shift/stretch option (Avisynth AUTO mode). 2. Added audio 6-channel re-map options (Avisynth AUTO mode).
Should do it without the need to first convert to wave. -
midders Thanks for your input. it's seem to be little complicated and time consuming event.
any how let me try and post the out come. yeah, exactly the same issue dialogue coming from left speaker instead of centre speaker.
Similar Threads
-
Batch Convert 6 channel AAC to AC3?
By massarosareloud in forum Video ConversionReplies: 11Last Post: 22nd Oct 2011, 14:41 -
6 channel/5.1 channel AAC
By mark63534 in forum Newbie / General discussionsReplies: 0Last Post: 7th Jul 2010, 15:15 -
How to convert a 6 channel aac to ac3?
By nasdravi in forum AudioReplies: 11Last Post: 15th Feb 2010, 22:01 -
Cannot Convert 6 Channel AAC to 2 Channel AAC - Help?
By Rez. in forum AudioReplies: 2Last Post: 3rd Dec 2009, 19:47 -
Properly encoding multi-channel AC-3 to multi-channel AAC
By PuzZLeR in forum AudioReplies: 1Last Post: 15th Nov 2007, 13:07