【问题标题】:Getting a screenshot from a protected m3u8 live stream using FFmpeg使用 FFmpeg 从受保护的 m3u8 直播流中获取屏幕截图
【发布时间】:2020-11-24 11:34:11
【问题描述】:

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

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

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

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.

【问题讨论】:

  • 用 curl 下载 ts 文件,看看具体的 http 响应是什么。

标签: amazon-web-services ffmpeg http-live-streaming m3u8


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 2018-01-15
    • 2012-04-28
    • 2014-02-01
    • 2016-05-10
    • 2014-09-16
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    • 2019-06-17
    相关资源
    最近更新 更多