我想从视频流每1分钟截图。视频流提供为m3u8 file:
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:112076
#EXT-X-PROGRAM-DATE-TIME:2019-03-19T16:16:53Z
#EXTINF:6.000, 2019/03/19/16/16/53-06000.ts
#EXTINF:6.000, 2019/03/19/16/16/59-06000.ts
#EXTINF:6.000, 2019/03/19/16/17/05-06000.ts
#EXTINF:6.000, 2019/03/19/16/17/11-06000.ts
我找到了一个库来解析它-https://github.com/globocom/m3u8。但是我不明白如何将这个TS视频流转换成单个jpeg文件。 我应该这么做吗
我应该使用OpenCV还是有更简单的解决方案?在
使用OpenV
我想你可以用VLC来做。在
EDIT:看起来与https://superuser.com/questions/1379361/vlc-and-m3u8-file非常相似。以下答案可能不适用于您的文件格式(除非更高版本的VLC可以正常工作…)。或许可以看看this question,这可能会给你更多的洞察力
据我所知,VLC使用TS文件/流进行罚款
一旦有了TS文件,就应该能够使用vlc执行屏幕截图。
根据this link和to this SO question and answers,可以启动VLC并使其执行屏幕捕获。 根据VLC documentation,这似乎是可能的。在
应该在win/linux/mac上运行。在
我已经测试过了,我需要用我的个人电脑来测试。
引用:
这是ffmpeg的工作。
要每分钟从playlist捕获帧,可以使用:
以上将产生:
^{pr2}$^{3}$
等等。。。每60英寸一次
注意事项:
invest.ru_0002.jpg
正好是在invest.ru_0001.jpg
之后60〃拍摄的,正如您在右上角的时间戳中看到的。-vf
表示ffmpeg
使用视频过滤器fps=1/60
,因此它将每60〃(src)提取一帧。ffmpeg
image2 docs中的可用选项。在相关问题 更多 >
编程相关推荐