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

Jetson NanoでOBS StudioのStreamFXプラグインをビルドしてみた

Last updated at Posted at 2021-04-18

はじめに

以前、Jetson Nano用のOBS Studioビルドパッケージを公開しましたが、プルリク(Pull Request)をもらったので、NVMPIハードウェアエンコーダーを組み込む前にStreamFXプラグインをインストールしてみることにした。

スクリーンショット 2021-04-17 22.31.52.png

OBS StudioにStreamFXプラグインをインストールすると、さまざまなフィルターエフェクトが使用できるようになります。

Screenshot from 2021-04-18 16-05-29.png

Screenshot from 2021-04-18 23-08-20.png

StreamFXのビルドにはC++17のサポートが必要なため、GCC/G++8を使用しました。(GCC/G++9が推奨されているが、aptコマンドでインストールできるパッケージが存在しない。)

aptコマンドでインストールされるGCC/G++パッケージはバージョン7です。
GCC/G++8パッケージをインストールするためには -8を指定する必要があります。

また、aptコマンドでインストールされるcmakeコマンドはバージョンが古い(3.10.2)ため、cmakeコマンドを実行するとエラーが出ます。cmakeの最新版(3.20.1)をビルドしてインストールしました。

(参考)

StreamFX requires C++17 so GCC/G++ 9 is required.
(This poses no problem with cuda 10.2 as on Linux neither obs nor StreamFX compile cuda sources. Obs and StreamFX actually compiled with with GCC/G++ 8, however I experienced the GCC 8 'filesystem' segfault bug)

準備

1. cmakeのバージョンアップ

cmakeのconfigureコマンドでエラーが発生するので、OpenSSL development packageをインストールする。

$ sudo apt-get install libssl-dev

cmakeをビルドしてインストールする。

$ wget https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1.tar.gz
$ tar xvzf cmake-3.20.1.tar.gz
$ cd cmake-3.20.1
$ ./configure --prefix=/usr/local
$ make -j4
$ sudo make install

2. gcc/g++8のインストール

$ sudo apt install gcc-8 g++-8
$ export CC=gcc-8
$ export CXX=g++-8

OBS studioとStreamFXのビルド

OBS Studio 27.0.0-rc2、StreamFX 0.10.0b3 の場合

$ git clone --recursive https://github.com/obsproject/obs-studio.git
$ cd obs-studio/plugins
$ git submodule add 'https://github.com/Xaymar/obs-StreamFX.git' streamfx
$ cd streamfx
$ git submodule init && git submodule update
$ cd ..
$ echo "add_subdirectory(streamfx)" >> ./CMakeLists.txt
$ cd ..
$ mkdir build && cd build
$ cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_FLAGS="-fPIC" -DENABLE_PIPEWIRE=OFF -DBUILD_BROWSER=OFF ..
$ make -j4
$ sudo make install

OBS Studio Release(26.1.2)、StreamFX Release(0.9.3) の場合

$ git clone https://github.com/obsproject/obs-studio.git -b 26.1.2 --depth=1
$ cd obs-studio/plugins/
$ git clone https://github.com/Xaymar/obs-StreamFX.git streamfx -b 0.9.3 --depth=1
$ cd streamfx/
$ git submodule init && git submodule update
$ cd ..
$ echo "add_subdirectory(streamfx)" >> ./CMakeLists.txt
$ cd ..
$ mkdir build
$ cd build/
$ cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_FLAGS="-fPIC" -DBUILD_BROWSER=OFF ..
$ make -j4
$ sudo make install

途中でエラーが出るので、不要なインクルードファイルを編集する。

$ vi ../plugins/streamfx/source/obs/gs/gs-vertex.hpp
gs-vertex.hpp
#include <xmmintrin.h> →削除
  • 2022/3/20 追記

Jetson Nano JetPack 4.6.1 / OBS-Studio 27.2.0 / StreamFX 0.11.0

環境

  • Jetson Nano 4GB (A02)
  • JetPack 4.6.1 (L4T 32.7.1)
  • OBS: Application Version: 27.2.0-133-g923d42721-modified - Build Number: 1
  • StreamFX 0.11.0.10-gbf1787e5

1. cmakeのバージョンアップ

上記と同様

2. gcc/g++8のインストール

上記と同様

3. OBS studioとStreamFXのビルド

$ git clone --recursive https://github.com/obsproject/obs-studio.git
$ cd obs-studio/UI/frontend-plugins/
$ git submodule add 'https://github.com/Xaymar/obs-StreamFX.git' streamfx
$ git submodule update --init --recursive
$ echo "add_subdirectory(streamfx)" >> CMakeLists.txt
$ cd ../..
$ mkdir build && cd build
$ cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_FLAGS="-fPIC" -DENABLE_PIPEWIRE=OFF -DBUILD_BROWSER=OFF ..
$ make -j3
$ sudo make install

Screenshot from 2022-03-20 11-39-03.png

0
1
1

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
0
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?