是否可以从FMS实时流中检索帧作为图像? [英] Is it possible to retrieve frames as images out of FMS live stream?

查看:104
本文介绍了是否可以从FMS实时流中检索帧作为图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人尝试过吗?

最佳做法是什么?

推荐答案

FMS实时流正在使用 RTMP 协议:

FMS live streams are using the RTMP protocol:

ffmpeg -i rtmp://***服务器/路径* **-acodec复制-vcodec复制-y *捕获***.flv **

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

在这里,我们将整个流保存为FLV文件,这是Flash的静态电影文件格式,因此始终可以保留所有RTMP音频和视频编解码器,而无需进行转换.

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 *已捕获***.flv -s ** 开始时间 -vframes 1 -f image2 -vcodec mjpeg *已捕获***.jpg **

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://***服务器/路径* ** -r 1 -f image2 -vcodec mjpeg *已捕获***%d.jpg **

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

所有命令行均未经过测试,需要进行修复,但会给您带来良好的印象

这篇关于是否可以从FMS实时流中检索帧作为图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆