使用FFmpeg从受保护的m3u8直播流中获取屏幕截图



我正试图从本地付费电话中获取一张屏幕截图,以便使用图像识别来了解它的拥塞程度。每次从AWS Lambda运行命令时,我都试图使用ffmpeg来提取一张屏幕快照。我的问题是,我无法从m3u8文件中提取任何类型的图像。

http://roads.mk/315/video-kameri

当我打开其中一个摄像头时,直播流显示正常,但当我右键点击复制地址时,我会得到一个斑点链接

blob:http://roads.mk/cb301be0-3e70-4d09-af2b-3f3d44ee8f4f

幸运的是,在该网站的移动版上,一旦点击链接,它就会立即下载m3u8文件。一旦使用命令放入ffmpeg

ffmpeg -i "gradsko_1.m3u8" -vf fps=1/3600 grad%04d.jpg

我收到的回复


[hls @ 000000ce3d26d700] Skip ('#EXT-X-VERSION:3')
[hls @ 000000ce3d26d700] Opening 'gradsko_1-586008.ts' for reading
[hls @ 000000ce3d26d700] Failed to open segment 586008 of playlist 0
[hls @ 000000ce3d26d700] Opening 'gradsko_1-586009.ts' for reading
[hls @ 000000ce3d26d700] Failed to open segment 586009 of playlist 0
[hls @ 000000ce3d26d700] Opening 'gradsko_1-586010.ts' for reading
[hls @ 000000ce3d26d700] Failed to open segment 586010 of playlist 0
[hls @ 000000ce3d26d700] Skip ('#EXT-X-VERSION:3')
Last message repeated 3 times
[hls @ 000000ce3d26d700] Error when loading first segment 'gradsko_1-585991.ts'
gradsko_1.m3u8: Immediate exit requested
Exiting normally, received signal 2.```
From what I could tell, the stream seems to be protected. 
Any way to get inside this? I would only need a single screenshot with no audio since the program would run once an hour/on command for a very general estimate. I'm just starting out with ffmpeg so any tips would be greatly appreciated.

这对我有效:ffmpeg -i http://streaming1.neotel.net.mk:8080/hls/romanovce_3.m3u8 -vframes 1 -q:v 2 output.jpg

仅供参考:如果你首先将播放列表(m3u8(下载到本地驱动器,然后尝试使用它,你会遇到两个问题。

  1. 播放列表中的URL现在是无效的,因为它们是相对于服务器的
  2. 播放列表很快就过时了,因为这是实时的,服务器只保留了几个片段

最新更新