Log in

View Full Version : MKVs: ac3 6-channels to ac3 2-channels downmix


kwanbis
9th March 2009, 21:36
I have a WD TV, and somehow, MKVs with 6 channels ac3 do not play sound on my TV. So i found out that 2 channels ones did.

UPDATE: I had my WD TV to DIGITAL AUDIO, instead than STEREO.

It looks like if the audio is 2 channels, the WD TV would do STEREO anyway, but for the 6 channels, it would try to do DIGITAL.

So i set it back to STEREO and all is playing perfectly.

But i'm still interested on knowing:

1) how can i specify FPS while doing the MKVmerge on the command line:
mkvmerge -o test.mkv video.h264 audio.ac3 sub.srt

2) if i already have an mkv, how do i add another file to it?

------------------------- OLD POST --------------------------------

So i'm trying this (assuming an original a.mkv file with 6 channel ac3 inside):

1) mkvmerge -i a.mkv
File 'a.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AC3)

2) mkvextract tracks a.mkv 1:video.h264 2:audio.ac3

3) eac3to audio.ac3 audio2.ac3 -down2

4) mkvmerge -o b.mkv video.h264 audio2.ac3

But the problem that the audio is 1 sec behind the video.

Just for curiosity I tried to create an MP4:

3a) eac3to.exe audio.ac3 audio2.wav

3b) neroaacenc.exe -q 1 -if audio2.wav -of audio2.aac

4) mp4box -add "video.h264:fps=23.976" -add "audio2.aac:lang=en" "b.mp4"
NOTE: i also tried mkvmerge -o b.mkv video.h264 audio2.aac with same 1sec delay, so it is not in the audio the problem i think

And the MP4 file plays perfectly!

So i have some doubts.

1) Why is the MKV audio behind the video? can it be fixed?

2) Can i add the 2 channel to the MKV and not loose the 6 channel version? is it worth it?

3) Regarding conversion to aac of the ac3 (3a & 3b), is it better to do a direct conversion with eac3to instead of first going to wav and then using neroaacenc? something like "eac3to audio.ac3 audio2.aac -down2" or is it the same?

4) Can this be automatic? (I can write a quick program, but why reinvent the wheel?)

Thanks.

dat720
9th March 2009, 21:53
1) Set the audio delay during the muxxing process.

2) Yes either via command line switches or the mkvmerge gui

3) it's upto you, there will be a greater quality loss doing operations twice, not noticable but its there

4) Batch file.....

kwanbis
9th March 2009, 22:06
How do i set the audio delay using mkvmerge? how do i add the new audio to an already existing mkv using mkvmerge?

I have been trying to understand eac3to ant it looks like it can do all by itself, so, is it recommended over mkvmerge?

kwanbis
10th March 2009, 00:46
Ok, i keep experimenting a little, since i-m really not much into video, unless i need to do something like now, so:

1) eac3to a.mkv
MKV, 1 video track, 1 audio track, 0:41:46, 24p /1.001
1: h264/AVC, English, 720p24 /1.001
2: AC3, 5.1 channels, 384kbps, 48khz, dialnorm: -27dB

2) eac3to a.mkv 1: video.h264 2: audio.ac3

3) eac3to audio.ac3 audio2.ac3 -down2

4) eac3to audio.ac3 audio2.wav

5) neroaacenc.exe -q 1 -if audio2.wav -of audio2.aac

So now i have:

video.h264 (original video)
audio.ac3 (this is the original 6 channels ac3)
audio2.ac3 (ac3 downsampled to 2 channels)
audio2.aac (aac downsampled to 2 channels)

I then tried:

mp4box -add "video.h264:fps=23.976" -add "audio2.aac:lang=en" "a-audio2-aac.mp4"

mp4box -add "video.h264:fps=23.976" -add "audio2.ac3:lang=en" "a-audio2-ac3.mp4"

mkvmerge -o a-audio2-aac.mkv video.h264 audio2.aac

mkvmerge -o a-audio2-ac3.mkv video.h264 audio2.ac3

I ended up with:

a-audio2-aac.mp4 plays perfectly.

a-audio2-ac3.mp4 no sound (is an mp4 restriction?)

a-audio2-ac3.mkv 1 sec delay

a-audio2-aac.mkv 1 sec delay

So, i was wondering, why the 1 sec delay (audio plays latter than the vide)? Is it because i-m not specifying the FPS? How do i do it?

And last, since i already have an MKV with audio and ac3, how can i add the 2 channel ac3?

Thanks.

setarip_old
10th March 2009, 01:48
Hi!And last, since i already have an MKV with audio and ac3, how can i add the 2 channel ac3?Have you tried loading your 1 videostream/ 1 audiostream file into MKVMerge - and then clicking on the "Add" radiobutton (or dragging and dropping) to select the second audiostream?

BigDid
10th March 2009, 02:16
Hi kwanbis,

A little off-topic but as you already have introduced a 2ch aac transcode...

I am interested in the WD tv box and I am wondering if it accepts 6ch aac in Mkv or MP4; would you mind including that in your tests? thanks in advance.

With SD source (dvd) I can do that in MEGUI without problem; usually encoding to 288/240 multich Aac-LC and muxing in MKV container; but without tv box all I can do is hope it will play fine ! :confused:

Did

nurbs
10th March 2009, 02:27
I am interested in the WD tv box and I am wondering if it accepts 6ch aac in Mkv or MP4;

I didn't test it in mp4, but it plays 6ch aac in MKV. Only limitation is that 6ch aac and ac3 are downmixed to stereo on playback. I don't know if bitstreaming is supported.

BigDid
10th March 2009, 03:00
I didn't test it in mp4, but it plays 6ch aac in MKV.
Ok, good news.

Only limitation is that 6ch aac and ac3 are downmixed to stereo on playback. I don't know if bitstreaming is supported.
Hmm, what about the optical audio output? can it serve multich to a multich audio set/amplifier?

Did

kwanbis
10th March 2009, 03:00
Hi!Have you tried loading your 1 videostream/ 1 audiostream file into MKVMerge - and then clicking on the "Add" radiobutton (or dragging and dropping) to select the second audiostream?
Mkvmerge is a command line utilty afaik.

There is the merge gui, but i couldn't make it to enable the options tab.

kwanbis
10th March 2009, 03:01
I am interested in the WD tv box and I am wondering if it accepts 6ch aac in Mkv or MP4; would you mind including that in your tests? thanks in advance.
would try that.

kwanbis
10th March 2009, 03:02
Hmm, what about the optical audio output? can it serve multich to a multich audio set/amplifier?
as far as i understand, it should work with DTS using ac3 6 channel, but connected to a DTS device or something like that.

EDIT sorry for the 3 posts, but i thought the forum would merge this already, like other forums where i post.

nurbs
10th March 2009, 03:12
Hmm, what about the optical audio output? can it serve multich to a multich audio set/amplifier?
I don't have a multichannel audio set, but according to the website:
An audio receiver is required for surround sound output. AAC/Dolby Digital decodes in 2 channel output only

kwanbis
10th March 2009, 03:17
I have found this:

I have an MKV file with DTS sound but I get no sound!
DTS cannot be played back (decoded) by the WD TV. It can downmix Dolby Digital AC3 5.1 sound to stereo so it can play sound on TV, but DTS can only be passed through. So if you connect it via HDMI or Toslink/optical to an audio receiver that supports DTS you can get DTS sound.

So how comes all the AC3 5.1 don't play on my tv? any ideaS?

BigDid
10th March 2009, 04:13
Thanks for the answers.

[QUOTE]So how comes all the AC3 5.1 don't play on my tv? any ideaS?
Exotic AC3?
You did not give any specific infos on your files; exemple: if you encode a dvd source to xvid/avi keeping the 448/384Kbps original multichannel ac3 audio does it play well? if so maybe your usual ac3 encoding are exotic and cannot be recognized by the player. Just a tip...

Did

nurbs
10th March 2009, 06:55
If time is not an issue you can cut a small part from each of your files. I normally do avc+aac in mkv but I could since I'm currently encoding a tv series it would be no problem to convert one audio track to ac3 and do a test. Only problem is I'm nowhere near my WD TV until the weekend so you'd have to wait.
Also, like BigDig said, post mediainfo on your files.

Sidenote: Anyone know where I can send bug reports for that thing? There is a really annoying one with anamorphic files not being played back at the correct aspect ratio once you change audio tracks and I can't find anything on fileing bugreports on their website.

dat720
10th March 2009, 08:09
How do i set the audio delay using mkvmerge? how do i add the new audio to an already existing mkv using mkvmerge?


I've never tried it on existing files, but the best way would be demux the files, then remux using the desired delay.

And keep in mind that the mkvmerge gui is just a frontend to mkvmerge.exe so anything that the GUI can do the CLI app can also do it.

To avoid the delay problems it would be better demuxing the original disc rather then convert existing audio tracks.

kwanbis
10th March 2009, 13:35
I've never tried it on existing files, but the best way would be demux the files, then remux using the desired delay.
i think this a problem related to the files being 23.947 fps, and mkvmerge using 25 fps as default. How do i define the fps on the command line?

And keep in mind that the mkvmerge gui is just a frontend to mkvmerge.exe so anything that the GUI can do the CLI app can also do it.
problem is that mkvmerge would not allow me to define any options, all is grayed out, don-t know why, not even the fps, so i can not use it either.

kwanbis
10th March 2009, 18:12
Exotic AC3?
You did not give any specific infos on your files; exemple: if you encode a dvd source to xvid/avi keeping the 448/384Kbps original multichannel ac3 audio does it play well? if so maybe your usual ac3 encoding are exotic and cannot be recognized by the player. Just a tip...
Here is the info on 2 that work, and 2 that don't work:

***** NO ***** 0

Format : Matroska
File size : 1.10 GiB
Duration : 42mn 28s
Overall bit rate : 3 707 Kbps
Encoded date : UTC 2009-01-23 23:09:35
Writing application : mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 12:58:26
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Muxing mode : Container profile=Unknown@4.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 42mn 25s
Bit rate : 3 167 Kbps
Nominal bit rate : 3 320 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.143
Writing library : x264 core 65 r1077M e46f648
Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=240 / keyint_min=24 / scenecut=40(pre) / rc=2pass / bitrate=3320 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language : English

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 42mn 28s
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
Language : English

***** YES ***** 1

Format : Matroska
File size : 1.28 GiB
Duration : 41mn 50s
Overall bit rate : 4 395 Kbps
Encoded date : UTC 2009-01-22 11:41:35
Writing application : mkvmerge v2.4.0 ('Fumbling Towards Ecstasy') built on Oct 11 2008 20:13:15
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 41mn 48s
Bit rate : 4 020 Kbps
Nominal bit rate : 4 200 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.182
Writing library : x264 core 65 r1051M 549cc55
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=6 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=4200 / ratetol=1.0 / qcomp=0.60 / qpmin=1 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 41mn 50s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

***** NO ***** 2

Format : Matroska
File size : 1.09 GiB
Duration : 40mn 41s
Overall bit rate : 3 844 Kbps
Encoded date : UTC 2009-01-22 06:55:53
Writing application : mkvmerge v2.4.1 ('Use Me') built on Dec 5 2008 18:30:05
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 40mn 39s
Bit rate : 3 299 Kbps
Nominal bit rate : 3 457 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.149
Writing library : x264 core 66 r1086 39a2796
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=hex / subme=6 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=3457 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language : English

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 40mn 41s
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

***** NO ***** 3

Format : Matroska
File size : 1.09 GiB
Duration : 41mn 45s
Overall bit rate : 3 746 Kbps
Encoded date : UTC 2009-01-29 05:12:23
Writing application : mkvmerge v2.3.0 ('Freak U') built on Oct 7 2008 20:39:59
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@4.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 41mn 43s
Bit rate : 3 205 Kbps
Nominal bit rate : 3 359 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.145
Writing library : x264 core 65 r1088tw
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=hex / subme=6 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=240 / keyint_min=24 / scenecut=40(pre) / rc=2pass / bitrate=3359 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Language : English

Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 41mn 45s
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

***** YES ***** 6

Format : Matroska
File size : 1.32 GiB
Duration : 41mn 55s
Overall bit rate : 4 496 Kbps
Encoded date : UTC 2009-02-19 09:23:28
Writing application : mkvmerge v2.4.2 ('Oh My God') built on Jan 18 2009 17:30:28
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 41mn 52s
Bit rate : 4 117 Kbps
Nominal bit rate : 4 300 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.186
Writing library : x264 core 66 r1109M 75b495f
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=6 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=4300 / ratetol=1.0 / qcomp=0.60 / qpmin=1 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Codec ID : A_AC3
Duration : 41mn 55s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Any comments?

kwanbis
10th March 2009, 22:08
UPDATE: I had my WD TV to DIGITAL AUDIO, instead than STEREO.

It looks like if the audio is 2 channels, the WD TV would do STEREO anyway, but for the 6 channels, it would try to do DIGITAL.

So i set it back to STEREO and all is playing perfectly.

But i'm still interested on knowing:

1) how can i specify FPS while doing the MKVmerge on the command line:
mkvmerge -o test.mkv video.h264 audio.ac3 sub.srt

2) if i already have an mkv, how do i add another file to it?

nurbs
10th March 2009, 22:22
1) "mkvmerge" -o "D:\HEROES_S2D1\e1_test_short.mkv" --default-duration 0:24000/1001fps -d 0 -A -S D:\HEROES_S2D1\e1_test_short.264 --track-order 0:0
2) Just use MkvMergeGUI. You can let it show you the command line to find out what options you have to use if you prefer CLI.

About the GUI: You do know that you have to select a track (in the Tracks window, not in the source window) first before the options are selectable, right?

dat720
11th March 2009, 08:49
i think this a problem related to the files being 23.947 fps, and mkvmerge using 25 fps as default. How do i define the fps on the command line?


problem is that mkvmerge would not allow me to define any options, all is grayed out, don-t know why, not even the fps, so i can not use it either.

so read the documentation and work out what command you need to set the fps

setarip_old
11th March 2009, 20:47
@kwanbisThere is the merge gui, but i couldn't make it to enable the options tab.You don't need access to options in order to simply add a file/stream...

poisondeathray
11th March 2009, 20:56
You "enable" the format specific options tab for raw video stream by highlighting the raw video stream