【发布时间】:2018-02-22 12:33:39
【问题描述】:
我在 linux 终端中运行以下命令:
vlc http://streamx/live/....stream/playlist.m3u8 --rate=1 --video-filter=scene --vout=dummy --run-time=3 --scene-format=png --scene-ratio=24 --scene-path=/home/pi/Desktop vlc://quit
如果网址没问题,它会从流中制作一些图片。我想知道命令是否成功运行。
如果网址不正确,则写出:
[73b00508] core input error: open of 'http://streamx/live/....stream/playlist.m3u8' failed
[73b00508] core input error: Your input can't be opened
[73b00508] core input error: VLC is unable to open the MRL 'http://streamx/live/....stream/playlist.m3u8'. Check the log for details.
如果网址正确则写出:
[73b03f20] httplive stream: HTTP Live Streaming (streamx/live/....stream/playlist.m3u8)
运行命令后(例如在 python 脚本中),我如何获取 url 是否正常?
提前致谢!
【问题讨论】:
-
使用
wget之类的东西来检查您是否获得了有效的响应(即不是 500 或 404 等),并且响应编码是您在实际打开 VLC 之前想要的类型。