title: How can I fix a damaged MP4?
body: <p>I have a video of just under an hour recorded but it appears to be damaged somehow. The file format is h264 MP4 and the file size is 2.3 GB, so I'm confident that the information is there, just that the file format is damaged. How could I approach fixing it?</p>
  
  <p>So far, I've tried a simple <code>ffmpeg</code> copy operation:</p>
  
  <pre><code>&gt;ffmpeg -i video_28_07_2015_15_16_05.mp4  -c copy out.mp4
  ffmpeg version N-73895-g323ec6b Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
    libavutil      54. 28.100 / 54. 28.100
    libavcodec     56. 50.101 / 56. 50.101
    libavformat    56. 40.101 / 56. 40.101
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 25.100 /  5. 25.100
    libavresample   2.  1.  0 /  2.  1.  0
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  2.101 /  1.  2.101
    libpostproc    53.  3.100 / 53.  3.100
  [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2a78e00] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720): unspecified pixel format
  Consider increasing the value for the 'analyzeduration' and 'probesize' options
  video_28_07_2015_15_16_05.mp4: could not find codec parameters
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_28_07_2015_15_16_05.mp4':
    Metadata:
      major_brand     : isom
      minor_version   : 0
      compatible_brands: isom3gp4
      creation_time   : 2015-07-28 14:12:50
    Duration: 00:56:43.53, bitrate: 5345 kb/s
      Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1280x720, SAR 1:1 DAR 16:9, 30 fps, 90k tbr, 90k tbn, 180k tbc (default)
      Metadata:
        creation_time   : 2015-07-28 14:12:50
        handler_name    : VideoHandle
  [mp4 @ 0x2a7b260] Codec for stream 0 does not use global headers but container format requires global headers
  Output #0, mp4, to 'out.mp4':
    Metadata:
      major_brand     : isom
      minor_version   : 0
      compatible_brands: isom3gp4
      encoder         : Lavf56.40.101
      Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), none, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 90k tbr, 90k tbn, 90k tbc (default)
      Metadata:
        creation_time   : 2015-07-28 14:12:50
        handler_name    : VideoHandle
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (copy)
  Press [q] to stop, [?] for help
  frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A    
  video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
  Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
  </code></pre>
  
  <p>I have no idea of what to try next and would appreciate suggestions and guidance.</p>