When using ffmpeg
to output a series of frames as images, the only format I can find documentation for is frame_%d.jpg
. The %d
identifier is replaced by the sequential frame count.
Are there other parameters I can use in the output file format? Specifically, I need the ability to add the timestamp of the specific frame.
Use an Image widget to display a graphic image such as a company logo, photo, or illustration in PNG, JPEG, or GIF format.
ffmpeg is a command-line tool that converts audio or video formats. It can also capture and encode in real-time from various hardware and software sources such as a TV capture card. ffplay is a simple media player utilizing SDL and the FFmpeg libraries.
-t specifies the duration of the clip (same format). Recent ffmpeg also has a flag to supply the end time with -to . -c copy copies the first video, audio, and subtitle bitstream from the input to the output file without re-encoding them. This won't harm the quality and make the command run within seconds.
Use the -t option to specify a time limit: `-t duration' Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[.
Turns out this behavior was not yet implemented at the time.
I implemented an initial version of %t
support on my fork of FFmpeg (https://github.com/yuvadm/FFmpeg), and am currently working on cleaning up the patch so that it can be merged upstream.
The strftime
option allows you to expand the filename with date and time information. Check the documentation of the strftime() function for the syntax.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With