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.
Multimedia ProgrammingMiscellaneous

Avatar of undefined
Last Comment

8/22/2022 - Mon

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?
Sac Ko

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.

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck