Slide 1

Slide 1 text

WHIP を試す( Galène/OBS Studio/GStreamer/ff mpeg/go2rtc ) Kenichiro Matohara(matoken) 1

Slide 2

Slide 2 text

南隅から参加(鹿児島の右下) 好きなLinuxディストリビューションはDebian お仕事募集 mailto:work@matohara.org Kenichiro Matohara(matoken) https://matoken.org 2

Slide 3

Slide 3 text

Galène のML でWHIP(WebRTC- HTTP Ingestion Protocol) を知る [Galene] OBS Studio and Galene WHIP WHIP output got merged into OBS Studio master early this morning. I tested Galène with OBS master, and it’s breathtaking. 3

Slide 4

Slide 4 text

Galène のWHIP breanch を試す とりあえず普通に使えるのを確認 $ git clone https://github.com/jech/galene $ cd galene $ git checkout whip $ CGO_ENABLED=0 go build -ldflags='-s -w' $ mv ./galene ./galene-whip $ mkdir groups $ echo '{ "op": [{"username": "admin", "password": "1234"}], "presenter": [{}] }' > groups/name.json $ ./galene-whip 4

Slide 5

Slide 5 text

OBS Studio WebRTC (WHIP) output support OBS Studio のPR のDraft にWHIP を使うplugin これをbuild するか,GitHub Actions から最新の自分の環境に合 うものをダウンロードして利用 https://github.com/Sean-Der/obs- studio/tree/john/webrtc-output-plugin https://github.com/obsproject/obs-studio/actions? query=branch%3Awebrtc-output-plugin 5

Slide 6

Slide 6 text

今回は obs-studio-flatpak-180070757-x86_64.zip を利 用,依存関係で900MB近く. $ unzip ./obs-studio-flatpak-180070757-x86_64.zip $ flatpak install ./obs-studio-flatpak-180070757.flatpak $ flatpak run com.obsproject.Studio 6

Slide 7

Slide 7 text

仮想カメラ( v4l2loopback )経由, スクリーン共有を試す 普通に使えるけど多分WHIP になっていない Galène でのWHIP の使い方がよくわからない? source みてエンドポイント探す? 7

Slide 8

Slide 8 text

8

Slide 9

Slide 9 text

source例 $ while true; do date +%S.%N; done ミリ秒時計( https://bsb.jp/time.html ) 9

Slide 10

Slide 10 text

go2rtc WHIP に対応したサーバのgo2rtc を試す AlexxIT/go2rtc: Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc. 10

Slide 11

Slide 11 text

release のbinary を利用 $ chmod u+x ./go2rtc_linux_amd64 $ ./go2rtc_linux_amd64 http://localhost:1984/ 11

Slide 12

Slide 12 text

OBS Studio から go2rtc へWHIP OBS Studio の配信URLを に して配信 go2rtc にstream は現れるが,データが来ていない? WHIP ではなくrtmp でTwitch に配信してみるとうまく行く http://localhost:1984/api/webrtc?dst=livestream 12

Slide 13

Slide 13 text

GStreamer のWHIP(未検証) GStreamer 1.22〜 gst-plugins-rs で WHIP サポート  GStreamer / gst-plugins-rs · GitLab $ cargo install cargo-c : ...requires rustc 1.65.0 or newer... $ rmadison rustc | grep -E -v "old|debug" rustc | 1.63.0+dfsg1-2 | stable | source, amd64, arm64, armel, armhf, rustc | 1.63.0+dfsg1-2 | testing | source, amd64, arm64, armel, armhf, rustc | 1.63.0+dfsg1-2 | unstable | source, amd64, arm64, armel, armhf, rustc | 1.66.0+dfsg1-1~exp1 | experimental | source, amd64, arm64, armel, armhf, #942314 - RFP: gst-plugins-rs — GStreamer plugins written in Rust - Debian Bug report logs 13

Slide 14

Slide 14 text

ffmpeg のWHIP まだ取り込まれていないPR を利用 build テストパターンを送信 $ git clone -b feature/rtc-muxer https://github.com/winlinvip/ffmpeg-webrtc.git $ cd ffmpeg-webrtc $ ./configure --enable-muxer=rtc --enable-openssl --enable-version3 \ --enable-libx264 --enable-gpl --enable-libopus $ make -j$(nproc) $ ./ffmpeg -re -f lavfi -i testsrc=s=1280x720:r=30:decimals=2 -f lavfi -i sine=f=440:b=4 \ -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -r 25 -g 50 \ -acodec libopus -ar 48000 -ac 2 \ -f rtc http://localhost:1984/api/webrtc?dst=livestream 14

Slide 15

Slide 15 text

15

Slide 16

Slide 16 text

まとめ 生煮え>< まだ検証が足りない感じGStreamer, Galene WHIP, OBS Studio は再検証するつもり まだ時期尚早だったかも? go2rtc は様々なソースを1画面で見ることが出来てWHIP 関係なく 便利 WHIP 自体はWebRTC で直に配信できて低遅延らしいので気にな る h.264+opus なのでRaspberry Pi でラジコンとかにも良さそ う? 16

Slide 17

Slide 17 text

SEE ALSO 動体検知便利そう.ホストしなくても利用可能( go2rtc を使って いる ) Frigate NVR 17

Slide 18

Slide 18 text

参考URL WebRTC配信技術 "WHIP" で遊ぶ - NTT Communications Engineers' Blog OBSとgo2rtcを使ってWebRTC (WHIP)配信をする - KILINBOX ffmpegからWebRTCのWHIPでSora Laboにつなぐ実験 18

Slide 19

Slide 19 text

奥付 発表 2023-06- 18(sun) 発表者 利用ソフトウェア ライセンス 鹿児島Linux勉強会 2023.06(オンライン開催) Kenichiro Matohara(matoken) Asciidoctor Reveal.js CC BY 4.0 19

Slide 20

Slide 20 text

No content