开发者

Is it possible to retrieve frames as images out of FMS live stream?

开发者 https://www.devze.com 2023-01-04 12:39 出处:网络
Has an开发者_如何学Pythonyone tried this ? What\'s the best practice for this?FMS live streams are using the RTMP protocol:

Has an开发者_如何学Pythonyone tried this ?

What's the best practice for this?


FMS live streams are using the RTMP protocol:

ffmpeg -i rtmp://***server/path* **-acodec copy -vcodec copy -y *captured***.flv**

Here, we are saving the whole stream to an FLV file, which is Flash's static movie file format and so can always preserve all RTMP audio and video codecs without conversion.

You can then extract any frames you want, e.g.

ffmpeg -i *captured***.flv -s** starttime -vframes 1 -f image2 -vcodec mjpeg *captured***.jpg**

If you are ambitious and know exactly what time offsets and intervals you want to capture in advance, you can do both steps at once, e.g. one frame every second:

ffmpeg -i rtmp://***server/path* **-r 1 -f image2 -vcodec mjpeg *captured***%d.jpg**

All commandlines have not been tested, will need fixing but give you a good impression

0

精彩评论

暂无评论...
验证码 换一张
取 消