Ask Your Question
3

How can I use fluent ffmpeg to capture an image from a stream and then store it within a stream?

asked 2023-01-19 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-01-26 14:00:00 +0000

djk gravatar image

To capture an image from a stream and store it within the same stream using fluent ffmpeg, you can use the split filter to create two outputs, one for the video stream and another for the image stream.

Here's an example command:

ffmpeg -i input.mp4 -filter_complex "[0:v]split[v][i];[i]thumbnail=10,setpts=N/TB/10[vout];[v][vout]concat=n=2:v=1[a]" -map "[a]" -f flv rtmp://localhost/live/stream

In this command, the split filter creates two outputs, labeled v and i, for the video and image streams, respectively. The thumbnail filter is used to capture an image every 10 seconds (N is the frame number and TB is the time base), which is then output to vout. The concat filter is used to concatenate the original video stream with the image stream, creating a single output labeled a.

Finally, the -map option selects the a output and the -f option specifies the output format (in this case, FLV) and destination (in this case, an RTMP server).

With this command, both the video and image streams are stored within the same output stream, allowing you to capture images from a live stream and view them alongside the video.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-19 11:00:00 +0000

Seen: 8 times

Last updated: Jan 26 '22