Raspberry pi上のOSMCにstreamlinkをインストールする


streamlink」をOSMC環境に入れてみた

streamlinkからVLCを起動してHDMI経由の音声出力はできたのですが、HDMI映像出力がうまくいきませんでした。このため、VLCで受信したものをrtspサーバとして出力し、そのデータをkodi側で受け取るという実装にしました。

追加したもの

再生用にVLC

$ sudo apt install vlc vlc-plugin-sdl 

pythonでpipコマンドを使うために

$ sudo apt install python-pip python-setuptools

コンパイルをするために

$ sudo apt install build-essential python-dev

エラー解決のために

下記のエラー解決のために「sudo apt install libffi-dev」

    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>

「sudo apt install libssl-dev」

    build/temp.linux-armv7l-2.7/_openssl.c:498:30: fatal error: openssl/opensslv.h: No such file or directory
     #include <openssl/opensslv.h>

で・・・これでようやくstreamlinkインストールに成功しました。

「sudo pip install streamlink」

再生に至るまで

以下のような感じで、OSMCにログインした状態でコマンドを実行して、ポート8554にてrtspのストリーミングサーバを実行します。

$ streamlink https://www.showroom-live.com/ringo-005 best --player="cvlc --sout '#rtp{sdp=rtsp://:8554/}'"

ちなみに、streamlinkのマニュアルを見ると「–player-args」というオプションで引数を渡すことができるとありましたが、「streamlink https://www.showroom-live.com/ringo-005 best –player=cvlc –player-args=”–sout ‘#rtp{sdp=rtsp://:8554/}'”」を実行すると、以下のエラーになってしまって起動できませんでした。

osmc@osmc:~$ streamlink https://www.showroom-live.com/yui-010 worst --player=cvlc --player-args="--sout '#rtp{sdp=rtsp://:8554/}'"
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
[cli][info] Found matching plugin showroom for URL https://www.showroom-live.com/yui-010
[cli][info] Available streams: 144p (worst), low, high, 1080p (best)
[cli][info] Opening stream: 144p (hls)
[cli][info] Starting player: cvlc
[cli][info] Closing currently open stream...
Traceback (most recent call last):
  File "/usr/local/bin/streamlink", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/main.py", line 1033, in main
    handle_url()
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/main.py", line 594, in handle_url
    handle_stream(plugin, streams, stream_name)
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/main.py", line 447, in handle_stream
    success = output_stream(plugin, stream)
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/main.py", line 320, in output_stream
    output.open()
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/output.py", line 24, in open
    self._open()
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/output.py", line 221, in _open
    self._open_subprocess()
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/output.py", line 242, in _open_subprocess
    args = self._create_arguments()
  File "/usr/local/lib/python2.7/dist-packages/streamlink_cli/output.py", line 203, in _create_arguments
    args = self.args.format(filename=filename)
KeyError: 'sdp=rtsp'
osmc@osmc:~$ streamlink https://www.showroom-live.com/yui-010 best --player="cvlc --sout '#rtp{sdp=rtsp://:8554/}'"
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
[cli][info] Found matching plugin showroom for URL https://www.showroom-live.com/yui-010
[cli][info] Available streams: 144p (worst), low, high, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
^CInterrupted! Exiting...
[cli][info] Closing currently open stream...
osmc@osmc:~$

続いて、拡張子が.m3uで、以下の内容をテキストエディタで作成します。

#EXTM3U
#EXTINF:-1 
rtsp://127.0.0.1:8554

このm3uファイルをkodiで開くとshowroom動画が再生されました。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください