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

Android上で、RTMPつかって動画ストリーミング再生(Unityでアプリつくるよ)

Last updated at Posted at 2020-01-01

概要

Androidアプリ上でRTMP動画ストリーミング再生したい。

環境

・Android8
・Unity2018.2.21f1

データの流れ

OBS→(RTMP)→VirtualBox上のCentOS→(RTMP) → Android

作成手順

  1. OBS設定
  2. RTMPサーバ作成
  3. Androidアプリ作成
  4. OBSから配信スタート

1.OBS設定

配信先をサーバのアドレスにするだけ
Youtubeとかを設定できる画面で、
ここでは、 http://192.168.1.63:1935/live
とする

2. RTMPサーバ作成

参考文献

作業内容

参考文献の★の”配信サーバの準備”を行ってください。
ただ、自分はCentOSでやったため、Makeがうまくうごきませんでした。
CentOS8でやる場合は、nginx-1.16.1をつかうとMake通りました。
MakeFileを作るときに使ったコマンドは、

./configure --add-module=../nginx-rtmp-module-master --with-http_ssl_module --with-cc-opt="-Wno-error"

となります。

3. Androidアプリ作成

アセットのUMP
https://assetstore.unity.com/detail/tools/video/ump-pro-android-ios-83283
を使うだけです。
UniversalMediaPlayerのPrefabをシーンにおくのと
投影先となるPlaneをシーンにおいて連携させます。
UniversalMediaPlayerの

  • ”OpenGL Decoding”をEnable
  • ”RTP over RTSP(TCP)”をOn

にすることをわすれずに。

設定例
image.png

4. OBSから配信スタート

OBSの配信ボタンを押して、配信開始。

感想

AVPROとかEasyMovieTexutreではRTMP無理だったので、UMPで動いてよかった

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