Video Repair Guide – Corrupted MP4 / AVI / H264 / H265 File Fix

Article Updated: 14 Feb 2022

HOW TO REPAIR UNPLAYABLE VIDEO FILES RECORDED WITH YOUR PHONE, DRONE OR DIGITAL CAMERA?

Sometimes, your phone’s recording app may become unresponsive and crash or your phone’s/camera’s/drone’s battery can become dead and abruptly interrupt recording process. In those cases, recordings will NOT be finalized and they’ll refuse to play in any app (phone or desktop) with example messages: “unsupported video format”, “unrecognized file format”, “file with 0 length”, “cannot render file” etc. Additionally, if you accidentally deleted some videos from your computer or phone, and later used tools such as Recuva, GetDataBack, PC Tools File Recovery and so on to bring them back, just to later discover that the files are useless and unplayable, you should still have a hope – because additional recovery step may be required until full recovery success!

Watch Video Tutorial

Note: download links in the video are all expired, please check updated links in the video description, pinned youtube comment or further below.

There are many different APPs and DESKTOP TOOLS on the market but they are usually NOT FREE! To name just a few most popular:

  • Stellar Phoenix Video Repair ($69.99 SOHO Edition)
  • Video Repair Tool by Grau GmbH (99 EUR unlimited)
  • MP4Fix APP for Android ($3.99)
  • Web-Based services (price varies)

⚠️ Recommended Reading

NEW FREE VIDEO REPAIR TOOL & TUTORIAL

There’s another free video repair tool that you should definitely try! It has a graphical interface and you can repair your videos in just a few simple clicks!

▶️ Read here!

Sometimes, even those commercial apps CANNOT fix your videos!

IMPORTANT NOTE

Remember: the less modifications you do on your storage media that holds damaged video file(s), the higher the chance for recovery! For instance, if you accidentally deleted your videos on a file system level (e.g. with File Manager or Media Player) and then used Recuva / Get Data Back / File Recovery / Various Undelete apps to restore the files and then you find out they are not playable, there is a very low chance this procedure will actually help you in that case!

Because, despite “successful” file recovery reported by the undelete/restore apps, videos may still miss important headers which hold crucial recovery information and also could be already overwritten by other files in the middle of the stream, which will make the recovery procedure with video recovery tools virtually impossible!

In those cases, where files are unrecoverable by recovery tools, the only chance is to hire some digital forensics expert and try to salvage individual frames (if any), and do frame-by-frame video reconstruction. There are no publicly available tools (that I’m aware of) that can do this for (arbitrary) video codec/format.

Also, read user comments below about specialized file recovery tools, that also take fragmentation into account and possibility of potential recovery in that case.

STEP BY STEP TUTORIAL

First, you will need another GOOD video that will serve as a reference for repair procedure. This reference video should be recorded on the same device (hardware) as the broken video that you’re trying to fix with the same framerate + bitrate (quality) and codec settings, including device tilt / orientation (as some users reported in the comments). If you don’t have it, make/record one, usually couple of seconds is all that you need, but in some cases you should use loner reference videos (at least 30-60 seconds in length), in order to properly construct frame structure and have a higher chance in repairing both video and audio parts in the broken file(s).

DO NOT record this reference/example footage on the same memory card / storage media that holds your broken file! If your device is broken or lost, you can use a video from your archive (assuming that you have saved them). If you don’t have a reference video, this guide cannot help you in that unfortunate case :(

Then follow below steps to repair it:

STEP 1

Download recover_mp4 Video Repair Tool:
recover_mp4_192.zip

STEP 2

Download ffmpeg Tool:
Use new GitHub builds repository (only 64-bit versions are available)

Quick direct .zip archive ffmpeg download links:

  1. ffmpeg-2020-12-15-git-32586a42da-essentials_build.zip (newer 64-bit)
  2. ffmpeg-tools-2020-10-14-git-6bdfea8d4b.zip (older 64-bit)

Alternatively, if you need even older ffmpeg versions from 2019 (in case of codec compatibility), you can get them from our server:

  1. ffmpeg-20190212-a84af76-win32-static.zip (2019-Feb 32-bit version) [ VirusTotal Report ]
  2. ffmpeg-20190212-a84af76-win64-static.zip (2019-Feb 64-bit version) [ VirusTotal Report ]

STEP 3

Extract ffmpeg.zip, then extract recover_mp4.zip inside /ffmpeg/bin/ directory so that all the .exe files are in the same folder! Also, for simplicity, rename ffmpeg’s directory to a shorter name (useful for next steps).

STEP 4

Copy your “good.mp4” reference file into SAME directory with .exe files as described in STEP 3
Copy your “bad.mp4” damaged file to be repaired into SAME directory with .exe files as described in STEP 3

STEP 5 

(Windows 10)
Search > type CMD > then right click on COMMAND PROMPT to RUN AS ADMINISTRATOR and confirm with YES

STEP 6

Change your working directory inside COMMAND PROMPT to where your ffmpeg.exe and recover_mp4.exe and .mp4 video files are (see step 3)

STEP 7

Execute following command inside COMMAND PROMPT + press ENTER

recover_mp4.exe good.mp4 --analyze

COMMAND EXPLAINED / BREAK-DOWN
recover_mp4.exe | means that we are executing/calling our recovery program/app
good.mp4 | we pass as a parameter name/path of the good reference video file (since it is in the same directory as recover_mp4.exe tool then we simply just type the filename+extension)
–analyze | we instruct recovery tool to analyze damaged video file and try to figure it out with it’s magic! :)

STEP 8

After analysis is completed, run 1st command you received from recover_mp4, for example:

recover_mp4.exe bad.mp4 result.h264 result.aac

Note: this is generic case without any specific options (switches).

COMMAND EXPLAINED / BREAK-DOWN
recover_mp4.exe | means that we are executing/calling our recovery program/app
bad.mp4 | we pass as a parameter name/path of the damaged video file (since it is in the same directory as recover_mp4.exe tool then we simply just type the filename+extension)
result.h264 | we specify the output filename+extension of RAW video portion of recovered file
result.aac | we specify the output filename+extension of audio portion of recovered file

NOTE: above are only example commands, they will be different for each video format – follow instructions you receive from recover_mp4 tool!

STEP 9

Then run 2nd command:

ffmpeg.exe -r 30 -i result.h264 -i result.aac -bsf:a aac_adtstoasc -c:v copy -c:a copy recovered.mp4

In case you receive an error, but your result.h264 file is actually playable, you can try the most basic ffmpeg command first, ignoring audio part and see if that works:

ffmpeg.exe -r 30 -i result.h264 -c:v copy recovered.mp4

If above command does not work either (you may receive a lot of errors, but the end result should be fine) you can try re-encoding output with following command:

ffmpeg.exe -r 30 -i result.h264 recovered.mp4

Later on you can try to mix audio part in dedicated video editor such as Adobe Premiere, Sony Vegas, or VirtualDub.

NOTE: above are only example commands, they will be different for each video format – follow instructions you receive from recover_mp4 tool!

NOTE: ffmpeg also supports fractions for frame rate parameter if your video uses NTSC ‘irregular’ value like 29.97 it is better to use 3000/1001 instead, as that is the actual correct value without common time code rounding.

DONE!

Looks too complicated? Watch the 5-minute video version instead.

Your video should be fully recovered and playable in ANY video player :)

RECOVERY COMMANDS & SWITCHES (OPTIONS)

NOTE: these commands were taken from original slydiman.me website. You can also find limited examples in the readme .txt file inside recover_mp4.zip archive! Usually, you should follow instructions from the recovery tool itself, but sometimes you may have to experiment with other options. It’s a trial & error process, really.

Example Usage: recover_mp4 good_similar.mp4 --analyze recover_mp4 raw.mp4 out_corrupted.mp4 --clean_amba [<hex> [<dec>]] recover_mp4 raw.mp4 out_corrupted.mp4 --clean_xiaoyi [<hex> [<dec>]] recover_mp4 raw.mp4 out_corrupted.mp4 --clean_dji [<hex> [<dec>]] recover_mp4 corrupted.mp4 {out_video.h264 | out_video.hevc | out_video.mov | --none} {out_audio.aac | out_audio.wav | out_audio.mp3 | out_audio.raw | --none} [options] recover_mp4 raw.mxf out.raw --mxf <hex>

NOTE: Please note that not ALL options may be / are available in last published free version!

Options: --verbose --start read from position (ignore mdat atom) --end <hex> end position (ignore mdat atom). Specify 0 for EOF --align <hex> default 1. Use --drim5 --align 10 for Samsung Gear 360. --nohdr try to extract SPS and PPS from the stream --forcehdr for GoPro 4+ --avcidrmax <hex> ignore AVC NAL units (IDR) with the size above than <hex> bytes --avcxmax <hex> ignore AVC NAL units (non IDR) with the size above than <hex> bytes --noavcidrmin --noavcxmin --nocheck simple checking --noidr do not wait first IDR --nodecaac do not decode AAC --aaclong --aacmin <hex> --pcmmin <hex> --pcmfix <hex> --audio assume audio only, do not check any video templates --prores Apple ProRes video --custom experimental --adobe experimental --sony2 experimental --novatek2 experimental --wowza2 experimental --gopro6.avc use GoPro6 AVC templates --gopro6.hvc use GoPro6 HEVC templates --gopro5 use GoPro5 templates --gopro4 use GoPro4 templates --gopro_session use GoPro Session templates --ambarella use Ambarella templates --garmin use Garmin VIRB Ultra 30 templates --xiaoyi use Xiaomi YI action camera templates --yicarcam use Xiaomi YI CarCam templates --novatek use car DVR templates based on Novatek (DV turnkey, Street Guardian, etc.) --pitta use car DVR templates based on PittaSoft --lav use Lav/ffmpeg templates --vlc use VLC templates --jvc use JVC GY-HM200 templates --mainconcept use Mainconcept templates --qt use QuickTime templates (default for MOV files) --panasonic use Panasonic DMC-G7, DMC-GX80, DMC-G85, DMC-GH4, DC-GH5, AW-HE40 templates --panasonic_hc use Panasonic HC-X1000 templates --panasonic_ag use Panasonic AG-DVX200 templates --sony use SONY A7S [Mark II], AX1E, NX5R, A6000, HDR-CX405, HDR-CX625 templates --drim use DRIMeIII templates (Samsung NX1000 camcorder) --drim5 use DRIMeV HEVC/H.265 templates (Samsung NX1/NX500 camcorder) --gear360 use Samsung gear360 --galaxy use Samsung Galaxy templates --android81 use Android 8.1 templates --iphone4 use iPhone4 templates --filmic61 use iPhone Filmic 6.1.2 templates --filmic63 use iPhone Filmic 6.3.x templates --filmic65 use iPhone Filmic 6.5.x templates --lumia use Lumia templates --eos use Canon EOS 5D Mark II, 60D, 7D, 550D templates --eos3 use Canon EOS 5D Mark III, 5DS, 7D Mark II (PCM), 100D templates --eos4 use Canon EOS 5D Mark IV templates (default align 8) --canon use Canon SX, Legria, Vixia, EOS 80D, 7D Mark II (AAC) templates --nikon use Nikon D750, D3300 templates --zcam use Z Cam --wowza use Wowza templates --vmix use vMix templates --obs use Open Broadcaster Software --blackmagic use BlackMagic templates --avermedia use AVerMedia Live Gamer Portable C875 templates --tomtom use TomTom Bandit Action Camera templates --aim use Aim SmartyCam HD templates --corvette use Corvette Performance Data Recorder templates --icat use iCatch templates --cgo3 use cgo3 templates --dji.avc use DJI.AVC Phantom (H.264) templates --dji.hvc use DJI.HVC Phantom (H.265) templates --hevc use generic HEVC/H.265 templates --ext use generic templates for any other camcorder or smartphone, etc. (default for MP4 files)

FREQUENTLY ASKED QUESTIONS (FAQ) / TROUBLESHOOTING TIPS

The following section contains various help tips, Q&As adapted from YouTube comments, to additionally explain certain steps or clarify why this method sometimes doesn’t work.

Question: I cannot run/execute recover_mp4.exe app. It just opens and closes immediatly… I’m working on Windows 10. Do you have any solution please?

Answer: You cannot execute it like an ordinary program :) Watch the video tutorial carefully, you must first run Command Prompt (terminal) and call recover_mp4.exe from a command line. Sorry, this tool does not come with a GUI (Graphical User Interface).

 

Question: I am totally stuck with Command Prompt part, how do I change my “working directory”? My bin folder address is this “C:\Users\xx\Downloads\ffp\bin”.

Answer: First, the reason why you should use root D:\ or some other letter drive (if possible, that is — if you have more than 1 disk or virtual partition on your PC) as shown in our video is because Windows might prevent you to read/write data on C:\ drive (but, if you run Command Prompt tool as Administrator, this should not be a problem). Anyway, another benefit of working in the root of the drive is because the paths will be much shorter, and tutorial simpler to follow.

When you run Windows’s Command Prompt tool for the very first time, your path will be set to:

C:\WINDOWS\system32>

You need to go back to the “root” simply by typing this (yes, it is not a mistake — you need to repeat command 2 times!):

cd.. [ENTER]
cd.. [ENTER]

literally: type letter C, then type letter D, then type 2 dots (all glued, no space!) and press [ENTER] key on your keyboard. “cd” command is a short for “change directory” in Command Prompt.

Alternatively, you can do it directly with a single command:

cd C:\ [ENTER]

This will directly bring you to your root path of C drive.

Next, you need to change your location to the one you have mentioned in your comment. Again, we will use “cd” command:

cd C:\Users\xx\Downloads\ffp\bin [ENTER]

NOTE: replace “xx” above with your actual PC user name!
So, after you execute the above command, the path in Command Prompt will look like this:

C:\Users\xx\Downloads\ffp\bin>

Now, you can use command:

dir [ENTER]

The above dir command will list your files and directories, along file sizes in bytes, and you should see all of them in the list (e.g. ffmpeg.exe, recover_mp4.exe, your good.mp4 and bad.mp4 files and so on). From there, you should follow up tutorial exactly as in the video.

If you are keeping your videos in a different drive/partition (like in our video tutorial), in order to change to another drive/partition, you don’t type “cd” in front of it, just the drive letter plus semicolon : symbol, like this:

D: [ENTER]
E: [ENTER]
F: [ENTER]

 

Question: Is it possible to use this method for repairing a video of a recorded game / screen capture from my computer or phone? Is it possible to use this method for repairing a video from some obscure/rare/unknown codec/hardware/format?

Answer: Thing is, it might work, but most probably it won’t. Read comments from some users below (or on YouTube), some users were successful! If you use/used standard mp4 audio-video codec, then your chances are pretty high. On the other hand, if you used a custom/proprietary codec for screen recording, then you might be out of luck.

It is probably possible to repair your custom video, but an expert in audio/video formats and codecs needs to analyze it manually first, to examine the inner structure of the bits/frames/etc. In case of screen recordings — because of so many variants in codecs and lack of industry standard — this may not be optimal nor easy to do. In this case, it just might be (often is) easier to re-record everything again, to save you from the repair trouble.

On the other hand, if you recorded a live-action video with hardware camera (e.g. your holiday shenanigans), which are non-repeatable in nature, it is often worth the trouble of restoration procedure. Be aware/keep in mind that custom video repairs may cost you a lot of $$$!

 

Question: Is it possible to repair a video without a reference?

Answer: No, you must provide a good reference file for this repair method.

 

Question: Can I send you my broken video to you for repair?

Answer: No. We are not a professional video repair service! We wrote this article in good will, with the best of hope that it will help someone out there in the similar situation. We neither create/develop video repair software tools, nor provide repair service for free or otherwise.

 

Question: After successful analysis step of good.mp4 reference video, I received an error messages in second and third step about file being impossible to repair because it is filled with zeros. What can I do?

Answer: Unfortunately, this file is, indeed, non-repairable because there is NOTHING to repair! If you open your bad.mp4 video file with a HEX Editor (low-level file utility that reads all files in their true binary formats), you will see that except maybe the header, entire file is filled with 0 bytes. This means that either there was a storage recovery error, copy-paste error, and that the actual file content is permanently lost on the storage medium. Your only hope, if the file was previously accidentally deleted, is to use another scan and recovery tool, that might recover it properly.

Otherwise, it is lost.

 

Question: Can’t find a bin folder after extracting ffmpeg! Did they remove it? Also, how do I extract tar.bz2 file?

Answer: Please make sure you selected Windows ffmpeg versions (you most likely downloaded a Linux one). It is still there, it would not make sense to remove binary exe. Recovery MP4 tool runs in Windows environment only. Also, all Windows versions come in standard .zip archive format which can be automatically extracted without any additional software. If you have a different file extension, then you most probably have the wrong operating system ffmpeg version. Check back article instructions above for current ffmpeg download links.

 

Question: In ffmpeg step I receive an error about result.h264 or result.aac – what can I do?

Answer: Can you play the result.h264 and/or result.aac file(s) in some video (audio) player from recovery step (command)? At this stage, the results must be already playable, at least on desktop/laptop computer with some universal media/stream player like VLC or MPC-HC. If they are playable, then you can try to combine them together in some video editor like Adobe Premiere, Sony Vegas etc. If not, then the recovery tool probably didn’t do the recovery task properly, messed something up and ffmpeg cannot mux (combine) them. Newer version of recovery tool, which is not publicly available (read further below), could help in that case, but it may also indicate that the format is not supported for recovery or that video became fragmented and lost important pieces.

 

Question: It worked! I have my video back! But I can’t get audio for some reason. Any suggestions?

Answer: Audio can be tricky to recover in some cases. Check above available switches (–options) and .txt readme file inside recover_mp4.zip archive to see all available commands and experiment with them.

 

Question: I received an error / warning during 2nd command (ffmpeg mux stage) about .h264 (video) and .aac (audio) parts:

[h264 @ 0000xxxx] Stream #0: not enough frames to estimate rate; consider increasing probesize | Duration: N/A | Bitrate: N/A

[aac @ 0000xxxx] Number of scalefactor bands in group (50) exceeds limit (49)

Answer: If you watched video tutorial till the end at 4:50, I received exactly the same notice regarding framerate, but the result (fixed file) was perfectly playable! In fact, result.h264 was playable already, too, as shown in the video. Ignore that error / warning and go through the end. Later, you may use MediaInfo tool to check meta data. If it refuses to play in hardware-based players (stand-alone equipment), you may need to re-encode again with some video editor.

About header and audio related errors, try to play that result.aac file in some audio player (Winamp, Foobar, MPC-HC, VLC), if you get the audio — great! You can then convert it to WAV (PCM) uncompressed format, and simply mix your audio/video later in some video editor (OpenShot, Sony Vegas, Adobe Premiere etc).

Also, try to fix it with some custom switches (options) during recovery command stage, as it may help to use pre-defined templates for specific formats (dji, gopro, panasonic, sony, apple, samsung etc.).

If not, then I am really out of ideas, only option is to try with some other video recovery app or service.

 

ALL GOOD THINGS…

(March 2018) It is not clear at this moment whether recover_mp4 tool will remain free of charge, or turn into a fully commercial web-based repair service. There are several indicators pointing into that direction:

  • version 1.x of the tool received infrequent updates in the past year (versions 1.8.x, 1.9.x)
  • version 2.x of the tool was at first available at individual requests, presumably after making a donation to the author
  • later, author started own web-based repair service powered by version 2.x, claiming greater support for some formats such as GoPro
  • web service was completely automated and free and did not require any registration at first
  • web service is now behind a login/registration wall, so the next logical step will be a fee for repairs

Of course, this is all fine and completely understandable, author was kind enough to provide excellent tool for few years completely free, but at this moment it is still not clear what will happen to the free version of the tool (it is still available for download). Older version still supports many, many hardware devices, despite slower update cycle, but newer ones might not be so lucky, if they use updated codec formats and custom optimizations.

Web-based services have some disadvantages for users, one being privacy concerns, the other being bandwidth and time requirements (it is much slower than working with local files on your PC). On the other hand, running a web-based video repair service is a very costly thing, you need to pay for a bandwidth and fast server with lots of raw CPU power. Remains to be seen…

You have been warned in case this tutorial becomes no longer current :)

THE END

(May 2018) The free recover_mp4 video repair tool is no longer available for download on author’s personal website. It is now officially replaced by the commercial web based service (as we’ve wrote above few months ago).

(November 2018) Project’s website seems to be offline.

(March 2019) Project’s website is back online with free tool again available for download. Of course, without updates. According to original page, author currently uses version 3.0, which supports even more newer formats (e.g. ProRes) and comes with other improvements.

Comments


  1. comments

    58 Comments

    Add Your Comment
  2. 1. Gopalakrishnan

    sir, it throws error message
    “the ffmpeg is not compatible”

    please tell me how to get ffmpeg for windows 7

  3. 2. TehnoBlog (In reply to Gopalakrishnan)

    Hi, you can go to ffmpeg download archive and try some older builds. Check available links and versions in the article.

  4. 3. Gopalakrishnan

    it throws a error message that cannot
    open file good.mp4

  5. 4. TehnoBlog (In reply to Gopalakrishnan)

    Hi, please check my replies in YouTube video comments section, it may help you resolve your issue. But, keep in mind that this repair tool does not support all video codecs (“formats”).

  6. 5. Cfboy

    Sir i cannot have a reference video because i used my laptop to record the video using manycam. I tried your alot of video repair and steps but it doesnt work. But the mp4 file itself has a size of 47mb but it wont play

  7. 6. TehnoBlog (In reply to Cfboy)

    Hi, I don’t understand why not repeat another recording with ManyCam (using exactly the same recording settings like resolution, frame rate, compression bit rate and codec) ?

    Reference video is required, without it, it’s impossible to repair a video without a lot of guess work, and this tool does not work like that, I’m afraid.

    Also, see my other replies when it comes to recovering a desktop PC recording session, it may be very hard to do with hardware-oriented repair tools, like this one.

  8. 7. Guest

    Wauw Thanks Mate(‘s)

    People like you make computerlife beautifull.

    Thanks again.

  9. 8. TehnoBlog (In reply to Guest)

    You’re welcome :)

  10. 9. Arch

    I’d like to mention that IF files are corrupt after undelete or file recovery, corrupt files may be simply recovered improperly:

    Many MP4 videos are shot on mobile devices like phones, cameras, action cams and dash cams. Files are typically stored on FAT32 or exFAT formatted memory cards.

    Video files on memory cards easily become fragmented. If a file is deleted or the card is formatted all structures on FAT32 and exFAT that store clusters allocated to a file are ‘reset’. This means undelete, file recovery and video recovery software assume files are stored contiguous. They do not take fragmentation into account.

    Thus recovered files will be corrupt simply because they miss data or have data from different files mixed in. Missing data can not be guessed by video repair software.

    So, solution is to use recovery software that does take fragmentation into account and that tries to reconstruct fragmented files correctly using data available on the memory card.

    If you ever find yourself in this situation you may want to give JPEG Recovery LAB a try. Despite it’s name suggesting it only recovers JPEG, it also supports reconstruction of fragmented MP4, MOV, AVI and MPEG-2 video files.

    Can be found here: disktuna.com/jpeg-recovery-lab-digital-photo-recovery/

  11. 10. TehnoBlog (In reply to Arch)

    Hi Arch, yes, this is already mentioned under “IMPORTANT NOTE” section in the article, and thanks for the detailed explanation.

  12. 11. TehnoBlog (In reply to Arch)

    TL;DR:

    I do not recommend above mentioned tool for general video restoration process at all. It is too slow and unreliable, to be my GOTO tool as a general or first-choice recommendation. However, there are other tools, one also offered by above company (free, but no longer maintained), that might be useful. Read full explanation below. It is awesome for JPEG and small files recovery, sure – as it’s name suggests, but I would avoid it for video files, despite its author claims.

    FULL REPLY

    After several years I finally found time and motivation (need) to test DiskTuna JPEG Recovery LAB tool against few common “file undelete” tools such as Recuva, PC Tools File Recovery (no longer available / abandoned) and similar free tool also offered by a company you mentioned: DiskTuna DFR *

    * DiskTuna DFR free tool is no longer maintained. I found it is extremely unreliable and buggy in general: it does not support exFAT file system (OK, that is expected, but it makes it unusable for modern large capacity memory cards), and it didn’t work for my older FAT32 SD Card from digital camera under Windows 10, either!

    I performed one test in 2019 (64 GB TF Card from android phone), and a second one in 2020 (32 GB SD Card from digital camera), maybe if I sort results and observations / findings in a meaningful table, I’ll post that as a separate entry.

    Anyway, I used 2 tests with 2 SD Cards (32 and 64 GB in size, both FAT32 formatted), and to summarize it simply: “ordinary” tools such as Recuva managed to recover most of the freshly or not-so-fresh deleted video files from the cards in comparison to all others. PC Tools found much less, and all recovered files with either tool were of MP4 type and unplayable without recover_mp4.exe repair stage afterwards! There are other peculiarities and weird observations, but I will spare you the details here… JPEG Recovery LAB, by contrast, found least number of videos – contiguous ones were playable and usable (no recover_mp4.exe intervention was required), but non-contiguous ones were just rubbish! I also contacted the author, and exchanged few emails about this “issues”.

    JPEG Recovery LAB is a truly excellent tool for recovering photos and smaller documents from the memory card medium, as it found largest number of JPEG files, sorted by contiguous and non-contiguous positions on the medium. Of course, it comes with a free evaluation, so there is no harm in trying it, and you should definitely have it in your arsenal of file recovery toolkit, but you should be aware of its limitation, nevertheless.

    One disclaimer: I haven’t checked ALL OF RECOVERED PHOTOS against size and duplicates, but from what I did – they were all apparently unique images. Still, just by comparison of the absolute numbers of found files reported in the end of each tool’s repair scan procedure, this one was the winner. For concrete example with figures, JPEG Recovery LAB found 5165 photos (!), Recuva 947 images, and PC Tools around 2000 (however, in this last case many files were black frames, corrupted and unusable! – understandably, since PC Tools is no longer maintained for several years, at least).

    Now, there was another stage analyzing non-contiguous space called “image carving” and beyond iteration 3 I just couldn’t wait any longer, as this is painfully slow procedure. Why? All 17 JPEG images found this way were either black frames or unusable bunch of pixels.

    Bottom line, video files in general are better restored using Recuva or similar tools that scan “TOC” tables and file references, which are deleted / emptied when the files get “deleted” by device or OS (instead of actual deletion, which would take forever, or at least, same amount of time as to write a file of that length, only the references to those files and their location on the medium / drive are deleted). However, later you will most likely end up with bunch of unplayable MP4 videos, so another repair stage with recover_mp4.exe or similar tool will be required.

  13. 12. Arch

    WOW! How did I miss that?!? Sorry about that.

  14. 13. TehnoBlog (In reply to Arch)

    No problem, it’s a very long article and your explanation gives further information about fragmentation and potential recovery / fix ;)

  15. 14. Nick Boulevard

    Great tutorial. Actually this saved my life from losing a very important video I shot for my friend. Thanks a million!!

  16. 15. Livnat (In reply to Nick Boulevard)

    thanx it’s just working

  17. 16. bugr

    Thanks, my 9.6GB video file is recovered. As the stupid new battery died after 10 minutes I was sure I have lost all the data. Thanks once more!!

  18. 17. Massalha Shady

    I could recover a MOV file not MP4 and the whole process was easy.
    I could watch the H264 result using VLC, with some modification to VLC settings (google for: watch h264 on VLC).
    As you mention the problem is with the undelete app that dont restore the file itself, but restore mixed parts, the solution is a lot of Cut & reJoin parts until you get the final result.

    Thank you guys.

  19. 18. Dima

    Anybody can help with restoring avi file from Camtasia Recorder 9? I have reference video, but still can’t restore any ways I tried.

  20. 19. TehnoBlog (In reply to Dima)

    I haven’t used it since long time ago, but if I remember right, it uses (or used) some highly optimized custom video codec.

    You may try your luck with VirtualDub, but before opening the AVI file, tick the box “Ask for extended options after this dialog“, then tick the box to re-derive key frames. This might save the video part, at least, but no guarantees.

    There are newer forked versions of VirtualDub (called VirtualDub2, superseded older/rebranded VirtualDub FilterMod), and the Options menu is different, shown as a separate button in the Open File dialog window. Not sure if this can really help you, though, but you can try.

    Another tool you can try is VLC Player, it can fix missing headers on-the-fly in some cases with AVI files.

    Also, you may try with Camtasia support, maybe they can give you some recovery tips in case of computer crash etc.

  21. 20. Olof

    Did you use the same method as is described above, with the same programs? I’m in a similar situation and want to try out this method.

  22. 21. TehnoBlog (In reply to Olof)

    Sorry, I don’t understand your question. Please elaborate. Yes, I have used them, as you can see in the video tutorial.

  23. 22. Olof

    Does this method also work with files that use .mov containers, or is it strictly .MP4? I have a .MDT file from a Panasonic camera that I need to recover.

  24. 23. TehnoBlog (In reply to Olof)

    I cannot really say upfront, especially since the tool newer versions are no longer available, but no harm to try.

    update: I can confirm that .mov files are definitely supported if the video is in MP4/H264 format (e.g QuickTime, Canon PowerShot cameras etc.)

  25. 24. Fatih S.

    This is amazing, it worked on a completely corrupted mp4 screen recording file due to unexpected system shutdown. Had to find exact resolution (was partial screen capture) and add as a good mp4 sample then it just worked. Amazing 11/10. Restored it 100%

  26. 25. Arun

    I had a corrupted video of around 2.5Gb size. but i can recover only about 1 Gb of video… Is there any way to recover complete video.Actual video length was about 19min but now i got only 7.58 min,

  27. 26. TehnoBlog (In reply to Arun)

    Probably part was lost either because it was overwritten or fragmented, depends if video was damaged (non-finalized recording) or restored from deletion. If later is the case, you can try to restore it with some other tool which can deal with fragmentation better and try again (see above comment).

  28. 27. Meloty

    I recovered one file and then all the rest comes with error, Cannot find ‘mdat’ atom in first 64mb of bad.mov FATAL ERROR….anything I’m missing.i need your help please

  29. 28. Sherif Wassef

    Many Many Thanks

  30. 29. LordHansy

    I followed the instructions and recovered a corrupted video from the spy app in my phone. thank u soo much. at the end of the day is not that complicated, just require some work and reading it carefully.

  31. 30. Mark

    HI,
    This guide worked perfectly for me where other applications had failed.
    Thank you so much for this, incredibly helpful!

  32. 31. Darek

    I was able to recover an mp4 using this, but the recovered file does not have sound.

    In CMD

    recover_mp4.exe good.mp4 --analyze

    Now run the following command to start recovering:

    recover_mp4.exe corrupted_file result.h264 result.aac --qt

    Then use ffmpeg to mux the final file:

    ffmpeg.exe -r 29.970 -i result.h264 -i result.aac -bsf:a aac_adtstoasc -c:v copy -c:a copy result.mov

    After recover_mp4.exe corrupted_file result.h264 result.aac –qt

    Then use ffmpeg to mux the final file:

    ffmpeg.exe -r 29.970 -i result.h264 -i result.aac -bsf:a aac_adtstoasc -c:v copy -c:a copy result.mov

    %100.000
    Complete!
    H264 IDR NAL unit size: Min 0x4C7A, Avg 0x12FE7, Max 0x16157
    H264 non-IDR NAL unit size: Min 0x29, Avg 0x40, Max 0x107E1
    Audio frame size: Min 0x6, Avg 0x1BE, Max 0xA86FB
    Skipped=4001,5,608,406567
    Skipped 4001 blocks: Min 0x5, Avg 0x260, Max 0x63427
    WARNING: The current max AVC NAL unit (IDR) size 0xEA3800.
    WARNING: The current max AVC NAL unit (non IDR) size 0xFFFFF.
    Try to change it adding parameter –avcidrmax 13E01 and/or –avcxmax ED7D
    Video=96.110
    ‘result.h264’ created, size 1991939250 (96.110%)
    Audio=0.236
    ‘result.aac’ created, size 4894926 (0.236%)

    No sound :(
    please help

  33. 32. TehnoBlog (In reply to Darek)

    Unfortunately, the recovery tool didn’t correctly recognize audio stream portion, I answered this already in other replies here (or in YouTube comments), this happened to me for couple of videos as well. Only option is to try other switches or contact author of recover_mp4.exe tool for help, or find some other recovery solution that will work. Keep the corrupted file somewhere safe, though.

  34. 33. Helen

    Hi… I tried to recover but then it comes with an error message:

    Cannot find ‘mdat’ atom in first 64MB of ‘1.mp4’
    FATAL ERROR: The file ‘1.mp4’ cannot be recovered. The entire file is filled by 00 byte!
    Video=0.000

    Anything I can do to fix my mp4?

  35. 34. TehnoBlog (In reply to Helen)

    Is the file 1.mp4 small in size? Does it have any meaningful size in the first place? You may have to recover it properly with some other undelete or video recovery tool first, see my other replies and suggestions.

  36. 35. Helen (In reply to TehnoBlog)

    Hi TechnoBlog…

    The file 1.mp4 size is 1GB.

    All my photos and videos been corrupted after I moved it from Phone Internal memory to Micro SDCard. When I opened the SDCard from laptop, it’s unreadable, so I tried to fix it using “chkdsk /f” command. Then my SDcard can be readable and all folders are there. Unfortunately, there is only 1 folder that still has 54GB files but all is corrupted and the other folders just shown empty.

    But when I opened the SDCard from my Android phone, all the files was shown in each folders although all the files can’t be opened because it is corrupted.

    Do you know any other way to fix it?

    Thank you

  37. 36. TehnoBlog (In reply to Helen)

    Ouch!

    Well, I don’t know what happened there, really. Hopefully, data on your phone is not encrypted by any chance? And, that chkdsk command was really not a smart move, because if the sd card was malfunctioning it could make things even worse. You should always verify data when doing important transfers (I know, it’s too late to act as a smart guy).

    DISCLAIMER: installing any app or adding any DATA to your Phone’s internal memory will probably overwrite some or all existing DELETED or MOVED files (photos, videos, documents etc.). Do this step at your own discretion.

    In any case, it might help to first try APP for your phone that can recover files from it’s internal memory (usually, “rooted phone” is required in such cases). My favorite app for this is DiskDigger for Android phones).

    If above fails, then you have to move on to some other options.

    • I see that you have a laptop with integrated SD card reader. For those in similar situation, if you do not have the reader built-in you will need a microSD card reader which you can get online from $0.2 and up delivered, doesn’t matter which one, as long as it works.
    • Eject SD card from your phone, put it into the card reader device.
    • Also, I will assume that your phone’s internal memory still holds the original data. More or less, to be precise. Connect the phone via USB cable to your PC (I assume you have Windows PC from your above reply, since not all software listed below runs on Mac natively). If possible, phone should be mounted as a USB Mass Storage Device, not MTP (all modern phones are using MTP, however, so you won’t have a choice). Check your phone’s documentation and see if this is possible with your phone’s internal memory and USB connection.

    Once you connected your SD Card to your computer, and also your Phone to your computer via USB cable, you can try to access them with some of the following tools:

    • Recuva
    • CardRecovery
    • JPEG-MOV-MP4 Lab
    • PicaJet
    • ZAR
    • Transcend RecoveRx
    • DiskTuna ReclaiMe [file undelete generic tool]
    • DiskTuna DFR [file undelete with smart file fragmentation detection]
    • DiskTuna JPEG-Repair [once you recover lost .jpg photos you may have corrupted ones – use this tool in that case]

    Note that not all tools will be able to “see” or access MTP phone device, because they only support USB Mass Storage protocol. Also, some tools do not support exFAT Microsoft File System, that is another variable you have to take into consideration.

    Good luck!

  38. 37. Helen

    Thank you so much for your help, TehnoBlog!

    Will try again and hopefully it will work this time. :)

  39. 38. DjZoNe

    You are awesome! Thanks for this guide!

  40. 39. Proto

    I am getting an error after everything is done. It says “dimension not set could not write header for output file #0 (incorrect codec parameters ?) : Invalid argument. What do i do now?

  41. 40. TehnoBlog (In reply to Proto)

    As already replied to others, could be a handful of things:

    • Not properly recognized codec and header format structure. Try with longer reference video during analysis stage, e.g. 10 to 60 seconds in length.
    • Not properly recognized codec / header format structure at all, because of the tool’s obsolescence; it is not updated for quite some time, as explained in more details in the article.

    In some cases, tool will generate a lot of warnings, but the end recovered.h264 or recovered.mp4 files will be actually fixed / playable! You must test them in your media player (VLC or MPC HC are recommended). I have fixed several such videos, and they were fine, despite the warnings.

    Sorry, but if you can’t fix it, including using specific switches for your device brand, then this tool cannot help you and you must seek something else.

    In order to avoid these issues and be capable to perform a recovery in the future, some new phones actually offer video recording format in their Camera App settings – e.g. High Efficiency (H.265) or High Compatibility (H.264) mode. It is wiser to choose later, because there is a higher chance this tool will recognize them in case of recovery (but, there are no guarantees, of course).

  42. 41. Iambinoj

    Writing H264 video file ‘recovered.h264’…
    Video format: AVC video 1920×1080, Main Profile, Level 4.2
    Assuming max AVC/HEVC NAL unit size (IDR) 0x3FFFFF, (non IDR) 0xFFFFF
    Used AVC templates: Ambarella (GoPro4)
    Writing audio file ‘recovered.aac’…
    Audio format: Assuming audio stream is AAC, 48000Hz, 2ch, profile 2
    Assuming min AAC chunk size 0x9E
    Searching ‘mdat’ atom in ‘bad.mp4’…
    Cannot find ‘mdat’ atom in first 64MB of ‘bad.mp4’
    FATAL ERROR: The file ‘bad.mp4’ cannot be recovered. The entire file is filled by FF byte!
    Video=0.000
    ‘recovered.h264’ created, size 58 (0.000%)
    Audio=0.000
    ‘recovered.aac’ created, size 0 (0.000%)

    I am getting this error sir! please let me know.

  43. 42. TehnoBlog (In reply to Iambinoj)

    Your file that you wish to recover seems to be empty (filled with all 0 symbols), it’s like a book with all blank pages. Try to fix that part first, with some other recovery method.

  44. 43. Jhovenell

    My audio has skips and I found this on the logs while converting

    AAC: 0x0271E9C7 [0x 23D] -> 0x 56AD5 {21 1B 54}
    AAC: 0x0271EC04 [0x F7] -> 0x 56D19 {21 1B 54}
    AAC: 0x0271ECFB [0x 22B] -> 0x 56E17 {20 96 4E}
    AAC: 0x0271EF26 [0x 22E] -> 0x 57049 {21 1B 54}
    AAC: 0x0271F154 [0x 334] !!! -> 0x 5727E {21 1B 54}
    AAC: 0x0271F488 [0x 21C] -> 0x 575B9 {21 1B 54}
    AAC: 0x0271F6A4 [0x 346] !!! -> 0x 577DC {21 1B 54}
    AAC: 0x0271F9EA [0x 218] -> 0x 57B29 {21 1B 54}
    AAC: 0x0271FC02 [0x 29A] -> 0x 57D48 {21 1B 54}
    AAC: 0x0271FE9C [0x 2F8] -> 0x 57FE9 {21 1B 54}
    AAC: 0x02720194 [0x 258] -> 0x 582E8 {21 1B 54}
    AAC: 0x027203EC [0x 128] -> 0x 58547 {21 1B 54}
    AAC: 0x02720514 [0x 208] -> 0x 58676 {21 6C 53}
    AAC: 0x0272071C [0x 21F] -> 0x 58885 {21 1B 54}
    AAC: 0x0272093B [0x 309] !!! -> 0x 58AAB {21 1B 54}
    AAC: 0x02720C44 [0x 248] -> 0x 58DBB {21 1B 54}
    AAC: 0x02720E8C [0x 362] !!! -> 0x 5900A {21 1B 54}
    AAC: 0x027211EE [0x 20D] -> 0x 59373 {21 1B 54}
    AAC: 0x027213FB [0x 289] -> 0x 59587 {21 1B 54}
    AAC: 0x02721684 [0x 336] !!! -> 0x 59817 {21 1B 54}
    AAC: 0x027219BA [0x 21A] -> 0x 59B54 {21 1B 54}
    AAC: 0x02721BD4 [0x 201] -> 0x 59D75 {21 1B 54}
    AAC: 0x02721DD5 [0x DB] -> 0x 59F7D {20 A4 2C}
    AAC: 0x02721EB0 [0x 274] -> 0x 5A05F {21 1B 54}
    AAC: 0x02722124 [0x BE] -> 0x 5A2DA {21 1B 54}
    AAC: 0x027221E2 [0x 226] -> 0x 5A39F {20 87 4C}
    AAC: 0x02722408 [0x 26C] -> 0x 5A5CC {21 1B 54}
    H264: 0x02722674 [0x 7D2BC] -> 0x 26C0417 {25 88 84 00} IDR frame
    H264: 0x0279F930 [0x 1FA20] -> 0x 273D6D3 {01 9E 39 10} P frame
    H264: 0x027BF350 [0x 160AB] -> 0x 275D0F3 {01 9E 3D 10} P frame
    H264: 0x027D53FB [0x 341EA] -> 0x 277319E {21 9A 2C 20} P frame
    H264: 0x028095E5 [0x 111EB] -> 0x 27A7388 {01 9E 45 10} P frame
    H264: 0x0281A7D0 [0x F69E] -> 0x 27B8573 {01 9E 49 10} P frame
    H264: 0x02829E6E [0x 34BDE] -> 0x 27C7C11 {21 9A 58 20} P frame
    H264: 0x0285EA4C [0x E6A0] -> 0x 27FC7EF {01 9E 71 10} P frame
    H264: 0x0286D0EC [0x E269] -> 0x 280AE8F {01 9E 75 10} P frame
    H264: 0x0287B355 [0x 36C52] -> 0x 28190F8 {21 9A 64 20} P frame
    H264: 0x028B1FA7 [0x DF4A] -> 0x 284FD4A {01 9E 9D 10} P frame
    H264: 0x028BFEF1 [0x E0F9] -> 0x 285DC94 {01 9E 81 10} P frame
    skip: 0x028CDFEA [0x 600] ??? {04 00 70 41}
    AAC: 0x028CE5EA [0x 2F0] -> 0x 5A83F {21 1B 54}
    AAC: 0x028CE8DA [0x 260] -> 0x 5AB36 {21 1B 54}
    AAC: 0x028CEB3A [0x 2E1] -> 0x 5AD9D {21 1B 54}
    AAC: 0x028CEE1B [0x 26F] -> 0x 5B085 {21 1B 54}
    AAC: 0x028CF08A [0x FC] -> 0x 5B2FB {21 1B 54}
    AAC: 0x028CF186 [0x 1BC] -> 0x 5B3FE {20 93 3A}
    AAC: 0x028CF342 [0x 298] -> 0x 5B5C1 {20 90 0A}
    AAC: 0x028CF5DA [0x 351] !!! -> 0x 5B860 {21 1B 54}
    AAC: 0x028CF92B [0x 224] -> 0x 5BBB8 {21 1B 54}
    AAC: 0x028CFB4F [0x 218] -> 0x 5BDE3 {21 1B 54}
    AAC: 0x028CFD67 [0x 256] -> 0x 5C002 {21 1C D5}
    AAC: 0x028CFFBD [0x 19B] -> 0x 5C25F {21 29 05}
    AAC: 0x028D0158 [0x 241] -> 0x 5C401 {21 1B 54}
    AAC: 0x028D0399 [0x 25B] -> 0x 5C649 {21 1B 54}
    AAC: 0x028D05F4 [0x 27D] -> 0x 5C8AB {21 1B 54}
    AAC: 0x028D0871 [0x 395] !!! -> 0x 5CB2F {21 1B 54}
    AAC: 0x028D0C06 [0x 24D] -> 0x 5CECB {21 1B 54}
    AAC: 0x028D0E53 [0x 265] -> 0x 5D11F {21 1B 54}
    AAC: 0x028D10B8 [0x 29D] -> 0x 5D38B {21 1B 54}
    AAC: 0x028D1355 [0x 292] -> 0x 5D62F {21 1B 54}
    AAC: 0x028D15E7 [0x 28C] -> 0x 5D8C8 {21 1B 54}

  45. 44. TehnoBlog (In reply to Jhovenell)

    Sorry, audio can be tricky part to recover, and this tool is obsolete now. Newer online version (not free) might be better, but I can’t guarantee it. You can also try some other video recovery tools mentioned in comments.

  46. 45. Shah

    Hello,

    Any chances to recover corrupted video files which all the HEX Code for that files stated 00 00 00 00. Please advice. Thank you.

    Best Regards,
    Shah

  47. 46. TehnoBlog (In reply to Shah)

    No

  48. 47. Raul

    Hello! I have a 4GB file with 1h15 recording. I used the method of your video and it restored twenty three minutes of the video, the first 1GB. Does this mean that the rest of the file has no hope of recovery? Thanks for the help.

  49. 48. TehnoBlog (In reply to Raul)

    It probably means that rest of the file is not properly recognized or restored (depends what happened to it to become broken in the first place).

  50. 49. Chris

    Great tutorial! I know that you said that audio is tricky, but any thoughts on the audio “skip” that happens? I’ve trial and errored on the settings that mention audio. The only one I couldn’t use was aacmin. I didn’t know how to pass/what value to set for the hex parameter. Do you know what that one does? I am getting a similar error to jhovenell about skips and “!!!” in AAC reads. My audio file ends up shorter than my video file.

    AAC: 0x00917620 [0x 2C0] -> 0x 24837 {21 1B 54}
    AAC: 0x009178E0 [0x 309] !!! -> 0x 24AFE {21 1B 54}
    AAC: 0x00917BE9 [0x A0] -> 0x 24E0E {21 1B 54}
    AAC: 0x00917C89 [0x 1F4] -> 0x 24EB5 {21 2A CE}

  51. 50. Johnc

    I am in the middle of restoring a 17Gb file of about 1 hour. The cmd window is chugging away with numbers but it is taking ages…currently about 3 hours. How long should it take?

  52. 51. TehnoBlog (In reply to Johnc)

    As long as it takes, it will reach the end eventually.

  53. 52. Yoni

    Thanks so much. It worked on a corrupted mp4 file I had. Life saver =)

  54. 53. TehnoBlog

    Tutorial updated with latest ffmpeg download links. The old website repository no longer exists.

    Also, older ffmpeg versions from 2019 (both 32-bit and 64-bit) are now uploaded to our server for your convenience.

  55. 54. Lorin

    Orientation matters when recording your sample “good” MP4!

    For those with Sony a7 cameras — I was banging my head against the wall for awhile trying to recover a 720p 30fps video, and then realised that although the bitrate and framerate and everything else matched, the “good” MP4 I was using was recorded with a different orientation than my “bad” one — portrait vs landscape. It is important on these cameras (and perhaps many) to make sure it’s tilted the same way — and who knows, maybe portrait rotated to the left is different than portrait to the right!

    After getting that straight the video was recovered, but no audio. What finally worked to also have audio, this being a Sony camera, was:

    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

    Good luck, all, and thanks for this write-up.

  56. 55. TehnoBlog (In reply to Lorin)

    Lorin, thanks for the tip!

  57. 56. genegenegene

    It’s AWESOME methods, I can recover my movie on SD that taken by FDR-AXP35

    recover_mp4.exe good.mp4 –analyze
    recover_mp4.exe C0001_bad.MP4 result.h264 result.wav –sony –pcmfix 17760
    ffmpeg.exe -r 30000/1001 -i result.h264 -i result.wav -c:v copy -c:a copy result.mov

  58. 57. genegenegene (In reply to genegenegene)

    I failed remux video and audio on fffmpg, when I use remuxed file on premiere, that cannot played.
    So I use to timeline,video/audio file only.
    But again, audio file was not correct lipsync, progress of the timeline The audio is gradually shifted out of sync.

  59. 58. Luna Esterhuizen

    Thank you very much it worked perfectly!

Post A Comment

I have read and consent to Privacy Policy and Terms and Conditions