Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
431 views
in Technique[技术] by (71.8m points)

http live streaming - How to continuously output screenshots while also outputting hls with ffmpeg

So I have the following process of ingesting rtsp and output hls.

ffmpeg -fflags nobuffer 
 -rtsp_transport udp 
 -i rtsp://<source>/ 
 -vsync 0 
 -copyts 
 -vcodec copy 
 -movflags frag_keyframe+empty_moov 
 -an 
 -hls_flags delete_segments 
 -f segment 
 -segment_list_flags live 
 -segment_time 1 
 -segment_list_size 5 
 -segment_format mpegts 
 -segment_list streaming.m3u8 
 -segment_list_type m3u8 
 -segment_list_entry_prefix ./ 
  %d.ts 

and I want to also output screenshots from the stream at some fixed frequency. Say every second. I've tried a variety of options including

-vframes 1 -q:v 10 capture.jpeg

and its not working.

Any suggestions?

question from:https://stackoverflow.com/questions/65875347/how-to-continuously-output-screenshots-while-also-outputting-hls-with-ffmpeg

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
ffmpeg -fflags nobuffer 
 -rtsp_transport udp 
 -i rtsp://<source>/ 
 -vsync 0 
 -copyts 
 -vcodec copy 
 -movflags frag_keyframe+empty_moov 
 -an 
 -hls_flags delete_segments 
 -f segment 
 -segment_list_flags live 
 -segment_time 1 
 -segment_list_size 5 
 -segment_format mpegts 
 -segment_list streaming.m3u8 
 -segment_list_type m3u8 
 -segment_list_entry_prefix ./ 
  %d.ts 
 -q:v 10 -vf fps=1 output_%03d.jpg

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...