環境
- python 2.7
- livestreamer 1.12.2
Installation
- livestreamerをインストール
pip install livestreamer
- ffmpegをインストール
alpine linuxの場合
apk add --update ffmpeg
How to take a screenshot
LiveとVODのどちらでも可能
- 1枚だけ撮る
livestreamer -l debug --yes-run-as-root --player "ffmpeg -i" --player-args "{filename} -vframes 1 snapshot.png" hlsvariant://serverIp/app/stream/playlist.m3u8 best
- -yオプションで上書き
livestreamer -l debug --yes-run-as-root --player "ffmpeg -i" --player-args "{filename} -vframes 1 snapshot.png -y" hlsvariant://serverIp/app/stream/playlist.m3u8 best
- 連続して撮る(1秒間隔で出力)
livestreamer -l debug --yes-run-as-root --player "ffmpeg -i" --player-args "{filename} -vf fps=1 out%04d.png" hlsvariant://serverIp/app/stream/playlist.m3u8 best