I am yet to find a program which allows one to change the AVC level of an MP4 movie file on Mac or Linux without re-encoding. Fortunately, it is very easy and fast to do.
All you’ll need is a hex editor, like HexEdit on the Mac, ghex for Gnome or Okteta for KDE 4 in Linux.
Please note: I strongly recommend that you make a copy of your MP4 file before editing it. It’s very easy to corrupt a file this way and make it unplayable.
Open your movie in your hex editor of choice and do a case sensitive search in ASCII mode for “avcC” (without the quotes), or for 61 76 63 43 in hex.
Once it is found, you will see in hex mode a series of numbers immediately after:
The first hex number is usually 01 and unimportant for our purpose.
The hex numbers which follow determine the profile type:
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, 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
It’s very easy to do the conversion on a calculator which supports hex numbers (the calculators on Mac OS X and various Linuxes have Programmers’ modes which do).
In order to successfully change the AVC level, do a search and replace for all instances of the profile/level number you encounter in the file with the value you need. E.g. if you see that the file is High Profile Level 5.1 and you wish to change it to High Profile Level 3.1, do a search in hex for all instances of 64 00 33 and replace them with 64 00 1F.
Save the file and you are done.
- The main purpose of this exercise is to make MP4 files playable on the Playstation 3 without re-encoding them first. For reasons known only to Sony, it will refuse to play a file which has a needlessly high AVC level set.
- Did I mention that you should make a copy of your movie before you edit it with a hex editor? Please do. Many things can go wrong and I am not responsible for any data loss resulting from the application of method outlined above.
The information in this article was taken from the following forum topic:
A big thank you to dk75!