ffmpeg split avi into frames with known frame rate ffmpeg split avi into frames with known frame rate linux linux

ffmpeg split avi into frames with known frame rate


ffmpeg -i myfile.avi -r 1000 -f image2 image-%07d.png

I am not sure outputting 150k bmp files will be a good idea. Perhaps png is good enough?


Part one of your math is good, the 2 minutes and 29 seconds is about 149 seconds. With 1000 fps that makes 149000 frames. However your output filename only has 5 positions for the number where 149000 has 6 positions, so try "image-%06d.bmp".

Then there is the disk size: Do your images fit on the disk? With bmp every image uses its own size. You might try to use jpeg pictures, they compress about 10 times better.

Another idea: If ffmpeg does not find a (reasonable) frame rate, it drops to 25 or 30 frames per second. You might need to specify it. Do so for both source and target, see the man page (man ffmpeg on unix):

   To force the frame rate of the input file (valid for raw formats   only) to 1 fps and the frame rate of the output file to 24 fps:           ffmpeg -r 1 -i input.m2v -r 24 output.avi

For what it's worth: I use ffmpeg -y -i "video.mpg" -sameq "video.%04d.jpg" to split my video to pictures. The -sameq is to force the jpeg in a reasonable quality, the -y is to avoid allow overwrite questions. For you:

ffmpeg -y -r 1000 -i "myfile.avi" -sameq "image.%06d.jpg"


I think, there is a misconception here: the output of a HS video system is unlikely to have an output frame rate of 1000 fps but something rather normal as 30 (or 50/60) fps. Apart from overloading most video players with this kind of speed it would be counterproductive to show the sequence in the same speed as it was recorded. Basically: 1 sec @ 1000 fps input is something like 33 sec @ 30 fps output.

Was the duration of the scene recorded really 2:29 min (resulting in a video ~82 min at normal rate) or took it about 4.5 sec (4472 frames) which is 2:29 min in normal playback?