Link to home
Create AccountLog in
Avatar of Sac Ko
Sac Ko

asked on

Edit MP4 Header Information In Its Binary

I have a small MP4 file of duration 10 seconds, less than 1MB. I am able to open the file in HexEdit to view its binary source. But I am not able to figure out where does its header information is in this binary file.
What I basically want to do is change the duration of this MP4 to say like 20 seconds. I know its a read only attribute and thats the reason why I am trying to edit its binary data to update the duration.
Please see attached ffprobe screenshot and screenshot of MP4 file when opened in binary format in HexEdit editor.
mp4-hexedit.png
ffprobe.png
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Now I don't know the mp4 header structure, but there is quite a big change the length is not in there. Often length is calculated from the combination of bit rate an number of bytes in the actual data.

Your question begs a counter question though :p

What are you trying to achieve by this? Even if the length is somewhere in the header, what do you think you accomplish by make it longer?
Avatar of Sac Ko
Sac Ko

ASKER

MerijnB -  I basically want to fool the browser into believing that video received from the server is of a longer duration. So if the actual duration is 10 seconds I want the browser to believe its of (say) 20 seconds. Its just an experiment I am trying out checking if it is doable or not. My ultimate goal is to have server send a short video of duration 10 seconds every 10 seconds. The first video will have a long duration so that the browser will assume its just the first video its playing. The reason I am trying to do this is because when I play different videos after every 10 seconds I am getting a small lag/delay between playing of two videos. I want to eliminate this delay.
ASKER CERTIFIED SOLUTION
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer