[FFmpeg-user] Creating video from every i'th picture

Moritz Barsnick barsnick at gmx.net
Thu Jul 30 11:24:23 CEST 2015


Hi Sten,

On Thu, Jul 30, 2015 at 10:41:39 +0200, anders70 wrote:
> Is there a way to tell ffmpeg to only use every i'th picture in a 
> specific list or to tell ffmpeg to only use pictures which number is a 
> multiple of "i"?

Not as a demuxer option. If you're converting/encoding anyway (i.e. not
using "-c:v copy"), you can use the select filter:

$ ffmpeg [...] -vf "select=not(mod(n\,3))" [...]
will pass every 3rd frame to the encoder.

If you need to do it at the demuxer, I recommend a little script which
creates a temporary directory (using mktemp) and (symbolically) links
the input files of interest into a continuously numbered sequence. Then
let ffmpeg operate on those links.

(I was going to add a remark about Unix vs. Windows, but I think
Windows does have symbolic links in recent versions, and PowerShell
should be able to do such scripting easily. I myself could only do it
on Unix.)

Cheers,
Moritz


More information about the ffmpeg-user mailing list