Using select in ffmpeg to choose frames I am trying to use the select filter to choose frames to be included in the output file, but the resulting output file actually has more frames than the input file, which is completely baffling.
Following the example in the documentation to keep every 16th frame, I am using the following command:
ffmpeg -i input.MOV -filter:v &quot;select=not(mod(n\,16))&quot; output.MOV

output.MOV has more frames than input.MOV and nothing has been removed.
Interestingly, when I use the command:
ffmpeg -i input.MOV -filter:v &quot;select=not(mod(n\,16))&quot;,showinfo output.MOV

it lists the frames that should be in the output (i.e. the ones that should be selected by the expression), but the actual output file contains more frames than that and seems to completely ignore the select filter (it seems to be the same no matter what select command I use, unless I use select=0).
Am I doing something incorrectly? I basically just want an example command that works the way I expect it to, so I can better learn how ffmpeg works.
Thanks.
Edit: select is not the only filter that ffmpeg seems to ignore when producing the output file, but if this problem is solved, the fix will probably work for other filters as well.
In your command,
-filter:v &quot;select=not(mod(n\,16))&quot;

does select only each 16th frame, as you have discovered. However, your output format is MOV, which is configured as constant frame rate. So, ffmpeg will duplicate frames if the timestamp gaps between frames from the filter output are greater than 1/fps where fps is the nominal frame rate of the stream, and drop frames if they are closer.
Add -vsync 0 to tell ffmpeg to not duplicate or drop frames.