[FFmpeg-user] output jpeg quality

Moritz Barsnick barsnick at gmx.net
Thu Jan 15 09:19:36 CET 2015


On Thu, Jan 15, 2015 at 00:05:51 -0800, Green Koopa wrote:
> When outputting frames like this, is there a way to put the frame
> number/time in the output file name? Otherwise, it looks like I have to use
> the drawtext filter to add it to the images.

Sure.

It's mentioned here:
https://www.ffmpeg.org/ffmpeg-all.html#image2-2

  The output filenames are specified by a pattern, which can be used to
  produce sequentially numbered series of files. The pattern may
  contain the string "%d" or "%0Nd", this string specifies the position
  of the characters representing a numbering in the filenames. If the
  form "%0Nd" is used, the string representing the number in each
  filename is 0-padded to N digits.

So
$ ffmpeg ... -f image2 "img-%03d.jpg"
counts from 001.

If also supports strftime() style patterns:

  For example to generate image files from the strftime()
  "%Y-%m-%d_%H-%M-%S" pattern, the following ffmpeg command can be used:
  $ ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"

Note that the time stamps are current time, not frame "time stamps"
such as PTS. also note that the frame numbers are those arriving at the
muxer, disregardless of how many frames came in at the demuxer and were
added or dropped.

HTH,
Moritz


More information about the ffmpeg-user mailing list