事件編
Homebrewでインストールしたmplayerを試してみると、URLがhttpsで始まる時だけストリーミングに失敗する。
% mplayer https://nhks-vh.akamaihd.net/i/gogaku-stream/mp4/20-ek1-4252-775-re01.mp4/master.m3u8
MPlayer 1.4-12.0.0 (C) 2000-2019 MPlayer Team
Can't init Apple Remote.
Playing https://nhks-vh.akamaihd.net/i/gogaku-stream/mp4/20-ek1-4252-775-re01.mp4/master.m3u8.
libavformat version 58.27.102 (internal)
https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.
Failed to open https://nhks-vh.akamaihd.net/i/gogaku-stream/mp4/20-ek1-4252-775-re01.mp4/master.m3u8.
Exiting... (End of file)
ffmpegは別途インストールしてあり、そちらはhttpsも問題なく扱えている。mplayer内部にffmpegが含まれていて、そちらはSSLが無効化されているということなのかもしれない。
調べてみた感じ、ライセンスの事情がいろいろあるような空気を感じた。
よくわからないので、Homebrewに対してプルリクエストを送るのはやめておくことにする。
MPlayer: configure - 1.3.0 vs. 1.4 changes | Fossies Diffs
Source code changes report for the member file configure of the MPlayer software package between the versions 1.3.0 and 1.4
--enable-openssl-nondistributable enable OpenSSL [disable]
due to conflicting MPlayer and OpenSSL licenses, the
resulting binary may be non-distributable.
解決編
Homebrew版のmplayerを諦める
brewでインストールしていたmplayerは一旦アンインストール。
% brew uninstall mplayer
手動でmplayerをビルドしてインストールする
HomebrewのFormulaを参考に、手動でインストール。
途中、configureのところでyasmが見つからないというエラーが出たので、これはbrewでインストールした。
% wget https://mplayerhq.hu/MPlayer/releases/MPlayer-1.4.tar.xz
% tar xvzf MPlayer-1.4.tar.xz
% cd MPlayer-1.4
% ./configure --prefix=$(brew --prefix) --disable-cdparanoia --disable-x11 --enable-caca --enable-freetype --disable-libbs2b
...
Error: yasm not found, use --yasm='' if you really want to compile without
...
% brew install yasm
% ./configure --prefix=$(brew --prefix) --disable-cdparanoia --disable-x11 --enable-caca --enable-freetype --disable-libbs2b
% make
% make install
ハッピーエンド編
あらためて、再生してみた。
% mplayer https://nhks-vh.akamaihd.net/i/gogaku-stream/mp4/20-ek1-4252-775-re01.mp4/master.m3u8
こんどはうまく音が出てきた!
以上