Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg filename output format

Tags:

ffmpeg

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.

like image 251
Yuval Adam Avatar asked Dec 17 '11 12:12

Yuval Adam


People also ask

What is image2 format?

Use an Image widget to display a graphic image such as a company logo, photo, or illustration in PNG, JPEG, or GIF format.

What is ffmpeg 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.

What is Flag ffmpeg?

-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.

How do I set video duration in ffmpeg?

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[.


2 Answers

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.

like image 56
Yuval Adam Avatar answered Sep 22 '22 07:09

Yuval Adam


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"
like image 44
jqgsninimo Avatar answered Sep 19 '22 07:09

jqgsninimo