44

I took a video from my Android phone (Sony Xperia P, if you need to know), and before I could stop recording it, the phone memory got full and the phone got hanged too. I rebooted the phone, the video was there, but I couldn't play it from any media player on Android. It's in mp4 format.

So I tried to open it on PC and Mac with different video player, like VLC, quick Time, Windows Media Player etc., but none of them can play it. I know that the video is corrupted, but I believe it's repairable, since it got more than a GB in size. Is there anything that I can try to repair the video file? The video is really important.

Giacomo1968
  • 58,727
noob
  • 1,395

3 Answers3

34

This is an old question, but I just ran into the same situation and I figured I would post the solution that worked for me.

When you see the message "moov atom not found", that typically means that whatever was creating the video was not able to write terminal metadata that contains information about things like the codecs used in the video and so forth. Without this "moov atom", most players will reject the video.

If you have another video that was generated by the same device, you can use the untrunc program to generate a new moov atom that will in most cases render the file playable.

You will need to compile the untrunc program yourself. I built it in an Ubuntu 12.04 docker container, and needed to install the following prerequisites to get it to build:

sudo apt-get install libavformat-dev libavcodec-dev \
  libavutil-dev libqt4-dev make g++ libz-dev
larsks
  • 4,493
25

If you have FFmpeg installed, from the command-line you can try:

ffmpeg -i input.mp4 -c copy output.mp4

If the problem is just with the container, this will fix it.

If that doesn't work, please post the complete terminal message, as it could give a clue as to how to fix the file.

Giacomo1968
  • 58,727
evilsoup
  • 14,056
0

I was able to get the mp4fixer program to recover a truncated video file from a drone, that was failing with the "moov atom not found" error.

This program requires Perl, as well as a working video file from the same device from which to copy the missing data.

It gave me the raw H264 data which I was able to convert back to MP4 with:

ffmpeg -i mp4fixer-out-video.h264 -c copy fixed.mp4
Giacomo1968
  • 58,727
Malvineous
  • 2,798