使用ffmpeg读取streamlink m3u8文件

2024-05-08 02:14:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用earthcam链接进行数据收集。我的实现在本地上运行得非常好,但在CentOS 7系统上为我提供了一个OpenCV: image broken error。由于ffmpeg在OpenCV的后台使用,我想直接使用ffmpeg以以下方式读取从streamlink检索到的m3u8文件

streams = streamlink.streams(stream_link)
q = list(streams.keys())[0]
stream = streams['%s' % q]
video_cap = cv2.VideoCapture(stream.url) ----> # Want to change this line to ffmpeg

我在问题中使用的一个示例链接是-Nyc_5th_Street

此外,每次循环时,我只需要m3u8文件的第一帧


Tags: 文件to数据imagestream链接系统opencv