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
Sac KoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MerijnBSr. Software EngineerCommented:
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 KoAuthor Commented:
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.
MerijnBSr. Software EngineerCommented:
Sac Ko - again, without realy experience with this my feeling is that it will be very hard to achieve this, in this particular way. Even if you will be able to manipulate the length in the header (if it is in the header in the first place), you can expect uncontrolled results by the player who is handling this stream.

I think the better way to solve this is on the client side, see if you can hook in there, or make your own video player which knows the format you stream and takes that into account, or don't sent separate videos, but sent it as a stream, so the server is aware of the separate video's, but delivers it to the client as one single stream.

Good luck! :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Multimedia Programming

From novice to tech pro — start learning today.