A few days ago I found a family mp4 video storing on my old pc from 2004, while wanting to watch its contents I ended up with a corrupt MP4. Cannot play it even in VLC or other video playback. So I investigated the problem and saw that there are tons of nice paid services or shareware out there to fix corrupted videos. But none convinced me and I was then convinced that there was better and therefore a solution to my problem..I first tried it with ffmpeg using the following command to make an (uncorrupted) copy of my corrupted video.

ffmpeg -i VideoCorrupted.mp4 -c copy Video.mp4

But all I got was the following error:

moov atom not found
VideoCorrupted.mp4: Invalid data found when processing input

I didn’t know this stuff, so I looked for a definition.Moov Atom contains all the information about the video file read by video players. Video encoders often automatically move metadata at the beginning of video files to make them accessible on the web.https://www.ezs3.com/public/Checking_Metadata_or_Moov_Atom_Location.cfmIt is therefore the metadata that is not present but the video itself is there. Especially since my corrupted file weighs several giga, so it was sure, there is something in this MP4. It only remained to find how to access it.And I found !!! This is a software called Untrunc which can repair corrupt MP4, M4V, MOV and 3GP. So I will tell you how to fix corrupted video file.So first of all you have to know that untrunc is software for Linux. But that it is possible to run it in a Docker, and that’s what I’m going to explain to you today so that you will have a universal solution that will work on all OS capable of running Docker.See also  Windows 11: open File Explorer on “This PC”And all in 3 small steps! Magic magic!

See also  VLC: keep player window always on top

Step 1 – Download and install Docker

Go here and download Docker for your operating system. Then install it and launch it.

6154b1d2ecd044d96ca226e4be09274644e76b2e

If you are on Ubuntu, here is the procedure:

sudo apt-get install curl apt-transport-https ca-certificates software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 

sudo apt update 

sudo apt install docker-ce 

Et pour vérifier qu'il tourne :
 
sudo systemctl status docker 

Step 2 – Download and install the image

There are several untrunc images on the Docker repository and I chose the one from synctree because it is the most downloaded.

a3f0f4c9dbd8eb246a1e5b76dbe005022909436a

So to retrieve it, in a terminal or a command prompt, do:

docker pull synctree/untrunc

Step 3 – Start the repair

You should know that to repair the file, untrunc needs 2 videos. Your corrupted video of course, but also a perfectly readable reference video, produced with the same tool, under the same conditions, in order to be able to recompose the corrupted metadata.So still in the terminal, enter the following command:

docker run -v / directory / of / videos: / files -it synctree / untrunc /files/VideoOK.mp4 /files/VideoCorrupted.mp4

Remember to replace “/ directory / of / videos” by the path to your videos. “/ Files” is a kind of alias which will then point to “/ directory / of / videos”. This is why you will be able to indicate the path of your videos using the alias like this “/files/VideoOK.mp4”. I hope to be as clear as possible.Validate and let it run! You should see a lot of things like this scrolling:

0480a048970fa5ec865471902837e42cade84c3c

It may take longer or shorter, but in the end, you will have a file like VideoCorrupted.mp4_fixed.mp4 which will be created and your video will be playable!See also  Windows 11: turn off Bing search in the Start menuIt is possible that the sound is shifted, this is something that happens quite often. In this case, remember to readjust it with your favorite video editing software.

See also  Convert MKV to MP4 using VLC Player 2023
5/5 - (2 votes)

Tagged in:

About the Author

SAKHRI Mohamed

Founder & Editor

Passionate about the web, new technologies and IT, I share on easy-tutorials.com tutorials, tips, advice, online tools and software for Windows, Mac and Linux. I'm the founder of this blog and I'm very interested in anything to do with technology, but I also love playing games. I was born in Constantine, but now I live in Algiers/Algeria

View All Articles