After significant testing I have found a solution that I can share with others - albeit a far from optimal one - to at least get MP4 movies to work without having to re-encode them. (However, there is no fix currently for embedded Chapters not being supported.)
My movies were encoded as stated above, with the MeGui Xbox360 preset: AVC High Profile Level 3.1 video, AAC-LC 2ch audio. However, some of my later encodes were tagged in the MP4 metadata as Level 4.1. This is a result of the MeGUI Xbox360 preset being updated in line with Microsoft adding new features by firmware updates. However, nothing was different with the ACTUAL encoding - only the Level tag changed.
There is a SINGLE BYTE in the MP4 that declares AVC level. *iTunes will refuse to sync a movie merely if it doesn't like that one byte for AVC level*. It will not allow any movie tagged as Level 4.1 or higher to be synced, _even if in reality it doesn't exceed Level 3.1 limitations_. (Consult Wikipedia for those resolution and bitrate limits.) It doesn't even look at what the encoding method was, or if it really will render on the iPad! The warning dialog lies! Ridiculous.
By changing literally ONE byte out of 1 giga byte file, I was able to transfer my movies to my iPad. Instructions are below. My new request to the developers would be to remove that arbitrary restriction on AVC level from iTunes, or at the very least change it to a warning dialog saying "+The movie may not work *FOR XYZ REASON*, but proceed anyway+". I know the iPad is officially stated as only supporting up to AVC High Profile Level 3.1, but it shouldn't arbitrarily reject media like the PS3 does either.
Also, the order of Audio/Video tracks (which one is first) doesn't seem to matter for compatibility. I've tried both ways using multiple muxers, and either way worked. YAMB worked best. As long as it can be dragged and dropped into the Library interface, and play inside iTunes, it works on the iPad.
*How to change AVC Level in an MP4 without reencoding (or demuxing):*
1.) Open up the MP4 in a hex editor (HxD is a freeware for Windows - be warned: it tries to automatically save a "backup" copy when saving, but that can be aborted)
2.) Search for the hex "61 76 63 43" ("avcC" in ASCII) - it should occur only once near the top
3.) The next byte after that is usually "01" and isn't important
4.) The next two bytes declare Profile ("42 E0" = Baseline, "4D 40" = Main, "58 A0" = Extended, "64 00" = High).
5.) The next byte declares AVC Level ("1F" = Level 3.1, "29" = Level 4.1, "33" = Level 5.1)
6.) Change whatever is in the AVC level to "1F" in hex and save. Try syncing the movie to the iPad again. (It would also be a good idea to check to see if you are violating the AVC 3.1 limits by doing so.)
Hope this helps someone else. I'm ticked off since I already burned my movies on DL's for trips, and now I have to copy them all off to a hard drive to Edit. Then I have to re-burn them on the expensive discs again. All of because an arbitrary one-byte flag rejection in iTunes.
My new request to the developers would be to remove that arbitrary restriction on AVC level from iTunes, or at the very least change it to a warning dialog saying "+The movie may not work *FOR XYZ REASON*, but proceed anyway+".
Have you sent this to Apple? We're mostly just users like yourself in here
I will try that, Colin. Thank you for the link. I'm the type of person that would try to crumble mountains by tapping on them with a tuning fork - and I must admit this problem was particularly vexing.
I'm certain the restriction was intentional, however - so I may only be pointing out the obvious. Nonetheless, I appreciate your positive input, and will try submitting a suggestion.
Holy crap you rock! I haven't hex-edited since the 80s - but since the file I had was worthless after an unsuccessful muxxing attempt, I did your trick - and BAM - back in business. iTunes and Quicktime liked the file fine, my iPad wouldn't touch it.
I use OSX so if you're a on a mac try the free editor "Hex Fiend".
Just do a find (command F) for the hex series he mentioned, then change the appropriate byte - then remove it from the library and put it back in. Boom - piece of CAKE!
Haven't had this much fun since back when I was a game tester and found some passcodes in hex and remapped a client in an early FPS shooter and created havoc on a beta-test during April Fools day (removed all the walls on my map - and played ghost with everyone).
This solution worked a treat for me, except I found that files encoded as "Apple/Universal" in handbreak have these header packets at the end of the file, not the beginning.
Here's a Python script which automates the patching process.
Just *chmod u+x ipadfix.py* and run it from the command line with the file to be patched as the only argument, ie:
On windows, install Python and then run it like:
*python ipadfix.py mymovie.mp4*
And presto, your file is patched! This will still work for files which have the metadata at the beginning of the file, but will take a LONG time. It's already pretty slow (around 15 seconds to find the data), but I never wrote anything in Python before, so if someone knows a faster way, let me know! Bazaar, thanks for sharing the research results!
Great tip! I've run into the same problem. This saves a lot of headaches and time. Sometimes why software designers/engineers do things they was they do is simply inexplicable! Who knows what Apple was thinking when they implemented this new way of handling movies. Previously all my movies synced with my iPad without problem. Now we must resort to things like what you have come up with to circumvent this.
I have many video files that I have collected over time. Some are in a MP4 format and some in the M4V format. I can play both formats in iTunes, but only the M4V formats will transfer and play on my iPad.
The solution you discribe seems to be the solution to my problem. I am not very technical, but get around a PC okay. Would you mind providing details about how I might use the Python program and run the script against my MP4 files. Is it possible to run this in a batch? I have a few hundred files. Thank you in advance!!
I can confirm that this fixed it for me. I had the trouble on a movie ripped from handbrake 0.9.5 on vista premium. The hex for profile and audio where different than you listed. I used the Ipod touch and Iphone preset and it would not sync. Changing the value allowed it to sync and the file played fine.
I have this problem...
- The Inbetweeners Movie file will not play on my iMac with the latest version of itunes & quicktime stating it cannot be played because it is incompatible with quicktime and this version of itunes.
- In addition I purchased the HD version which should come with an iPad/iPhone ready SD version. When i attempt to copy this film to the ipad or iphone in itunes, it states this file is not compatible.
- If I attempt to convert the film for iPad use using Advanced > Create iPad or Apple TV Version, I receive the error "An unknown error occurred (-4)
- The Inbetweeners Movie is a brand new release which should mean that it is in the latest and most compatible file formats
- My Ipad is running version 5.0.1 (9A405)
- My iMac is running Mac OS X Lion 10.7.2 (11C74)
- My ITunes version is 10.5.2 (11) 64Bit
- My Quicktime Player app is version 10.1 (501.5)
- This is my second re-download attempt and has the same problem as the first.