Log in

View Full Version : AC3 in MP4!


Pages : 1 2 3 [4] 5

SeeMoreDigital
4th September 2008, 08:13
Hi Kurt,

When you get round to testing, please upload so samples ;)

Kurtnoise
4th September 2008, 09:46
Hi SMD,
audio only (http://www.mediafire.com/?rdqslkv5ky2)

audio & video (http://www.mediafire.com/?8jaynyjjntx)


It seems that multichannel streams are downmixed to stereo...

Ritsuka
4th September 2008, 10:32
Did you created them with ffmpeg? It doesn't seem like they respect the ETSI specs…

Kurtnoise
4th September 2008, 10:57
Did you created them with ffmpeg?
yes...

It doesn't seem like they respect the ETSI specs…
are you sure ?

http://img171.imageshack.us/img171/7459/ac3etsitf5.png (http://imageshack.us)
http://img171.imageshack.us/img171/ac3etsitf5.png/1/w608.png (http://g.imageshack.us/img171/ac3etsitf5.png/1/)

Code:
>> http://pastebin.com/f6884f9b8
>> http://pastebin.com/f77773ef

Ritsuka
4th September 2008, 11:12
I opened it with an hex editor and found no dac3 box and a surprisingly big stsd box. Looking at the specs the ac3sampleentry should be only 216 bytes, in your samples is 1852 bytes.

Ritsuka
4th September 2008, 11:31
http://pastebin.com/m4f80f0a4 should fix it.

Kurtnoise
4th September 2008, 13:44
ok...I've made a bugreport on the ML with the fix. Hope that'll be fine.

Ritsuka
4th September 2008, 14:01
Btw the problem was that is wrote the wrong atom (glbl instead of dac3).
The value written in the dac3 are still not the right one, but I don't have time to look into it now.

bond
4th September 2008, 19:09
Just let you know that FFmpeg is now able to mux AC3 (& dirac too) streams in mp4/mov/m4v files since revision 15184...good stuff! i told bcoudurier about the new specs. didnt know he will be that fast :)

@Bond: it's time to update the FAQ, isn't it ? :phey, it was always there ;)

Ritsuka
4th September 2008, 22:30
FFmpeg revision 15198 can generates valid mp4 files with ac-3 :)
HandBrake 0.9.2 can too (but only if the ac-3 is 5.1 and has 48000 as sample rate).

SeeMoreDigital
5th September 2008, 09:21
FFmpeg revision 15198 can generates valid mp4 files with ac-3 :)
HandBrake 0.9.2 can too (but only if the ac-3 is 5.1 and has 48000 as sample rate).Great news....

Anybody able to provide A/V samples yet?

Kurtnoise
5th September 2008, 10:22
http://www.mediafire.com/?ggdhmtvnlun

play fine through vlc 0.9.2 >>

http://img168.imageshack.us/img168/7504/vlcdecfe7.th.png (http://img168.imageshack.us/my.php?image=vlcdecfe7.png)

pmsppinto
11th September 2008, 12:31
Thanks for the sample.

Any ideas on how to input (split) it into directshow? Haali splitter (29/03/2008 version) simply ignores the ac3 track. After that I guess ffdshow or ac3filter should pick it up easily.

Though I'm a Mp4box person, the moment mp4creator can mux ac3 I'm sold!

P

Kurtnoise
11th September 2008, 16:08
Any ideas on how to input (split) it into directshow?
that's not possible for the moment...you have to wait an update from Nero or Haali.


but there is a way to use Haali splitter with AC3 streams in MP4...I wouldn't use it anymore coz the specs to store such streams are well defined now.

Locust76
24th September 2008, 14:07
Does anyone know if this is possible using MediaCoder yet? Do any other easy-to-use programs mux ac3 into mp4, or is it still too early?

crypto
24th September 2008, 22:20
Does anyone know if this is possible using MediaCoder yet? Do any other easy-to-use programs mux ac3 into mp4, or is it still too early?
MP4Muxer 0.9.3 (not yet released) can mux AC3 into MPEG-4, but I am not sure how to test, if everything is compliant. I tried VLC and plays the AC-3 track ok.

How are you going to use AC3 in MPEG-4? If you like, you can test the new MP4Muxer. (PM me)

Edit: Meanwhile MP4Muxer 0.9.3 (http://forum.doom9.org/showthread.php?t=138445) is released.

Sharktooth
26th September 2008, 18:48
post a muxed file, so if someone has a NeroDigital compliant player can test if it works.

SeeMoreDigital
26th September 2008, 19:40
post a muxed file, so if someone has a NeroDigital compliant player can test if it works.Sadly, updated firmwares have not reached NeroDigital certified players yet..... But I'm awaiting :)

Globerex
7th October 2008, 08:53
Does someone know if Nero 9 and the includet Recode are supporting the new Standard? Both, decoding and encoding.

bond
7th October 2008, 20:22
Does someone know if Nero 9 and the includet Recode are supporting the new Standard? Both, decoding and encoding.they announced to support it, whether its already supported i dont know

SeeMoreDigital
7th October 2008, 21:34
I can test a Nero9 AVC+AC3.MP4 encoded file in my hardware player.....

mediator
9th October 2008, 07:38
Does someone know if Nero 9 and the includet Recode are supporting the new Standard? Both, decoding and encoding.

Finalization of the standardization at ETSI was a bit late (end of August) to make if for the initial Nero 9, so it's not yet included, but both is already on it's way, just waiting for the right timeslots to be released. Unfortunately I cannot give you dates :(

NorthPole
27th October 2008, 18:54
Does anyone know of a Directshow splitter that can handle a 6 channel ac3 stream in a mp4 yet?

JoeBG
27th October 2008, 19:39
Does anyone know of a Directshow splitter that can handle a 6 channel ac3 stream in a mp4 yet?

Does the Haali Splitter not work?

NorthPole
28th October 2008, 14:12
Does the Haali Splitter not work?

Nope... Also tried mainconcept and cyberlink but no luck with them either.

The MP4 has a h264 video stream and a 6 channel ac3 stream only and was muxed with the new version of mp4muxer. The file plays with VLC.

SeeMoreDigital
28th October 2008, 16:38
Sadly, Haali's splitter has not been updated since March 29, 2008. Way before the official AC3 in MP4 specification was finalised...

I wonder if there's anybody on the forum who's able to tweak Gabest's MP4 splitter?

Kurtnoise
9th November 2008, 12:00
HandBrake 0.9.2 can too (but only if the ac-3 is 5.1 and has 48000 as sample rate).
Am I right that HandBrake always downmixes multichannel streams when we decide to use the AC3 codec and mp4 output ?

I'm using the rev1896...

Ritsuka
9th November 2008, 12:09
No. It does not. If your player does not report the correct channels number is because it's reading the wrong value from the mp4 container (channels count in the audiosampleentry box instead of the one in the dac3 box).

crypto
9th November 2008, 12:15
No, the AC3 track is passed thru. The AAC track however is downmixed (AAC LC).

I basicly use the same mp4v2 library routines in mp4creator and vlc is reporting 2 channels. The AC3 track however is 5.1 and plays 5.1 on my AC3 amp.

I bet, you are using vlc in your test.

I consider this a vlc bug since it reads the channel count from the sample box. The specs however specifically demand to ingnore the channel count in the sample box.

I guess I do a special build that describes the samples as 6 channels just to see how vlc reacts on this.

Edit: Ritsuka was faster. Interesting he diagnoses the same.

Kurtnoise
9th November 2008, 12:20
this is what I get with an ac3 multichannel stream :

<AC3SampleEntry DataReferenceIndex="1" SampleRate="48000" Channels="2" BitsPerSample="16">
<AC3SpecificBox fscod="0" bsid="8" bsmod="0" acmod="7" lfon="1" bit_rate_code="14">
<BoxInfo Size="11" Type="dac3" />
</AC3SpecificBox>
<BoxInfo Size="47" Type="ac-3" />
</AC3SampleEntry>

Source from MediaInfo:

General
Complete name : C:\PTU\VIDEO_TS\VTS_11_1.VOB
Format : MPEG-PS
File size : 480 MiB
Duration : 9mn 14s
Overall bit rate : 7 265 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 9mn 14s
Bit rate mode : Constant
Bit rate : 5 992 Kbps
Nominal bit rate : 6 000 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4/3
Frame rate : 25.000 fps
Standard : PAL
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Bottom Field First
Bits/(Pixel*Frame) : 0.579

Audio #1
ID : 128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 9mn 13s
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

Audio #2
ID : 129 (0x81)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 9mn 13s
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

crypto
9th November 2008, 12:37
My test confirms it. Muxed with mp4creator 1.6.1d with the modified samplebox vlc sees 6 channels.

http://img523.imageshack.us/img523/8233/vlcac3mp4md8.th.png (http://img523.imageshack.us/my.php?image=vlcac3mp4md8.png)http://img523.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

crypto
9th November 2008, 12:43
@Ritsuka
What do you think? Whould you change the sample description to 6 channels? Have you discussed the issue in the handbrake team? Or should we wait for a fix from vlc?

Ritsuka
9th November 2008, 13:00
I would wait for a fix from vlc.

crypto
9th November 2008, 13:03
Me too, thanks for your opinion.

SeeMoreDigital
9th November 2008, 13:29
My test confirms it. Muxed with mp4creator 1.6.1d with the modified samplebox vlc sees 6 channels. Hi Crypto,

With your fix, does MediaInfo report 6No channels also?

Kurtnoise
9th November 2008, 13:48
With your fix, does MediaInfo report 6No channels also?
I think yes...

note that the current MediaInfo lib reports accurate infos from handbrake files and does not from mp4muxer ones (using mp4creatoor 1.6.1d). So, I'm quite surprised coz you said that both tools use the same libs...:confused:

crypto
9th November 2008, 15:34
Hi Kurtnoise13, hi SeeMoreDigital,

I havn't tried mediainfo for a while. Thanks for pointing out.

I have set that sample online: http://www.dvbportal.com/ts/Heroes.S3E2.6CH.HD-sample.m4v (37.7MB, 720p, AAC 2.0, AC-3 5.1)


Edit:

I checked it with mediainfo 0.7.6.2 and it does display 6 channels:


General #0
Complete name : C:\Capture\convert2\Heroes.S3E2.6CH.HD-sample.m4v
Format : MPEG-4
Format/Info : ISO 14496-1 version 2
Format/Family : MPEG-4
File size : 37.7 MiB
PlayTime : 57s 480ms
Bit rate : 5506 Kbps
StreamSize : 26.0 KiB
Encoded date : UTC 2008-11-09 13:21:15
Tagged date : UTC 2008-11-09 13:21:47
Writing application : mp4creator 1.6.1d

Video #0
Codec : AVC
Codec/Family : AVC
Codec/Info : MPEG-4 AVC
Codec profile : Main@L4.0
Codec settings, CABAC : No
PlayTime : 57s 480ms
Bit rate mode : VBR
Bit rate : 4961 Kbps
Width : 1280 pixels
Height : 720 pixels
Display Aspect ratio : 16/9
Frame rate mode : CFR
Frame rate : 25.000 fps
Chroma : 4:2:0
Interlacement : Progressive
Bits/(Pixel*Frame) : 0.215
StreamSize : 34.0 MiB
Encoded date : UTC 2008-11-09 13:21:15
Tagged date : UTC 2008-11-09 13:21:18

Audio #0
Codec : AAC LC
Codec/Family : AAC
Codec/Info : AAC Low Complexity
PlayTime : 56s 896ms
Bit rate mode : VBR
Bit rate : 164 Kbps
Maximum bit rate : 166 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Resolution : 16 bits
StreamSize : 1.11 MiB
Encoded date : UTC 2008-11-09 13:21:18
Tagged date : UTC 2008-11-09 13:21:18

Audio #1
Codec : ac-3
PlayTime : 56s 832ms
Bit rate mode : CBR
Bit rate : 384 Kbps
Channel(s) : 6 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
StreamSize : 2.60 MiB
Encoded date : UTC 2008-11-09 13:21:46
Tagged date : UTC 2008-11-09 13:21:47

SeeMoreDigital
9th November 2008, 15:44
Hi Kurtnoise13, hi SeeMoreDigital,

I havn't tried mediainfo for a while. Thanks for pointing out. Nice one... MediaInfo reports the correct channel information :)

Kurtnoise
9th November 2008, 18:03
I havn't tried mediainfo for a while. Thanks for pointing out.

I have set that sample online: http://www.dvbportal.com/ts/Heroes.S3E2.6CH.HD-sample.m4v (37.7MB, 720p, AAC 2.0, AC-3 5.1)


Edit: I checked it with mediainfo 0.7.6.2 and it does display 6 channels:
well your sample is accurate but tell me why mediainfo displays 2ch for this sample (http://www.mediafire.com/?zzmnyhfnwzt) instead.

file muxed with the latest mp4muxer package of course. :)

I know that's channel_count is not mandatory as decribed in the specs but I would like to know why. ;)

Ritsuka
9th November 2008, 18:32
Because as we already said the right channels count is in the dac3 atom. That's what the specs say. Mediainfo and Vlc needs to be updated to comply to the ac3 in mp4 specs, if they don't, it's not the muxer fault.

crypto
9th November 2008, 18:32
Kurtnoise13, I have done that sample with the experimental version that writes a sample box with 6 channels.

And you are right about the non-mandatory channel count in the specs.

Kurtnoise
9th November 2008, 18:52
Because as we already said the right channels count is in the dac3 atom.
this is what I get with the sample created with HandBrake from mp4box (just grab some infos from atoms...nothing more) :

<AC3SampleEntry DataReferenceIndex="1" SampleRate="48000" Channels="2" BitsPerSample="16">
<AC3SpecificBox fscod="0" bsid="8" bsmod="0" acmod="7" lfon="1" bit_rate_code="14">
<BoxInfo Size="11" Type="dac3" />
</AC3SpecificBox>
<BoxInfo Size="47" Type="ac-3" />
</AC3SampleEntry>


and with the sample from mp4muxer :
<AC3SampleEntry DataReferenceIndex="1" SampleRate="48000" Channels="2" BitsPerSample="16">
<AC3SpecificBox fscod="0" bsid="8" bsmod="0" acmod="7" lfon="1" bit_rate_code="10">
<BoxInfo Size="11" Type="dac3" />
</AC3SpecificBox>
<BoxInfo Size="47" Type="ac-3" />
</AC3SampleEntry>

So, it means that mp4box must be also updated (if yes, is there a tool available somewhere that gives more accurate results) or I miss something here...???

Mediainfo and Vlc needs to be updated to comply to the ac3 in mp4 specs, if they don't, it's not the muxer fault.
due to the fact that is not mandatory, my guess is that some muxers don't specify the value for channel count or apply a default one (i.e 2). So, we turn around here...

crypto
9th November 2008, 19:16
No, that dump is ok. Channels="2" is the sample entry box in question. All muxers I know signal 2 channels. The relevant entry however is acmod="7", which stands for 3/2 + lfe. The following values are specified:

Table C.1: Channel Array Ordering
acmod Audio Coding Mode Normal Channel
Assignment
(bsmod != "111")
"010" 2/0 L,R
"011" 3/0 L,C,R
"100" 2/1 L,R,S
"101" 3/1 L,C,R,S
"110" 2/2 L,R,Ls,Rs
"111" 3/2 L,C,R,Ls,Rs

Zenitram
9th November 2008, 23:06
well your sample is accurate but tell me why mediainfo displays 2ch for this sample (http://www.mediafire.com/?zzmnyhfnwzt) instead.

MediaInfo has a bug with this file: current implementation does not parse dac3 atom (this is not a bug, this is a feature request :), dac3 atom was not in the first MPEG-4 specs), and does not succeed to find the AC-3 stream (I don't know why yet, this is a bug), so does not parse the AC-3 frame header.
The only available info is in the stsd/ac-3 default atom, which is wrong in this case.

MediaInfo algorithm is/will be:
1/ Trust the stream headers (AC-3 specifications)
2/ If no stream found, trust the dac3 atom
3/ If no dac3 atom, trust the channel count in stsd/ac-3

I will implement 2/ (not yet done because I was not aware of dac3 atom, I am now), and I will try to patch MediaInfo for 1/. So a double-check should be available in the next release.

Because as we already said the right channels count is in the dac3 atom. That's what the specs say. Mediainfo and Vlc needs to be updated to comply to the ac3 in mp4 specs, if they don't, it's not the muxer fault.

MediaInfo will, don't worry ;-).
But AC-3 frame header is even more important than dac3 values, MediaInfo will trust first the AC-3 frame header if the two things say different values.

Kurtnoise
9th November 2008, 23:39
thanks Crypto, Zen...:)


If anybody is interested : my first attempt (http://kurtnoise.free.fr/index.php?dir=mp4tools/&file=MP4Splitter_20081109.zip) to play such streams within the Gabest MP4 Splitter...it does not yet follow the new specs (that's why there is no patch/code available). I'll try to implement the correct way asap.

note: you need to register the filter manually :
regsvr32 my_path_where_the_filter_is_located\MP4Splitter.ax

and disable the others...;)

SeeMoreDigital
9th November 2008, 23:55
Hi Kurt,

Seems to be working fine for me.... Well done mate ;)

SeeMoreDigital
11th November 2008, 11:36
I will implement 2/ (not yet done because I was not aware of dac3 atom, I am now), and I will try to patch MediaInfo for 1/. So a double-check should be available in the next release. Thanks Zen.... v0.7.7.8 reports the correct number of channels :)

clsid
14th November 2008, 12:52
@Kurtnoise13,
When you complete a patch, could you send it to either me or casimir666? Then we can commit it to the Guliverkli2/MPC-HC projects.

Kurtnoise
14th November 2008, 22:32
I'm sure I will...:)

Damie
27th February 2009, 13:43
MPC-HC player doesnt find an ac3 audio stream inside a mp4 file even though VLC plays it with no problems. Is this normal?
ac3 inside mkv works fine.