Log in

View Full Version : Can we put ac3 in mp4 without the use of a private stream?


Pages : [1] 2

Zep
4th June 2006, 03:07
When i demux a .ts i get ac3 and i do not want to convert to aac. i want to use the ac3 as is in my mp4 but it appears the only way STILL is via private stream/media object. I'm ok with that except most players/decoders do not look at the private streams when they find no audio in the standard location and standard audio tags.

Has anyone been able to get this to work in such a way as to not be such a hack? (well a hack for now anyway. I hope that changes in the near future)

Thoughts?

yes i could use .mkv but that has pros and cons also :D

thanks

GodofaGap
4th June 2006, 07:52
AC3 storage is not standardized for MP4 and it won't be, so what you want is not possible.

This question is asked at least 1 time per month...

Zep
4th June 2006, 11:58
AC3 storage is not standardized for MP4 and it won't be, so what you want is not possible.

This question is asked at least 1 time per month...

yes i read a few of the older threads but most were off base since i put ac3 in mp4 all the time in OSX via private stream and it works fine with players and decoders that are smart enough to look at the private stream and read the header info and see that it is an audio file etc... mp4 was designed to support media objects of all types and not just the standard out of the box basic ones.

Anyway, I wanted to know if the windows side has caught up and it appears it has not :(

However i see on sourceforge a few of the projects they added ac3 private stream support so things are looking up in the windows camp.
A hack yup but so is most of the video/audio stuff being used like h264 in avi and VBR mp3 in avi and on and on...

thanks for you input!

derek ss7
4th June 2006, 12:26
can any one tell me why recorded tv programs to disk on my sony RDR HX900 dvd recorder will not play on my pc or any other dvd player they never reconise the disk, i know the disks are ok. is there any software out there that can help. thanks

SeeMoreDigital
4th June 2006, 12:41
yes i read a few of the older threads but most were off base since i put ac3 in mp4 all the time in OSX via private stream and it works fine with players and decoders that are smart enough to look at the private stream and read the header info and see that it is an audio file etc... Interesting

Could you provide me with a sample please (with MPEG-4 SP video)?


Cheers

bond
4th June 2006, 12:58
Zep, i guess what you have is a mov file with the wrong extension, and not mp4...

again, it makes no sense to place ac3 in mp4. if you think that the technology used in mp4 is so great (eg better than mkv or mpg) use mov for storing ac3...

GodofaGap
4th June 2006, 13:18
A hack yup but so is most of the video/audio stuff being used like h264 in avi and VBR mp3 in avi and on and on...

I don't care if it's a hack or not (and I don't think the other things you mentioned are necessarily hacks either), but you asked if there was a way without private streams I believe. Since the mp4 specs do not specify how to store AC3 specifically (:D ), it is not possible. I didn't want to pass on a moral judgement if you should use AC3 in MP4 or not.

Can I ask you what tool you are using to make these files?

SeeMoreDigital
4th June 2006, 14:00
Zep, i guess what you have is a mov file with the wrong extension, and not mp4...

again, it makes no sense to place ac3 in mp4. if you think that the technology used in mp4 is so great (eg better than mkv or mpg) use mov for storing ac3...I must admit I can't see how AC3 can be placed within MP4, hence my request for a sample...

That said, with regard to placing AC3 within MOV, I'm not sure whether this is possible, given that QuickTime player does not support AC3!


Cheers

Kurtnoise
4th June 2006, 14:27
Can I ask you what tool you are using to make these files?
Open a vob including ac3 streams into Avidemux, choose x264 for video compressor and Audio Copy in the drop list then save your file into mp4.

This kind of file is playable with MPC but like Bond and others said that makes no sense. :rolleyes:

Drachir
4th June 2006, 18:49
The way avidemux (www.avidemux.org) place ac3 in MP4 is wrong, there is no mp4a box/atom. In MP4 files the elementary stream type is identified through the objectTypeIndication number. For unregistered elementary streams types you have to use a private objectTypeIndication number. Take a look here for registered numbers: http://www.mp4ra.org/object.html

If you want know how to place elementary streams into MP4 take a look at the nhml import/extract from MP4Box.

popper
4th June 2006, 23:36
I must admit I can't see how AC3 can be placed within MP4, hence my request for a sample...

That said, with regard to placing AC3 within MOV, I'm not sure whether this is possible, given that QuickTime player does not support AC3!


Cheers

the BBC HD are using AVC and AC3 in their .ts ,does that count?, or am i missing somethng.

the BBC_HDTrial.ts file over on the DS thread for instance.

GodofaGap
4th June 2006, 23:54
what does ts have to do with MOV or MP4?

woah!
5th June 2006, 01:58
maybe because the .ts files have H264 (MP4) video and AC3 audio so i think its a valid question.

foxyshadis
5th June 2006, 03:22
No, .ts and .mp4 have nothing to do with each other, they're entirely different containers and can hold entirely different formats. H.264 is MPEG-4, not MP4, though it can be stored in MP4.

The entire reasoning behind MP4 is that it will only contain MPEG-4 streams, vastly simplifying implementation requirements, and that enough other formats exist to satisfy the need for non-MPEG-4 streams when it arises. (3gpp goes beyond this to specify a few other voice formats its own version can use.) Non-standard streams will most likely restrict playability on hardware devices. Please stop turning mp4 into the new avi.

bond
5th June 2006, 18:56
for how to mux ac3 into .mp4:

open quicktime and merge your ac3 stream into a .mov file. after that rename the .mov to .mp4 and you will get a spec compliant ac3-in-mp4 file as any other method outputting ac3-in-mp4 would give you too

/cynism


edit: imho the best container for merging ac3 and avc is .mpg program stream (not .ts), as
1) there are official/widely accepted specs for storing avc and ac3 in .mpg
2) hddvd uses exactly the same (ac3 + avc in .mpg), so ac3+avc in .mpg has a big chance of hardware compatibility (imho bigger than .mp4, not to speak of .mkv)
3) ac3 should not be placed in .mp4

SeeMoreDigital
5th June 2006, 19:26
for how to mux ac3 into .mp4:

open quicktime and merge your ac3 stream into a .mov file. after that rename the .mov to .mp4 and you will get a spec compliant ac3-in-mp4 file as any other method outputting ac3-in-mp4 would give you too

/cynismWell I have QT7 Pro installed and as far as I can see it does not support AC3 at all. Whether it be muxed into VOB or MPG, or even as an elementary stream...

All you get is QT7 saying this: -

http://img333.imageshack.us/img333/637/qt7error0tl.png


Cheers

bond
5th June 2006, 19:36
well i wasnt really serious anyways ;)

SeeMoreDigital
5th June 2006, 19:40
well i wasnt really serious anyways ;)I guess what we could do with now are some muxing tools that will allow us to place MPEG-4 Part10 (and Part2 - for good measure) with AC3 audio into the .MPG container...

Any takers?

bond
5th June 2006, 19:41
my best bet would be ffmpeg

SeeMoreDigital
5th June 2006, 19:52
I guess muxing with FFmpeg will be a "command-line" affair?

I just tried muxing MPEG-4 with AC3 into .MPG, .TS and .PS using AVIdeMux 2.2.0 Rev 1984.... It was a no go!


Bummer!

popper
5th June 2006, 22:56
if we (the EU&US)dont get these tools PDQ, does that mean that the MS VC-1 codec has got a very large advantage for the averge guy then,what with MS giving out lots of help and advice/tools to the content providers and so on today?.

its not likely that the UK/EU industry are going to abandon ac3 but rather a combination of ac3 and AAC over time,perhaps im wrong but i thought id read that HDDVD/BR use a .ts for their container?.

i find the whole MP4/MPEG-4 file format thing a little confusing
when the official? (is this a US thing only and EU doing somthing totally differently & official?) says this
http://www.mp4ra.org/specs.html#mpeg-4
"
The specifications in this family are all "atom" or "box" structured file formats, which are intentionally interoperable.

Most of the specifications are related to the first MPEG-4 file format (MP4 version 1), which in turn was derived from the QuickTime file format defined by Apple Computer. More recently the MP4 file format was generalized into the ISO Base Media File Format, which defines a general structure for time-based media files. It in turn is used as the basis for other file formats in the family."

popper
6th June 2006, 02:31
i thought id read it somewere, its in the 'HD DVD-VR (Video Recording) Product Requirement & Guideline' for manufacturers from a consumers POV, so will be a basic requirement and hence playable on anything it seems.

http://www.dvdfllc.co.jp/HDDVD-VR_Req_Guide_V10.pdf

their saying it must do SOB (Mpeg-ts) and VOB (Mpeg -ps)playback and for the VR's
recording.

popper
6th June 2006, 03:21
I guess muxing with FFmpeg will be a "command-line" affair?

I just tried muxing MPEG-4 with AC3 into .MPG, .TS and .PS using AVIdeMux 2.2.0 Rev 1984.... It was a no go!


Bummer!

looks like its going to be a big problem sometime soon then?.

bond
6th June 2006, 18:44
m$ provides no tool for merging ac3 with vc-1...

Hyper Shinchan
13th June 2006, 17:29
When i demux a .ts i get ac3 and i do not want to convert to aac. i want to use the ac3 as is in my mp4 but it appears the only way STILL is via private stream/media object. I'm ok with that except most players/decoders do not look at the private streams when they find no audio in the standard location and standard audio tags.

Has anyone been able to get this to work in such a way as to not be such a hack? (well a hack for now anyway. I hope that changes in the near future)

Thoughts?

yes i could use .mkv but that has pros and cons also :D

thanks

It's possible using the Haali Matroska Muxer, included in the Haali Media Splitter.
you have to use graphedit to build the graph, and be careful with AVC and MPEG-1/2, it screw them up. You have to use it to output only AC3 in MP4, then mux the video in the same file with MP4Box.
It uses a private stream (223, but I'm not sure, I don't remember it).
The intersting think is that this doc (http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt) says that there is already a private stream for the AC3, but i dunno what is the tool that introduce it (it's a different ID from the Haali's one).
Anyway that's funny, Haali Matroska Muxer could be the Matroska killer XDDD
EDIT: the files work only with the Haali splitter at the moment, of course.

Haali
13th June 2006, 19:18
Last time I checked video worked fine too.

SeeMoreDigital
13th June 2006, 19:33
It's possible using the Haali Matroska Muxer, included in the Haali Media Splitter.
you have to use graphedit to build the graph... Are you (or anybody else) able to provide a graph... For just muxing AC3 audio streams into MP4 please?

EDIT: I would like to test this option... but I'm a bit thick with GraphEdit...


Cheers

lazyn00b
13th June 2006, 21:06
It's possible using the Haali Matroska Muxer, included in the Haali Media Splitter.
you have to use graphedit to build the graph, and be careful with AVC and MPEG-1/2, it screw them up. You have to use it to output only AC3 in MP4, then mux the video in the same file with MP4Box.
It uses a private stream (223, but I'm not sure, I don't remember it).
The intersting think is that this doc (http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt) says that there is already a private stream for the AC3, but i dunno what is the tool that introduce it (it's a different ID from the Haali's one).
Anyway that's funny, Haali Matroska Muxer could be the Matroska killer XDDD
EDIT: the files work only with the Haali splitter at the moment, of course.

Nice find! Hey, it says "ISO blah blah" at the top of the page - sure sounds like a standard to me, so lets roll with it! The hard part is going to be overcoming the objections of the doubters and naysayers, however. There are a lot of influential people here who have made strong statements that oppose the use of AC3 in MP4. Maybe this document will persuade them, I don't know.

GodofaGap
13th June 2006, 21:50
I don't oppose the use of this, but I don't see the necessity of it. If you want to turn MP4 into Matroska, why not use Matroska instead? It's very unlikely this will ever be supported in a hardware platform. It is even very unlikely that the majority of mp4 software players will support this. So what is really the point? Using MP4 just because you like the .mp4 extension doesn't really make sense. You use a container because it allows you to do the things you want, and in this case I don't see what using mp4 adds over Matroska while Matroska can do these things for a few years now...

It's not exiting, it's not very useful, so what exactly is it?

SeeMoreDigital
13th June 2006, 22:14
Placing AC3 within MP4 is a topic which Bond and I have enjoyed much discussion...

Personally I'm in favour of it because I've always been of the opinion that if such a provision (ie: to place AC3 within MP4 as a non private stream) had been adopted a few years ago, the MP4 container would have become far more popular and universally accepted by end-users (ie: us) and player manufacturers alike!


Cheers

Zero1
14th June 2006, 01:10
Yes, keep it clean people.

While I like MP4, MKV was created as an alternative so you aren't bound to certain codecs or limitations for the sake of interoperability. If you wanted interoperability, then you wouldn't want to be using an unsupported format/method of storage in MP4 to begin with. If you don't really care, then use and support Matroska. There are a number of other benefits to MKV too which might grow on you.

As bond suggested, a MPEG-2 transport or program stream is a more viable method than MP4.

Pardon my ignorance since I'm not an audiophile, but would people really tell the difference between say a 192kbps AC3 and an AAC transcode of that (for arguements sake lets assume 192kbps).

GodofaGap
14th June 2006, 06:51
Personally I'm in favour of it because I've always been of the opinion that if such a provision (ie: to place AC3 within MP4 as a non private stream)
This is not a standard stream in mp4, it is a private stream. So I'm not sure why you are in favor of this.

Hyper Shinchan
14th June 2006, 08:41
This is not a standard stream in mp4, it is a private stream. So I'm not sure why you are in favor of this.
In fact I think that the ideal is to use a full new handler and sample description, like the 3GPP guys made for AMR and Apple for ALAC.
Anyway at the moment private stream are a good solution.
There are a lot of influential people here who have made strong statements that oppose the use of AC3 in MP4
I think that you're talking about Bond, just like SMD remarks XD
Well, he has his own idea, but that I think that AC3in MP4 it's not a bad idea, and that the MP4 isn't a fixed file format, big industries changed it a lot in the last years, why we can't do it?
Well, it's hard that any "user's change" will be approved by the MP4RA, but it's not a big problem.
As bond suggested, a MPEG-2 transport or program stream is a more viable method than MP4.
Bond said PS (TS are really too overheaded imo) if i remember well.
This is a solution, but you can't use PS easily as you said.
For example actually the only tool that we can use to mux AVC in MPEG-2 PS/TS is FFMPEg, and I'm not so sure that it uses a standard way....

Quote:
Originally Posted by Hyper Shinchan
It's possible using the Haali Matroska Muxer, included in the Haali Media Splitter.
you have to use graphedit to build the graph...
Are you (or anybody else) able to provide a graph... For just muxing AC3 audio streams into MP4 please?

EDIT: I would like to test this option... but I'm a bit thick with GraphEdit...


Cheers
Sorry, but just like I said in the past I'm not using mine PC, I can't make a snap of the graph right now.
If anyone else don't give it one I could post it, but tomorrow.
Sorry.

SeeMoreDigital
14th June 2006, 08:49
This is not a standard stream in mp4, it is a private stream. So I'm not sure why you are in favor of this.I'm in favour because (as I implied) I've always been of the opinion that AC3 (and DTS) should have been included within the original MPEG-4 ISO/IEE 14496 specification.


Cheers

Drachir
14th June 2006, 09:34
In fact I think that the ideal is to use a full new handler and sample description, like the 3GPP guys made for AMR and Apple for ALAC.
Anyway at the moment private stream are a good solution.


If you like the way the Sample Entry Box/Atom is handels in 3gp for AMR and H263 you should probablie use 3GP or mov instead of MP4.

But on the other site AVC in MP4 breaks the normally in MP4 used schema too.

The only private stream in MP4 I would use for the moment is VOBSUB.

GodofaGap
14th June 2006, 09:42
I'm in favour because (as I implied) I've always been of the opinion that AC3 (and DTS) should have been included within the original MPEG-4 ISO/IEE 14496 specification.

But this is none of that.

Well, it's hard that any "user's change" will be approved by the MP4RA, but it's not a big problem.
So what is the advantage of this over existing formats? (other than that it is perhaps interesting to code this)

Hyper Shinchan
14th June 2006, 10:20
If you like the way the Sample Entry Box/Atom is handels in 3gp for AMR and H263 you should probablie use 3GP or mov instead of MP4.

But on the other site AVC in MP4 breaks the normally in MP4 used schema too.

The only private stream in MP4 I would use for the moment is VOBSUB.
In fact AVC uses a different entry than the normally used for MPEG-4 video and 3GPP uses a style that resemble more the old QT's one (but that it's still different, also the sample entry that QT and 3GPP use for the H263 are different).
You say that Vobsubs are fine and AC3 isn't? Why?

Quote:
Originally Posted by Hyper Shinchan
Well, it's hard that any "user's change" will be approved by the MP4RA, but it's not a big problem.
So what is the advantage of this over existing formats? (other than that it is perhaps interesting to code this)
What is the advantage of what? Adding AC3 support?

GodofaGap
14th June 2006, 10:22
yes, what is the advantage of adding ac3 to mp4. What does it allow me to do to better that I couldn't do already with other formats?

Drachir
14th June 2006, 10:27
You say that Vobsubs are fine and AC3 isn't?
That is just my opinion. Vobsub is simply more widely used and supported by players.

Hyper Shinchan
14th June 2006, 10:37
yes, what is the advantage of adding ac3 to mp4. What does it allow me to do to better that I couldn't do already with other formats?
Well, actually I prefer to try to insert AC3 support in MP4 rather than starting to use a so called "patent free" container that it's so popular now, but that can become like OGM in a pair of years (yes, maybe I'm wrong, but Apple uses MOV from more than 10 years, it simply mean that it works).
The main debate was why we (that's funny, I'm saying "we" but i don't like to use AC3 in my back-up, I use AAC Plus XD) use MP4 instead of MOV.
Mainly because there is a wide support for the MP4 righ now. If you says MOV the people think that it's almost a closed format, if you say MP4 they think "oh it's an ISO standard". O.K. this usage isn't part of the standard but if anyone think that it's useful it's a good think to start to make some tools that support it.
So I'm glad that Haali included AC3 support, I hope that it will be improved in the future (I can give some hints if you wish).

GodofaGap
14th June 2006, 10:42
Well, actually I prefer to try to insert AC3 support in MP4 rather than starting to use a so called "patent free" container that it's so popular now, but that can become like OGM in a few years
How do you know that making private extensions for mp4 don't turn out the same way as OGM? I'm not really convinced by this argument. But I don't really like future telling, so don't have to answer. I understand your motivation now at least. Thank you. :)

(I thought maybe there were some technical advantages to it)

Hyper Shinchan
14th June 2006, 10:52
I'm happy that you've understood my (our, right SMD?) motivation, why we don't do it, instead of saying that it's insane?
The technical advantages are in the file format, flexible, easy to edit and ready for future improvements.
And who knows, if AC3 in MP4 become widespreaded it could happen that it will be implimented into hardware players (it's easier to enable a chipset to supports AC3 in MP4 rather than including MKV, I think that it could be done also with a simple upgrade of the firmware).
Or maybe I'm just dreaming LOL

GodofaGap
14th June 2006, 11:00
The technical advantages are in the file format, flexible, easy to edit and ready for future improvements.
Well that is what is said about every new file-format, don't know if that's an advantage then. Considering the amount of formats it supports, at least Matroska has proven to be easily extensible.

I think the difference between you and me is that, besides mobile/psp-like devices, I don't see a bright future for mp4 hardware support at all.

SeeMoreDigital
14th June 2006, 11:10
Okay then guys...

Now we have a document (http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt) to work from/to, what do we need to do to generate such streams?

If we can start with some simple muxes first, such as: -
AC3 audio only within .MP4
MPEG-4 SP video with AC3 audio within .MP4
I might (no promises though) be able get some wizz-kids to incorporate it into a stand-alone player!


Cheers

Hyper Shinchan
14th June 2006, 11:15
Matroska is easily extensible, but for me it won't have a future. The onlt file formats that can have a future are the ones that have a good mix of extensibility and standardized usage, like MP4 or MPEG-2 TS.
free patent ones are not the ideal to for a wide diffusion, if you don't create constrained settings (and so you'll lose the extensibility). here we are talkin' about including a simple support for the the most used audio codec, the AC3 (and maybe someone want DTS too, I would try if it works with Haali).
If you want to put anything you want in your container (also a car if you wish, or a plane XD) choose MKV.
EDIT: Okay then guys...

Now we have a document to work from/to, what do we need to do to generate such streams?

If we can start with some simple muxes first, such as: -

* AC3 audio only within .MP4
* MPEG-4 SP video with AC3 audio within .MP4

I might (no promises though) be able get some wizz-kids to incorporate it into a stand-alone player!


Cheers

I was posting while you were doing it too so i missed your post (I'm so slow...).
Anyway first of all I'd like to undestand if haali can add some slight modification (I hope that he can do it).
Like I said before the first thing that can changed is the ID used, that it's 226 in that doc (I'd like to undestand where the hell they get that ID, I'm quite sure that it's some MacOS program).
After that if I'm correct (but I've to check the file, the hell!) the channels weren't setted (it was 0 channel).
I dunno if there are other problems.

lazyn00b
14th June 2006, 14:02
I see basically 3 arguments against AC3-in-MP4:

Argument #1: AC3-in-MP4 is a hack!

Response: If the creators of the MP4 standard didn't want us to extend the standard with "private streams", then why did they provide a framework for doing just that? As pointed out by others, Nero and Apple have both extended the format successfully - I don't see any reason we can't do the same.

Argument #2: Why don't you just use MPG or TS containers?

Response: I would if I could, but there are few existing tools to do this, and they all suck. I've tried FFMpeg and VLC, and neither one of them produces good output. Even Elecard's expensive muxer seems to be broken; nobody's splitter/decoder will play it's files. Secondly, these two formats lack many of the "modern" features of the MP4 container.

Argument #3: Why don't you just use Matroska?

Response: Although MKV is a very nice format, and capable of all the things I need, I simply do not trust this format to carry us into the future. All it would take is a couple of key developers to get run over by a bus, and Matroska is dead. Anyone who would dispute this only needs to look at the long list of softwares used by the Doom9 community that have stopped dead in their tracks because of the loss of a developer or loss of interest: NanDub, IfoEdit, DVD Decryptor, DVD Shrink, VirtualDubMod, FAAC... the list goes on and on. Furthermore, some of the arguments used here against MP4 apply even MORE to Matroska, e.g if MP4 isn't getting any hardware support, then MKV sure isn't getting any.

In conclusion, I will only add that the reactions of some against AC3-in-MP4 are totally over the top. Some people have reacted as if we were proposing some utter abomination, like a peanut butter and tuna sandwich! :) AC3-in-MP4 is NOT some "ugly hack", like B-frames in AVI, if that's what you're thinking. I figure that with a little tweaking of MP4Box and Haali's splitter, we'd be good to go - but that's a question for the experts, I guess.

GodofaGap
14th June 2006, 15:11
Your response to argument 3 is nonsense. It is a personal weighing for which you give no basis, your lack of trust is not justified. A private extension to mp4 by doom9 members is just as likely or even more than that to be discontinued in the future. Furthermore, a container is not something that needs continuous development; if Haali get's run over by a bus tomorrow, his parser suddenly stops working? and if it does there are no alternatives anymore?

SeeMoreDigital
14th June 2006, 15:28
Okay...

If possible can we put these non productive arguments to one side.... and discuss the most positive ways of placing AC3 and maybe even DTS within MP4 as a legitimate private stream ;)


Cheers

fight2win
14th June 2006, 16:40
ac3 in mp4, that would be a dream come true!:)

Kurtnoise
14th June 2006, 17:03
The question is why do you want to have a such stream in MP4 container whereas AAC supports already goodies supply by AC3/DTS...