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
Avatar of 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


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.
Avatar of MerijnB
Flag of Netherlands image

Blurred text
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

A miscellany is defined as a "collection of various pieces of writing by different authors", but it has come to mean something "Of items gathered or considered together of various types or from different sources" or "a collection or group composed of members or elements of different kinds". The word "miscellaneous" comes from the Latin word "miscere", meaning "to mix." You might have heard the expression "a mixed bag," which applies when you don't quite know what you're going to get. More commonly, a miscellaneous group is made up of an odd group of things that don't fit anywhere else.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo