Skip to content

Some code to literally fix a single broken MP4 video that I took while on holiday many years ago

License

Notifications You must be signed in to change notification settings

ohookins/fix-my-holiday-mp4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fix-my-holiday-mp4

Some code to literally fix a single broken MP4 video that I took while on holiday many years ago. The phone died after recording a significant amount of video, and didn't get a chance to write the header to the file. MP4 files can have their headers at the beginning or the end, but the end is most convenient for recording devices, as it will then know all of the interesting metadata. Unfortunately that also means that without those headers, the mdat box is just some unknown video and audio samples. The playing device doesn't know how to decode them.

Basically a hand-written parser for a small subset of MP4 box types that I've found in the broken video file, and working video files from the same device that would allow me to splice working metadata onto the truncated video.

Getting a hold of the MP4 spec can be difficult (and I always forget where I found it last) so here's a hopefully working link: https://web.archive.org/web/20180219054429/http://l.web.umkc.edu/lizhu/teaching/2016sp.video-communication/ref/mp4.pdf

About

Some code to literally fix a single broken MP4 video that I took while on holiday many years ago

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published