1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry Pi 4Bと時雨堂のmomo

Last updated at Posted at 2024-01-05

1. はじめに

 WebRTCを色々調査しなくてはならなくなったので、以前みたことあるサイトのライブラリを使って実験を開始することにした。

  • 使い慣れたRaspberry Pi 4Bを使う
  • OSはRaspberry Pi OSのBullseyeベースとBookwormベースを試す
    • 2023-05-03-raspios-bullseye-arm64-lite.img.xz
    • 2023-12-11-raspios-bookworm-arm64-lite.img.xz
  • カメラはUSBカメラ。Raspberry Piカメラは使わない。
  • 時雨堂のmomo(かなり前から知り合い内で話題になっている)
    https://github.com/shiguredo/momo

2. 機材

  • Raspberry Pi 4B
  • UVCカメラ: Buffalo BSW500M

3. Bullseyeの場合

OSのインストールはRaspberry Pi Imagerを使う。古いOSは公式からダウンロードしておくといい。自分で変更したOSやローカルに保存したOSは、Use customを選択してインストールできる。
絶族は単純で、UVCカメラが繋がっているだけ。
Power -- Raspberry Pi 4B -- USB Cam

3.1. ライブラリの更新と追加

まずは定番

sudo apt update
sudo apt upgrade

3.2. momoの入手と展開

64bit OSなのでarmv8を使う。

wget https://github.com/shiguredo/momo/releases/download/2023.1.0/momo-2023.1.0_raspberry-pi-os_armv8.tar.gz
tar zxvf momo-2023.1.0_raspberry-pi-os_armv8.tar.gz

3.2. momoが必要とするライブラリの追加

もっと多いかとおもったが・・・

sudo apt install -y libsdl2-dev
sudo apt install -y libxtst6

3.3 パッケージインストール前に出たエラー

のちの検証用として記載しておく

./momo: error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory
./momo: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory

3.4. 失敗したコマンド

のちの検証用として記載しておく
SDLをインストールしようとして失敗した。apt upgradeの手前で試したのが要因か?

sudo apt install -y libSDL2-2.0

3.5 テストコマンド

--log-level 1 はデバッグログを出力する。
--no-audio-device はマイクがないのでその対策
test はテスト(開発)用にHTTPサーバー立ててくれる

./momo --log-level 1 --no-audio-device test

3.6 受信テスト

Raspberry PiのIPアドレスを使って、以下のようなURLにアクセスをすると、再生用(?)画面が出てくる。

http://<IPアドレス>:8080/html/test.html

Connectすると映像が出て、Disconnectすると映像が消える。
ちなみにもう一度、Connectすると、たまに失敗して映像がでない。さらにmomoのログが大量に出ていることがある。詳細な調査が必要。
image.png

とりあえず映像が見えてので、この段階ではOKとする。

3.7 その他

解像度にFHDを指定した状態で、MJPEGのハードウェアエンコードも指定すると再生映像に黄色い帯が出てしまう。指定なしやHDの指定では出ない。

./momo --log-level 4 --no-audio-device --resolution FHD --hw-mjpeg-decoder 1 test

image.png

4. Bookwormの場合

5. 今後

まずはBookworm
その次は、もうちょっと細かいところ

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?