Contenu connexe
Plus de あしたのオープンソース研究所 (12)
Red5
- 1. Red5
2012 年 5 月 8 日
乾 和志
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -1-
- 2. Red5 とは
• 2005 年から Paul Guregoirer 氏らによって開発
• Flash Media Server 互換のストリーミングサーバ
– RTMP に準拠
– ストリーミング配信が可能
– 共有オブジェクトを利用可能
– Flash Player 上で動作するソフトウェアからアクセスされる
– Action Script で開発
• Apache ライセンスで配布開始 (元は LGPL )
• 現在のバージョンは、 1.0 RC1
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -2-
- 3. Red5 の名前の由来
• 「スターウォーズ」から来ています。
デススターに攻撃を仕掛ける際にルーク・スカイウォー
カーが呼ばれていた機体のコールサインが "Red Five“
• デモでスターウォーズの予告編が見られる。
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -3-
- 4. Red5 の特徴
• 音声ファイル・動画ファイルのストリーミング配信が可
能
• ストリーミング映像の録画が可能
• 共有オブジェクトをサポート
• ライブ映像のリアルタイム配信が可能
• サーバ・クライアント間でのメソッド呼び出しが可能
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -4-
- 5. 具体的に何ができる?
• ライブ配信システム
– ライブ中継など
• テレビ会議システム
– 映像・ホワイトボード・チャットなど
• ペーパレス会議システム
– 資料共有など
• マルチプラットフォーム対応
– Windows 、 MacOS 、 Android ( Adobe Air を使用)、 iOS
( Adobe Air を使用)
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -5-
- 6. 動画配信方式
• ダウンロード配信
– すべてダウンロードしてから再生される。
– 特別なサーバは必要ない。 SWF に組み込む。
– SWF ロードに時間がかかる
• プログレッシブダウンロード配信
– ダウンロードしながら(バッファリングしながら)再生される
。
– 特別なサーバは必要ない。 SWF のプレーヤがロードする。
• ストリーミング(リアルタイムストリーミング)配信
– ダウンロードしながら(バッファリングは最低限度で)再生さ
れる。
– 動画の途中からでも再生可能。
– 特別なサーバが必要。
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -6-
- 8. ストリーミングサーバとは?
• Windows Media Technology
– Windows Media 、 H264 、 MPEG2 の配信
• Helix Universal Server
– RealMedia 、 Windows Media 、 QuickTime 、 MPEG4 の配信
• Flash Media Server
– Flash Video 、 H264 、 MPEG4 の配信
ブラウザのプラグインの普及率で Flash が有利か。
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -8-
- 9. Flash でのストリーミング方法
• 各種プロトコルによって配信
– RTMP
• ストリーミングプロトコル
– RTMPT
• HTTP でのトンネリング
– RTMPS
• SSL
– RTMPE ( Red5 では使えない。)
• Adobe 独自の DRM プロトコル
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 -9-
- 10. FMS と Red5 の違い
Red5 FMS
価格 無料 有料
サーバサイド Java Action Script
安定性 △ ○
クラスタリング △ ○
プロトコル △ ○
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 10 -
- 11. Red5 での開発
• クライアント・サイドは Action Script
– Adobe Flash
– Adobe Flex
– OpenLaszlo ( http://www.openlaszlo.org/)
– FlashDevelop ( http://flashdevelop.jp)
• サーバ・サイドは Java ( FMS は Action Script )
– Eclipse
– NetBeans
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 11 -
- 12. Red5 における大規模配信
• オリジン・エッジ構成 受信側
エッジ
サーバ 受信側
受信側
オリジ
エッジ
送信側 ンサー
サーバ 受信側
バ
受信側
エッジ
サーバ
受信側
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 12 -
- 13. Red5 の利用例
• ニコキャスト( http://live.nicocast.com/)
– 無料のストリーミング配信サイト
• BigBlueButton ( http://www.bigbluebutton.org/)
– オープンソースの Web 会議システム
• Open Meetings (
http://code.google.com/p/openmeetings/)
– オープンソースの Web 会議システム
– 2011 年 11 月 12 日、 Apache Incubator Project に。
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 13 -
- 14. Red5 以外の実装
• Wowza ( http://www.wowza.com)
– Adobe の元社員が開発
– 995 ドル / 台(サーバ)
• RubyIZUMI ( http://osflash.org/projects/rubyizumi)
– Ruby による実装。 2008 年で更新が止まっている模様
• kamaitachi ( http://bm11.kayac.com/project/kamaitachi/
)
– Perl による実装
• RTMPy ( http://rtmpy.org/)
– Python による実装。 2 年前から更新なし。
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 14 -
- 15. Red5 でのプログラミング (送信側
)
• 送信側
Camera camera = Camera.getCamera();
Microphone mic = Microphone.getMicrophone();
NetConnection nc = new NetConnection();
nc.connect(“rtmp://live.soba-project.com/apl”)
// ローカルでの表示
Video video = new Video(320, 240);
Video.attachCamera(camera);
// リモートへの送信
NetStream ns = new NetStream(nc);
ns.attachCamera(camera);
ns.attachAudio(mic);
ns.publish(“channel0”)
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 15 -
- 16. Red5 でのプログラミング (受信側
)
• 受信側
NetConnection nc = new NetConnection();
Nc.connect(“rtmp://live.soba-project.com/apl”);
NetStream ns = new NetStream(nc);
Video video = new Video(320, 240);
Video.attachNetStream(ns);
stream.play(“channel0”);
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 16 -
- 17. デモ
• SOBA Live のデモンストレーション
Copyright © Infoscience Corporation. All rights reserved. 06/04/12 - 17 -