Log in

View Full Version : mux Apple compliant .mp4 / .m4v? mp4box doesn't do it for me


bennynihon
12th August 2014, 02:29
All of my encodes have the following elementary streams (video.264, audio.m4a (aac), audio.ac3, subtitles.srt, and chapters.txt). I mux them with mp4box using the following command


"c:\program files\gpac\mp4box.exe" -add video.264 -add audio.m4a:lang=en:group=1:disable -add audio.ac3:lang=en:group=1 -add subtitles.srt:lang=en:hdlr=sbtl:disable -chap chapters.txt -ipod -new "output.m4v"

However, despite using -ipod I am not able to get them to sync to my iPad Air properly. I can add the movies to my iTunes library, but get the following error when trying to sync: "was not copied...because it cannot be played on this iPad". If I open up the .m4v file that I get out of mp4box in the Mac OS application, Subler, and simply save it to another file, this movie can be added to my iPad without issue. So clearly using the options I have used above with mp4box doesn't create an Apple compliant movie, while Subler does. The documentation of mp4box is a bit sparse, so I'm not sure if there are other options that are suggested to get an Apple compliant .m4v file.

Since I use a Windows box to batch encoded movies, using Subler is out of the question. And although I'd love to use .MKV, I'd rather create .MP4/.M4V since most of my products are Apple (iPad, iPhone, Apple TV). What's everyone using to mux Apple compliant .m4v files?

Asmodian
12th August 2014, 03:12
Have you tried MkvToMp4 (http://forum.doom9.org/showthread.php?p=1537903)? It does a lot more than its name might suggest.

bennynihon
12th August 2014, 03:18
Have you tried MkvToMp4 (http://forum.doom9.org/showthread.php?p=1537903)? It does a lot more than its name might suggest.

I have. But it's GUI only, correct? Right now automate the muxing process after I encode my movies via a command line batch file

bennynihon
12th August 2014, 03:58
oops. Realized I started this thread in the wrong forum. Meant to be in the a/v container one.

But the good news is that MkvToMp4 also seems to fix the output of mp4box. Seems to have something to do with TKHD atoms.

TKHD atom correction for video. TRAK 1
TKHD atom correction for audio. TRAK 2

Is there a way to avoid them being "incorrect" from the get go, or can I correct them from the command line with something like mp4box? Thanks

filler56789
12th August 2014, 06:09
You could give a try to L-Smash's muxer or remuxer...

http://forum.doom9.org/showthread.php?p=1688566#post1688566

bennynihon
12th August 2014, 06:51
You could give a try to L-Smash's muxer or remuxer...

http://forum.doom9.org/showthread.php?p=1688566#post1688566

Thanks for the suggestion. I had looked at it previously, but it seemed somewhat limited in its capabilities. Any way to mux in a subtitle track? Or set the default audio track?

SeeMoreDigital
12th August 2014, 09:31
In order to work out which streams are causing a problem I suggest you try generating 'test muxes' using just the video and audio streams first. And build up from there.

Apple media players can be extremely fussy with various stream combinations as their media players don't conform fully to the MPEG-4 ISO standard.

bennynihon
12th August 2014, 15:43
In order to work out which streams are causing a problem I suggest you try generating 'test muxes' using just the video and audio streams first. And build up from there.

I determined it has something to do with disabling the AAC track.

-add audio.m4a:lang=en:group=1:disable -add audio.ac3:lang=en:group=1

Since I have both a stereo AAC audio track and an AC3 audio track (for broader player compatibility), I wanted to make sure the AC3 was the default track but wanted to place the AAC audio as the 1st audio track sequentially since some players expect an AAC audio track to be the first one. Hence the reason for disabling the AAC track to make the AC3 the default one. But perhaps this isn't the way to handle this.

SeeMoreDigital
12th August 2014, 15:47
Since I have both a stereo AAC audio track and an AC3 audio track (for broader player compatibility), I wanted to make sure the AC3 was the default track but wanted to place the AAC audio as the 1st audio track sequentially since some players expect an AAC audio track to be the first one. Hence the reason for disabling the AAC track to make the AC3 the default one. But perhaps this isn't the way to handle this.I seem to remember reading somewhere that the AAC track has to be the first/default track for Apple devices...

bennynihon
13th August 2014, 01:09
I seem to remember reading somewhere that the AAC track has to be the first/default track for Apple devices...

Yeah, apparently that's the case. Looks like this was the cause of my issues

SeeMoreDigital
13th August 2014, 09:34
Yeah, apparently that's the case. Looks like this was the cause of my issuesLife would be so much easier if Apple made their devices truly 'end-user friendly' and offered greater ISO 14496 compliance ;)