I have a video file encoded with h.264 that will not play on iOS, and I\'d like to know why. Here\'s the HTML:
Found the solution to my own question:
The problem was that the video used the h.264 Main Profile level 5.1, while iOS only supports AVC level 3.1 (more info here).
I confirmed this by following these instructions to change the profile and level bytes using a hex editor. Search the file for avcC
in ASCII or 61 76 63 43
in hex. The first byte is usually 01
and is unimportant to this purpose, but after that should be one of the following:
42 E0 – for Baseline Profile
4D 40 – for Main Profile
58 A0 – for Extended Profile
64 00 – for High Profile
The number after that is the level (without the decimal point) in hex, e.g.:
1F (31 in dec) is level 3.1
29 (41 in dec) is level 4.1
33 (51 in dec) is level 5.1
If you do a find and replace of all instances of the profile/level bytes (e.g., search 4D 40 33
and replace with the bytes you want--in my case 4D 40 1F
), the video should now play on iOS. Note that many web help pages say iOS requires the Baseline profile, but that doesn't appear to be true. Main works fine as long as the AVC level is 3.1.