ffmpeg snippets @ r2
Extract single frame as image
bash
# extract image from a video at timestamp 1:16
# use -q:v <num> for jpeg quality control
ffmpeg -i video.mp4 -ss 01:16 -frames:v 1 image.jpeg
See this Super User answer for
quality details, apparently the values of -qscale
are between 1 and 31
for jpegs. PNG is lossless so won't be affected by quality. The v
in q:v
refers to the video stream. From the man page:
Use fixed quality scale (VBR). The meaning of q/qscale is codec-dependent. If qscale is used without a stream_specifier then it applies only to the video stream, this is to maintain compatibility with previous behavior and as specifying the same codec specific value to 2 different codecs that is audio and video generally is not what is intended when no stream_specifier is used.