Log in

View Full Version : How to mux AC3/DTS streams in mp4...


Kurtnoise
1st April 2007, 10:43
this method is not recommended anymore...use either MP4Box 0.4.5 (or higher), or mp4muxer, or Handbrake or Nero tools to create ac3-in-mp4 compliant files.

How-to:
Grab the last Haali Media splitter package here :: http://haali.cs.msu.ru/mkv/
Install it and go to in his directory to launch gdsmux application. This is a smart interface to mux some media files with the help of Haali directshow filters. You can do this also manually through GraphEdit but I'm sure that it's more users friendly with an interface.
Then, add your input files (right click in the 1st tab). I've tested this successfully with avc/asp/avi/ts video files and ac3/dts audio streams.

http://img442.imageshack.us/img442/6729/gdsmux1yh4.png (http://imageshack.us)


At last, save your output file (don't forget the .mp4 extension) and click on "Start" button.

Not bad, isn't it ?

Selur
2nd April 2007, 07:30
Nice :) Do you know if these files will be Nero compatible. Read in another thread that Nero is thinking about supporting this in Recode&Co.

Cu Selur

Kurtnoise
2nd April 2007, 18:16
Nice :) Do you know if these files will be Nero compatible.
I don't think so...Just tried to play those files with ShowTime and it doesn't work.

Plus, the Nero mp4 files have their own brand names for profiles. So for the moment, we can't specify this with Haali filters.

madshi
3rd April 2007, 13:25
Are you guys sure that this is really a MP4 file? I rather think that gdsmux always creates MKV files. So basically you're creating a MKV file that is named MP4 this way. Or am I wrong?

Hyper Shinchan
3rd April 2007, 15:28
Are you guys sure that this is really a MP4 file? I rather think that gdsmux always creates MKV files. So basically you're creating a MKV file that is named MP4 this way. Or am I wrong?

Wrong. From a long time Haali DS muxer supports MP4 output. Try it by yourself, I use graphedit, check the property and you'll see that it's possible to choose between MKV and MP4 output (it's also possible to set language and audio/video delay, thogh the last one probably doesn't work, at least in older version, I've to check it out now).

EDIT:Nice Do you know if these files will be Nero compatible. Read in another thread that Nero is thinking about supporting this in Recode&Co.

Cu Selur

Well, it would be nice to synchronize with Nero when decide to show use their way to store AC-3 in ISOMedia files. I wonder if they'll use a proprietary code for the mp4a sample entry or use a completely different sample entry. Haali uses the first solution.

madshi
3rd April 2007, 15:30
Wrong. From a long time Haali DS muxer supports MP4 output. Try it by yourself, I use graphedit, check the property and you'll see that it's possible to choose between MKV and MP4 output (it's also possible to set language and audio/video delay, thogh the last one probably doesn't work, at least in older version, I've to check it out now).
Oh, cool, didn't know that!

mediator
5th April 2007, 10:24
Well, it would be nice to synchronize with Nero when decide to show use their way to store AC-3 in ISOMedia files. I wonder if they'll use a proprietary code for the mp4a sample entry or use a completely different sample entry. Haali uses the first solution.

a testfile is available at:

Download nd_ac3.7z (http://putstuff.putfile.com/65595/1647007)

Since the Handler-Atom for the AC-3 track naturally states that this is an Audio Track, a standard AudioSampleEntry is found in the Sample Description Box (as specified by ISO). The format of the AudioSampleEntry has to say "sac3" (SampleEntry for AC-3). A DecoderSpecific Config has to follow as well:

typedef struct
{
uint8 version; // current version: 1, higher version will append new
// structure members to the end of this structure
uint8 bsid; // allow the decoder to see if it can handle the stream

} AC3DecSpecStruc;

typedef struct
{
AC3DecSpecStruc DecSpecificInfo;

} Dac3;


With the bsid being there as decoder config a decoder can tell without reading samples if it will be able to decode the stream (e.g. Enhanced AC-3 is not bitstream compatible with AC-3). In DirectShow context, it can be used to set up the right mediatype for the splitter's output pin (it makes sense to have a distinct mediatype for Enhanced AC-3).

All in all, this extension is in strong accordance with ISO, since only a new "codingname" ("sac3"), and a respective decoder config was added. You may as a reference also have a look on how 3GPP has added the AMR codec to the MP4-container.

The most recent Nero release has a splitter (NeMP4Splitter.ax) that should handle files with this extension to MP4.

Drachir
5th April 2007, 12:14
All in all, this extension is in strong accordance with ISO, since only a new "codingname" ("sac3"), and a respective decoder config was added. You may as a reference also have a look on how 3GPP has added the AMR codec to the MP4-container.


A short comment:
The 3rd Generation Partnership Project didn't add AMR to the MP4-container, they defined a new container on top of the ISO base media file format (ISO/IEC 144496-12). 3GPP doesn't use without a reason an other file extension.

Nero should think about an other file extension too? Because files created by Nero are not in all cases (subtitle and more than one audio track) proper MP4 files(ISO/IEC 14496-14).

Beside the way to introduce the new AudioSampleEntry you could have used mp4a with an new objectTypeIndication. Take a look at how MP4Box create MP4 files with vorbis, or how MP3 is used in MP4 files ...

It may be a good idea to register a way to use ac3 in ISO base media files at http://www.mp4ra.org/ ,SMPTE did this for VC-1 too(I think someone from there society come up with this at a MPEG meeting).

mediator
5th April 2007, 12:47
Beside the way to introduce the new AudioSampleEntry you could have used mp4a with an new objectTypeIndication. Take a look at how MP4Box create MP4 files with vorbis, or how MP3 is used in MP4 files ..

That's another way of doing technically the same. But there is at least one good reason not to use mp4a: AC-3 is not part of ISO MPEG-4 Audio (14496-3, and most likely will never be). So if you assume that "mp4a" <=> ISO/IEC 14496-3 then a different "codingname" for AC-3 is a better choice. The "codingname" is defined to describe the compression format for the decoder.

SeeMoreDigital
4th July 2007, 18:02
I don't seem to be able to make the 03 June 2007 version of G DSmux work.... Anybody else?

Kurtnoise
5th July 2007, 10:56
What kind of issue did you have exactly ? Are you able to load your input files ?

SeeMoreDigital
5th July 2007, 16:57
What kind of issue did you have exactly ? Are you able to load your input files ?Sadly no... not at all :(

SeeMoreDigital
13th July 2007, 17:18
Hmmm....

I don't know why but I'm still not having any luck generating .MP4 muxes with .AC3 audio with this application!

Is anybody able to provide a short sample for testing please?


Regards

Kurtnoise
14th July 2007, 09:35
I don't know why but I'm still not having any luck generating .MP4 muxes with .AC3 audio with this application!
Are you able to load a mkv file at least ? If not, some dshow filters are probably missing.

SeeMoreDigital
14th July 2007, 10:31
Are you able to load a mkv file at least ? If not, some dshow filters are probably missing.No I can't....

Nothing happens when I right click over the "Input" tab: -

http://i13.tinypic.com/5zr2lg6.png


Bummer.....

Selur
14th July 2007, 13:35
just tried with a dolby-canyon.zip from http://www.cinenow.com/uk/vobtrailer.php3
-> loading in gdsmux worked fine, remuxing seemed to work fine too, but playback didn't graphedit builds the right graph, but no sound output. (MPEG2 Video in .mp4 works fine)

So loading both, the .mp4 and the .vob in gdsmux shows the following: http://bayimg.com/nadiOAabN
-> seems like something get's lost during vob->.mp4 remuxing
(avi->mp4 with ac3 audio works fine)

When I extract the ac3 audio stream with dgindex and feed gdsmux with the .vob, the separated ac3 stream and deactivate the audio in the vob the generated mp4 plays fine. :)

@SeeMoreDigital: I mean no offense, but you did right-click in the white and select "add to source" to add a source?

here's a small 5.1 ac3 audio only .mp4 file:
http://upload2.net/page/download/LI2rt513lXusslB/Audiotest.mp4.html

Cu Selur

Ps.: I uploaded the Test.mp4 (remuxed dolby-canyon trailer) to (will insert link when finished uploading ;) -> http://www.megaupload.com/?d=F5KCF278) (this is the 'broken' file not the one where I demuxed the ac3 before muxing)

PPs.: is it possible to append multiple sources somehow in gdsmux?

SeeMoreDigital
14th July 2007, 14:20
@SeeMoreDigital: I mean no offense, but you did right-click in the white and select "add to source" to add a source? Doh, doh, doh!!!

No offence taken... I was indeed clicking on the input tab and not within the white area :o

And guess what.... It's working now :)


:thanks:

Selur
14th July 2007, 15:00
Happy to help :)

SeeMoreDigital
14th July 2007, 15:16
Observations so far....

After generating an 6Ch AC3 in .MP4 audio only file with DSmux, I found I was able to use MP4Box_0.4.5-dev_(2007-07-03) to mux the 6Ch AC3 in .MP4 audio only file together with a MPEG-4 video stream!

I was expecting MP4Box to crash.... but it didn't :)

Kurtnoise
14th July 2007, 16:41
is it possible to append multiple sources somehow in gdsmux?
Nope...


I was expecting MP4Box to crash.... but it didn't
Why are you expecting a crash ? The mp4 file created in this way doesn't contain "elements" to know exactly that the audio stream is an AC3. That's why when MP4Box parses the file, none errors are returned.

SeeMoreDigital
14th July 2007, 18:16
Why are you expecting a crash ? The mp4 file created in this way doesn't contain "elements" to know exactly that the audio stream is an AC3. That's why when MP4Box parses the file, none errors are returned.I guess that make sense...

By-the-way, I have just noticed that GSpot (v2.70a) is able to correctly recognise the AC3 streams properties but MediaInfo (v0.7.5.0) can't.

Also, MP4box can't extract the AC3 stream out of the .MP4 container but mp4UI can ;)


Cheers

Kurtnoise
14th July 2007, 22:42
I stand corrected...there are special stuff for AC3 & DTS (respectively ObjectTypeIndication = 0xd3 and ObjectTypeIndication = 0xd4) but I'm not sure that's defined by the standard.

So, I just patched MediaInfo to have some properties from these files (replace the dll by this one (http://kurtnoise.free.fr/index.php?dir=misc/&file=MediaInfo-0.7.5.1.zip)).

SeeMoreDigital
15th July 2007, 11:39
...So, I just patched MediaInfo to have some properties from these files (replace the dll by this one (http://kurtnoise.free.fr/index.php?dir=misc/&file=MediaInfo-0.7.5.1.zip)).Thanks Kurt,

I've installed your patch but have noticed that 6Ch AC3 streams are reported as being 2Ch: -

http://i12.tinypic.com/62eoxeg.png


Cheers

Kurtnoise
15th July 2007, 12:56
I think it's a problem from the Haali filter...

bond
15th July 2007, 14:47
anyone tried muxing ac3 into mov with quicktime? I would say this should be the "standard" way of placing ac3 in mp4

SeeMoreDigital
15th July 2007, 15:21
anyone tried muxing ac3 into mov with quicktime? I would say this should be the "standard" way of placing ac3 in mp4Yes....

When you try an open an AC3 in .MP4 file with QT7, all you get is an "Error -50: an unknown error occurred" message.

bond
15th July 2007, 15:24
Yes....

When you try an open an AC3 in .MP4 file with QT7, all you get is an "Error -50: an unknown error occurred" message.obviously, as ac3 is not supported in mp4

what i meant was to mux an ac3 audio stream to MOV in quicktime (there would not be any mp4 involved), check out how this is done, and then use the same way for storing ac3 in mp4

SeeMoreDigital
15th July 2007, 16:04
obviously, as ac3 is not supported in mp4

what i meant was to mux an ac3 audio stream to MOV in quicktime (there would not be any mp4 involved), check out how this is done, and then use the same way for storing ac3 in mp4Throughout all the years I've been using QuickTime Pro, I have never come across an option to mux AC3 directly into .MOV...

Plus, even though Apple provides a "plug-in" for MPEG-2 video, there does not appear to be a plug-in for AC3 audio, meaning QT7 is unable to fully support MPEG-2 with AC3 in .VOB, .MPG or .TS


Cheers

Stux
16th July 2007, 04:31
You would need to have an AC3 importer first. On the Mac platform you have AVI importers which support AC3. That would actually give you a work-around to get AC3 into QT.

So if you have the AC3 in AVI and open that in QT... you should then be able to extract the AC3 track, add that to a video track and save as MOV.

That would give you an AC3 in MOV. Not necessarily sure if that'd be the most 'compliant' way to put AC3 into MOV.

BUT you'd basically support AC3 using a fourcc of 'ms' + ac3's WAVETag and VBR mov audio muxing. Fairly simple.

Perhaps H264+AC3 in a MOV would make a good format.... after all, its very close to MP4... except that you are actually allowed to use AC3 in it ;)

enjoyer
16th July 2007, 21:33
is there any possibility to transfer a *.mp4 ac3 5.1 file to the ps3?

bond
20th July 2007, 19:29
is there any possibility to transfer a *.mp4 ac3 5.1 file to the ps3?why? it wont play it anyways...

try 5.1 aac audio instead...

enjoyer
20th July 2007, 19:36
how can i generate a 5.1 aac audio when the source is ac3 5.1 ?

bond
20th July 2007, 19:50
:search:

this is the wrong thread for this

calinb
9th August 2007, 00:41
Does the CLI version, dsmux.exe, provide a means to mux more than one source file or selectively remove streams contained in the input source?

The provided dsmux usage hint is simply, dsmux.exe <output file> <input file>

I guess I'll try to append additional input filenames to the end of the CLI line (just thought of trying that :rolleyes:) but how might I discard and not mux unwanted streams to the final target file?

gdsmux.exe (along with eac2to) sure works well for converting .evo files to a cross-platform friendly format but a fully batched method would be sweet!

Thanks, Haali!

-Cal

San07
17th July 2008, 21:58
I tried AC3 & succeeded.


Is it possible to mux Dts in mp4.

San07
18th July 2008, 11:24
The error i get when i try to add dts.

http://i187.photobucket.com/albums/x20/srini07/Error001.jpg

kurt
18th July 2008, 13:58
why not using mkv?

San07
18th July 2008, 15:04
why not using mkv?

Iam doing all my rips in MP4 only so MP4.;)

kurt
18th July 2008, 16:03
ok, have fun with mp4 :)

halsboss
18th April 2009, 02:47
I have the latest purchased coreavc which comes with haali and I see GSDemux is installed too. Couldn't readily locate any help for it.

Do you know if GSDemux correctly handles both packed-bitstream and non-packed-bitstream mpeg4-ASP in AVI's when re-muxing into MP4 ? Any links would be appreciated.

ie I'm wondering if xvid/mp3 AVI's might be better liked by avisynth using MP4 & DirectShowSource ? (non packed bitstream mpeg4-asp AVIs have issues as we know)

Kurtnoise
18th April 2009, 09:01
your questions are off topic here...

halsboss
18th April 2009, 14:53
Oh. Yes, they are. Sorry.

Eric B
4th May 2009, 16:36
I've just tested to mux ac3 5.1 with avc video in a mp4 container (Big Buck Bunny 1080p Divx7 HD video)
1) Yamb 2.0.0.8 does not allow the drop of the ac3 file
2) MeGUI did the job. When I read the resulting mp4 file in TCMP or MPC-HD, I get only the video. Audio is played back fine in VLC

Kurtnoise
4th May 2009, 17:40
1) you have to use the latest beta.
2) you have to use the latest Gabest MP4 Splitter within such dshow players.



Next time, :search: