Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yesterday I was filming a scene with my phone but suddenly the application crashed and when I try to open the m4v generated it says that is corrupted.

I have downloaded the video files (around 36MB) on my PC and I am trying to open and repair it. Can you suggest me a way to do it?


As suggested in comments I try check what FFMPEG says me about that file with this command

ffmpeg.exe -i VID_20120425_144739.m4v -c:v copy -c:a copy out.mp4 2> log.txt

Here it is the result:

ffmpeg version N-40126-ga4b58fd Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr 26 2012 03:29:50 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 47.100 / 51. 47.100
  libavcodec     54. 15.100 / 54. 15.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.100 /  2. 72.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 003fc940] moov atom not found
VID_20120425_144739.m4v: Invalid data found when processing input

Latest two lines are displayed in red.

share|improve this question
My OS is Windows 7 but if necessary I can prepare a virtual machine with Linux-based distro. – Drake Apr 26 '12 at 12:29
@slhck Thank you for help, I did what you suggested and updated question. – Drake Apr 26 '12 at 12:42
Ah, that's what I expected. The MOOV atom is a piece of data that's needed to access the raw video streams inside the MP4/M4V container. There are plenty of "video repair" tools online, but I wouldn't trust most of them. You can certainly give them a shot though – just don't pay for anything. What looks promising is Untrunk, which seems to be coded for this exact problem (namely a missing MOOV atom). Or AtomicParsley. Good luck! – slhck Apr 26 '12 at 12:46
How do I fix a broken mp4 with AtomicParsley? – chovy Jul 8 at 1:14

It is possible to repair the broken mp4 or m4v file using Untrunc.

For this method you need:

  • another video file which isn't broken

  • a linux installation (I used Ubuntu 12.04) and basic ability to use a command line.

This is what to do:

  1. Install some pre-requisite libraries with this command:

    sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev

  2. Download the source code for Untrunc from the github repo:


  3. Unzip the source code:


  4. Go into the directory where it's been unzipped:

    cd untrunc-master

  5. Compile the source code using this command (all one line):

    g++ -o untrunc file.cpp main.cpp track.cpp atom.cpp mp4.cpp -L/usr/local/lib -lavformat -lavcodec -lavutil

    (you can try skipping this step and using the ready-provided executable, but it didn't work for me)

  6. Then you can actually fix the video. You need both the broken video and an example working video.

    Ideally the video should be from the same camera & have the same resolution (mine was but it might work without). Also if it is at least as long as the broken one (preferably roughly the same) this may help.

    Run this command in the folder where you have unzipped and compiled Untrunc but replace the /path/to/... bits with your 2 video files:

    ./untrunc /path/to/working-video.m4v /path/to/broken-video.m4v

    Then it should churn away and hopefully produce a playable file called broken-video_fixed.m4v

That's it you're done!

VLC Media Player should now be able to play the file. However it may be reporting the wrong length information (Untrunc tries to guess/work this out, but doesn't always get it right). To fix this try re-encoding the video through another program.

[Thanks to slhck's comment for the suggestion to try Untrunc.]

[Many thanks to Federico Ponchio for coding Untrunc in the first place, to solve this exact problem.]

share|improve this answer
Cool, thanks for providing the full instructions here! – slhck May 16 '13 at 16:55
This worked for me, however I had to use the most up-to-date code from Github here instead of the link provided. – Alex Jan 28 '15 at 3:49
Thanks @Alex I've updated the link. Amusingly the Readme on github is based on this answer! – sparrowt Jan 30 '15 at 8:19
Would give a windows based solution. <…; as I do not have internet access in my linux distros. – RogUE Jul 9 '15 at 1:01
Your method actually works. Thank you so much. :) – Juan Carlos Kuri Pinto Sep 6 '15 at 22:41

If someone else stumbles on this, I also tried the app sparrowt was talking about, but it didn't work for me (see some bug-reports I created in the developers repository). Maybe this was because it wasn't a mp4 file but a MOV file ...

What helped for me was this post:

They link to a program called "HD Video Repair Utility" (, which is far cheaper than Treasured ( They even pointed out, that there was an earlier version of it (version 1.5) that didn't cost anything (!

I tried repairing the file using the version 1.5 and got it partly working. After re-encoding with ffmpeg (got some errors there), I realized, that a part of the audio was gone. In the logs (gladly the Video Repair Utility has some), there was no further mentioning of audio after a given time. I'll take it as-is ...

share|improve this answer

Have you tried to open the file with VLC Player? It is usually quite good at repairing damaged files.

share|improve this answer
I think this may apply to AVI files where the index can be built into memory, but a MP4 file an error of "moov atom not found" during ffmpeg processing does not play anything in VLC. – Sun Dec 26 '14 at 7:02
VLC fails to play it as well, in my case (.mov file) – rogerdpack Jan 21 at 0:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .