使用 FFmpeg 从受保护的 m3u8 直播流中获取屏幕截图
Getting a screenshot from a protected m3u8 live stream using FFmpeg
我正在尝试截取当地付费收费站的屏幕截图,以便使用图像识别来了解它的拥堵程度。每次来自 AWS Lambda 的命令为 运行 时,我都尝试使用 ffmpeg 提取屏幕截图。我的问题是我无法从 m3u8 文件中提取任何类型的图像。
http://roads.mk/315/video-kameri
当我打开其中一个摄像头时,直播显示正常,但是当我右键单击复制地址时,我得到一个斑点 link
blob:http://roads.mk/cb301be0-3e70-4d09-af2b-3f3d44ee8f4f
幸运的是,在该站点的移动版本上,单击 link 后它会立即下载 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) 下载到本地驱动器然后尝试使用它 - 您将 运行 遇到两个问题。
- 播放列表中的 URL 现在无效,因为它们是相对于服务器的。
- 播放列表很快就过时了,因为它是实时播放的,而且服务器只保留了几个片段。
我正在尝试截取当地付费收费站的屏幕截图,以便使用图像识别来了解它的拥堵程度。每次来自 AWS Lambda 的命令为 运行 时,我都尝试使用 ffmpeg 提取屏幕截图。我的问题是我无法从 m3u8 文件中提取任何类型的图像。
http://roads.mk/315/video-kameri
当我打开其中一个摄像头时,直播显示正常,但是当我右键单击复制地址时,我得到一个斑点 link
blob:http://roads.mk/cb301be0-3e70-4d09-af2b-3f3d44ee8f4f
幸运的是,在该站点的移动版本上,单击 link 后它会立即下载 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) 下载到本地驱动器然后尝试使用它 - 您将 运行 遇到两个问题。
- 播放列表中的 URL 现在无效,因为它们是相对于服务器的。
- 播放列表很快就过时了,因为它是实时播放的,而且服务器只保留了几个片段。