VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    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:
    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%)
    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?

    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
    Quote Quote  
  2. 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
    Quote Quote  
  3. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    Thanks for the swift response; I've tried using eac3to but am too cheap (!) to shell out for Nero for the AAC decoding. Is there a free alternative?

    I've played with AVISynth a little; would I just write a script to swap the relevant channels and then feed this to the mux command?

    Sláinte

    midders
    Quote Quote  
  4. 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
    Quote Quote  
  5. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    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

    midders
    Quote Quote  
  6. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    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.
    Quote Quote  
  7. 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
    Quote Quote  
  8. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    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()
    Quote Quote  
  9. Member
    Join Date
    Jun 2007
    Location
    Midle East
    Search Comp PM
    Dear Midders
    could you explain me step by step how you have done this? your help would be highly appreciated.
    Thanks
    Quote Quote  
  10. Member midders's Avatar
    Join Date
    Sep 2008
    Location
    United Kingdom
    Search Comp PM
    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

    midders
    Quote Quote  
  11. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    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).
    Doesn't that work for anybody

    Should do it without the need to first convert to wave.
    Quote Quote  
  12. Member
    Join Date
    Jun 2007
    Location
    Midle East
    Search Comp PM
    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.
    Quote Quote  
  13. Member
    Join Date
    Jun 2007
    Location
    Midle East
    Search Comp PM
    Hi
    sorry for the late entry.

    I experiment with many softwares and various methods. nothing worked.

    only worked below
    mp4muxer and wave editor.

    Thanks everybody
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!