使用this api我已经成功地下载了流数据,但是我不知道如何解析它。我看过RMTP格式,但似乎不匹配。在
from livestreamer import Livestreamer
livestreamer = Livestreamer()
# set to a stream that is actually online
plugin = livestreamer.resolve_url("http://twitch.tv/froggen")
streams = plugin.get_streams()
stream = streams['mobile_High']
fd = stream.open()
data = fd.read()
我上传了一个数据here的例子。在
理想情况下,我不必将其解析为视频,我只需要第一个关键帧作为图像。任何帮助将不胜感激!在
更新:好的,我用OpenCV工作,它可以抓取我的随机视频文件的第一帧。但是,当我对流数据使用相同的代码时,它产生了一个nonsense image。在
好吧,我想好了。确保写为二进制数据,OpenCV能够解码第一个视频帧。得到的图像有R和B通道切换,但这很容易纠正。下载大约300KB的文件似乎足以确保完整的图像在那里。在
相关问题 更多 >
编程相关推荐