2
3

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 3 years have passed since last update.

Raspberry Pi 4 で OBS Studio の NDI プラグイン (obs-ndi) を試してみた

Last updated at Posted at 2020-06-29

はじめに

ラズパイ (ARM デバイス) で NDI 受信ができるようになったので、OBS Studio 向け NDI プラグイン obs-ndi を試してみました。

※ obs-ndi は Windows、macOS、Linux (x86、x64) 向けのため ラズパイ (ARM デバイス) で動かすためにはコードの修正とビルドが必要でした。また、OBS Studio のヘッダーファイルの変更も必要でした。

(参考) ラズパイで NDI 受信ができるようになった
https://qiita.com/kitazaki/items/669f65774d77b2f9b82d

導入手順

1. OBS Studio のソースコードをダウンロードしてビルドとインストールを行います。

(参考) ラズパイで OBS Studio を動かす
https://qiita.com/kitazaki/items/fe037d195f497eb54427
https://qiita.com/kitazaki/items/36b9f9ba80cec12164f9

※ make と make install が終わった後からの手順

obs-ndi のビルドに必要なヘッダーファイルをコピーします。

$ cd
$ sudo cp obs-studio/UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/

obs-ndi のビルドを通すためヘッダーファイルを修正します。

/usr/include/obs/obs.h
# include "graphics/vec3.h"

/* #include "graphics/vec3.h" */
/usr/include/obs/graphics/graphics.h
EXPORT void gs_clear(uint32_t clear_flags, const struct vec4 *color,

EXPORT void gs_clear(uint32_t clear_flags, const struct vec2 *color,

2. obs-ndi のソースコードをダウンロードしてソースコードを修正します。

$ git clone https://github.com/Palakis/obs-ndi.git
$ cd obs-ndi
CMakeLists.txt
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -mtune=core2 -Ofast")
↓
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
src/obs-ndi-filter.cpp
struct vec4 background;
vec4_zero(&background);

struct vec2 background;
vec2_zero(&background);
src/preview-output.cpp
struct vec4 background;
vec4_zero(&background);

struct vec2 background;
vec2_zero(&background);

3. obs-ndi のビルドを実行します。

$ mkdir build && cd build
$ cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
$ make -j4

4. ビルドしたライブラリを OBS Studio のプラグインフォルダへコピーする。

$ sudo cp obs-ndi.so /usr/lib/obs-plugins/

※ ライブラリ (バイナリ) を github へ置いておきます。(ビルドが面倒な場合はダウンロードして OBS Studio のプラグインフォルダに保存してください)
https://github.com/kitazaki/obs-ndi_arm

動作確認

環境

  • Raspberry Pi 4
    • Raspberry Pi OS (32bit 版)
      2020-05-27-raspios-buster-armhf.zip (OS イメージファイル)
  • NDI ソース
  • JustWifiCam (iOS)
  • NDI Monitor (macOS)

NDI ソースを受信して YouTubeLive へ配信

2020-06-29-225737_1920x1080_scrot.png

NDI output を有効化して NDI Monitor (macOS) で確認

obs-ndi_output.png

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?