30

I have an MP4 video that I took with a Flip camera. The camera froze up while I was stopping the recorder and now the video appears corrupt. I can still download it off the camera, but it won’t play. Now, the video is still over 2 Gigabytes in size, so I think the data is still there.

So, I scoured the web looking for solutions, and I found paid services and software that claim to be able to fix such a thing. One diagnostic service (“Treasured”), showed me stills from the video, confirming my believe that there probably is something salvageable there. Unfortunately, though, the price requested to fix it is not in the budget. It requires more of a homespun solution.

Does anyone know how to fix a corrupted MP4? Or of a service or software that is not too much money?

Steve C.
  • 577
  • 1
  • 6
  • 19

3 Answers3

39

give this a shot Official tool Link This utility can recover H.264/AVC stream from unfinalized MP4/MOV files without (or empty) header. You may got the unfinalized file in case of damaging camcorder during recording or such. This utility has been tested with files recorded by GoPro, but it may work with other camcorders too.

Usage:

recover_mp4_to_h264 in_good_similar.mp4 --analyze
recover_mp4_to_h264 in_corrupted.mp4 out_video.h264 [out_audio.aac | out_audio.wav | out_audio.mp3] []
recover_mp4_to_h264 in_corrupted.mp4 out_video.h264 [--aac | --pcm | --mp3] []

Supported recorders:

Default is Ambarella (used in GoPro, etc.)
Specify --eos in case of Canon EOS
Specify --apple in case of some Apple software encoder
Specify --htc in case of HTC smartphone
Specify --motorola in case of Motorola smartphone
Specify --samsung in case of Samsung camcorder

Step 1: Use any good previous file with the same resolution and bitrate to generate the AVC configuration record, for example

recover_mp4_to_h264.exe GOPR0346.MP4 --analyze

Note: It will create the file 'avcc.hdr' in the current directory.

Step 2: Recover H.264 stream from the corrupted file, for example

recover_mp4_to_h264.exe GOPR0347.MP4 GOPR0347.h264 GOPR0347.aac

Note: The file 'avcc.hdr' must be exist. Note: Specify --pcm or the WAV file name in case of recovering MOV file written by Canon EOS.

Step 3: Use any other utility (Yamb or ffmpeg for example) to recreate the MP4/MOV file from the H.264 stream (GOPR0347.h264). Note MP4 does not support PCM sound, you must create MOV in this case:

ffmpeg.exe -r 30 -i recovered.h264 -i recovered.wav -vcodec copy -acodec copy result.mov

Edit: add official tool link. thanks The Compiler

Old Link: Mega Link

Qetesh
  • 100
  • 1
  • 5
Andrew
  • 537
  • 5
  • 9
  • Thanks for your insights on this. I will try it out when time permits. :) – Steve C. Sep 10 '14 at 13:32
  • Worked Brilliant, Thanks! I was a bit concerned at first about downloading via the direct link but noticed other sites did the same. `Usage: recover_mp4_to_h264.exe in_good_similar.mp4 --avcc recover_mp4_to_h264.exe bad.mp4 out_video.h264 out_audio.aac` – Wayne Shelley Dec 28 '14 at 17:21
  • yea sorry about the link, it gets stripped from other sites so it's just easier to host on mega – Andrew Apr 06 '15 at 18:02
  • Why there's an input file in wav where there's NO wav file ? – Gilles Quénot Aug 26 '15 at 18:50
  • 2
    There's now an official download (I think) on [the tool's website](http://slydiman.me/eng/mmedia/recover_mp4.htm). Also it seems `--avcc` got renamed to `--analyze`. – The Compiler Jan 27 '16 at 12:33
  • works great, but is there something similar for android? (so I could do it on android devices), I already found `ffmpeg` for android, but `recover_mp4` isn't available for android – user924 Nov 01 '17 at 09:33
  • I almost didn't download anything as the page looked somewhat dodgy, but virustotal.com didn't find anything nasty and the tool got me much further than any of the other tools that I tried so far (not to mention that all the other stuff isn't for free...). Thank you! – Gorgsenegger Dec 18 '17 at 20:12
  • 7
    The recover_mp4 tool is no longer downloadable on the tool's website. That website now takes you to an online tool. I tried it out and it seems to work but it is expensive. You can still download the tool here: http://www.softpedia.com/get/Multimedia/Video/Other-VIDEO-Tools/recover-mp4.shtml. If you are on linux or a Mac here is a similar tool written in perl: https://github.com/bookkojot/mp4fixer – jfbloom22 May 27 '18 at 20:38
  • 1
    There are very few Google search results offering free solutions. I wrote a blog post about how to repair video files for free on Windows, Linux, and Mac: http://blog.jonathanflower.com/post/174339850366/how-to-fix-corrupted-video-files – jfbloom22 May 28 '18 at 16:31
  • @jfbloom22: I have read your blog too. The software is not available for free download anymore. I tried to recover my video by uploading at their website and it worked but in the low resolution. For full recovery, they are asking for money. Could you please suggest what can be done? – skm Mar 13 '19 at 10:55
  • the mega link in the description has the old version of the tool – Andrew Mar 15 '19 at 02:36
  • 1
    Another download link: https://www.videohelp.com/software/recover-mp4-to-h264 I used version 1.92 and it worked. – Gibezynu Nu Jun 14 '19 at 11:19
  • Updated link to my blog post: https://jonathanflower.tumblr.com/post/174339850366/how-to-fix-corrupted-video-files – jfbloom22 Jan 21 '20 at 21:56
  • 1
    On Sony cams orientation matters when recording your sample "good" MP4! Trying to recover a 720p 30fps video, although the bitrate and framerate and everything else may match, no success unless the "good" MP4 is recorded as the same, portrait vs landscape. Maybe also portrait rotated to the left can be different than portrait to the right! Final commands that recovered everything for Sony a7s: ``` recover_mp4 good.mp4 --analyze ``` recover_mp4 good.mp4 bad.mp4 result.h264 result.aac --sony ``` ffmpeg -i result.h264 -i result.aac -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 result.mp4 ``` – Lorin Thwaits Feb 14 '22 at 07:45
7

SUPERB!

I had my android phone crash whilst i was filming. Luckily it's rooted so i could retrieve the temporary file from the Camera folder.

It was easy to recover the material using the advice here, it got me well on the way. But there were a few difficulties to conquer concerning the merge of the files...

The recovered audio had a higher bitrate than audio from 'good' files. 128k instead of 96k. So I could merge the files back into a working movie, but audio would go too fast and lose sync. So it needed conversion.

Also ffmpeg couldn't/wouldn't copy the aac stream, so it needed to convert the stream with a filter;aac_adtstoasc

In my case i had to do:

recover_mp4_to_h264.exe good.MP4 --avcc

recover_mp4_to_h264.exe bad.MP4 bad.h264 bad.aac --android

ffmpeg -i bad.aac -acodec libvo_aacenc -b:a 96k fixed.aac

ffmpeg -r 30 -i bad.h264 -i fixed.aac -vcodec copy -acodec copy -bsf:a aac_adtstoasc fixed.mp4

Success!

Isaac
  • 1,794
  • 4
  • 21
  • 41
user4938055
  • 71
  • 1
  • 2
  • Could you reformat your answer to be more clear about the points you are making towards the steps to resolve the problem? – Kmeixner May 25 '15 at 20:18
  • Just for others reading this, you do not need a rooted phone to retrieve the temporary file. You can easily retrieve it with most file manager programs. – kojow7 Sep 19 '16 at 06:18
2

I did not test the solutions above, but for me Grau's Video Repair Software worked. Download link and usage instructions for the program can be found on this page:

http://grauonline.de/cms2/?page_id=5

It's important to note that, for it to work, you must provide a non-broken (playable) movie of the same type (recorded using the same camera, with the same resolution, same settings, etc), so the software can compare that playable video file with the broken one and repair it. If you don't have a sample already, it's enough to record a 10 seconds video of your room or anything else using the same settings that you used to record the file which ended up broken.

Antônio Medeiros
  • 3,068
  • 1
  • 27
  • 22