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.
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
Asked: 2023-01-19 11:00:00 +0000
Seen: 8 times
Last updated: Jan 26 '22
How can I deal with Expression.Error related to a column in Power Query?
How can you implement pagination in Oracle for the LISTAGG() function?
What is the process for implementing a FutureBuilder on an OnTap function in Flutter?
How can we require users to be logged in before they can access the root folders in WordPress?
In SCSS, what is the method for grouping and reusing a set of classes and styles?
How can popen() be used to direct streaming data to TAR?
How does iOS retrieve information from a BLE device?
How can Django Admin accommodate a variety of formats and locales for its input fields?