[FFmpeg-user] fixing videos that don't start with keyframes

Matthew Morgan lytithwyn at gmail.com
Thu Nov 10 15:57:03 CET 2011


I have some videos that were generated by a Sony Handicam.  These videos don't start with keyframes and that *really* messes with the output of programs like DeVeDe.  Is there an easy way to re-encode these files such that the first frame is forced to be a keyframe?  I tried using -force-key-frames 00:00:00 (and I also tried just 0) but that just causes ffmpeg to fail with a failed assertion.

If it helps, here's the info on one of the files:

Input #0, mpeg, from 'M2U00107.MPG':
   Duration: 00:30:19.79, start: 0.113344, bitrate: 9316 kb/s
     Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 8:9 DAR 4:3], 9100 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
     Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
At least one output file must be specified

Also, here's my ffmpeg version info in case that makes a difference:
ffmpeg version 0.7.2-4:0.7.2-1ubuntu1, Copyright (c) 2000-2011 the Libav developers  built on Oct  2 2011 15:12:32 with gcc 4.6.1


More information about the ffmpeg-user mailing list