-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed recovering the file #258
Comments
Just send me the files, I will have a look at them. |
Thank You for replying and your support. Just wow, I had to learn the art of MP4 container how encoding are packaged. It is super interesting. Using epic reverse engineering tactics (I dislike it) I created some tools in pure c code to do this. So far I have only spent time in recovering the 1 first track which is the video. The video file was seriously corrupted, the "mdat" atom had the wrong payload header, this leads me to think that the camcorder must provide the correct mdat payload during the end of the video recording session. The camcorder seems to not complete the video session, I possibly haven't turned off the camorder and therefore video file ended corrupted. Next is to recover the 2nd track which is the audio. I'm sure the process is same as to the first track. I used some MP4 parser tools like: MP4Box.js have an online platform which the videos can be played and analysed: Atomic Parsley bento4 "mp4dump". The hex editor I used was "imhex" and "rehex". For some reason bento4 "mp4edit" makes it difficult to replace moov atom, it creates a new mdat atom when replacing/inserting moov atom. So I had to manually copy and replace the moov at to the corrupted video using a hex editor. I created few c programs to find, evaluate, extract and write the start code offsets in the mp4 file (which uses H254 codec encoding, it seems to not use the MP4 annex-b protocol): The c program does all the important tasks in 5 seconds for a 20 min video. I also had to modify the duration in the atom, since a valid working video from the same camcorder has a different duration. The corrupted video length is different. I had to create some few simple formulas to calculate accurate values for many parameters. The co64 offset first starts with the start codes of "0x658880" frames and then continues with "0x219A00" frames. The process repeats for each sample. Each sample contains 15 frames. I'll now focus in recovering the audio, if I can't do it I'll email them to you. I'll possibly make an open source github, the processes I use seems to be exactly the same how some automated commercial video recovery implements. They look into the mdat and extract data from there on (this is what I'm assuming). Honestly for $17, I would seriously spent the money and save 8 days, however the commercial guys didn't give me the proper audio which is just as important if not more important than the video. (had some police incident that I recorded with my bodycam) Also ChatGPT helped me a lot if finding and correcting bugs and giving some ideas. Here is the recovered atom structure:
|
I was able to to recover about 97% of the audio. For my purpose seems to be 100%. Recovering the audio is much more difficult and tricky than recovering the video. Because find the child samples is more random and difficult to find in simple search. The child audio samples have no specific set identification, it's identification varies for each child sample. By the way I had to create my own tools to do this. The parent audio samples always starts with the hex code: 0x0012C35 |
Seems like it can't repair the file, have any clues how to get it to repair?
It outputs a 12KB .mp4 file:
./untrunc -N -w -v -m -i 20230309061733_000000.MP4 20230309064234_000001.MP4
Here is the proper video clip as reference:
Here is the corrupted video clip:
I got a preview sample from a website:
https://fix.video/
And they actually fixed the video but the audio is completely messed up with noise.
So I know it is repairable.
Thanks.
The text was updated successfully, but these errors were encountered: