I am trying to extract "exactly 1 frame of every 10" frames of a video (i.e. extract 1 , leave 9 then repeat) for scientific purposes. The video is 105 frames, 3.5 seconds, 29.97fps (h.264, .mov, produced by Nikon D3100).
I have uploaded it here.
VLC
Below command should produce 10 frames, but it only produces 6 images. I tried different scene ratios and neither of them produce correct number of frames (not even near to correct).
vlc 1.mov --video-filter=scene --vout=dummy --scene-ratio=10 --scene-prefix=img- --scene-path=. vlc://quit
Would someone please tell me what is the problem?
FFmpeg
FFmpeg does not seem to have a command exactly for my purpose. Below command extracts 3 frames out of every second, but since the FPS is not exactly 30 (rather 2.97), that will not produce correct results for me.
In addition even FFmpeg does not give out correct number of frames with even this command. For 3.5 seconds of video I expect at most 10 frames, but what I get is 12 frames!
ffmpeg -i 1.mov -y -an -sameq -r 3 -f image2 -vcodec mjpeg %03d.jpg
How can I achieve what I want?
-sameq
doesn't do what you probably think it does, and has been removed from the current version (the real ffmpeg that is, I'm not sure if it's in the Ubuntu fake ffmpeg). Use qscale instead.