Git Product home page Git Product logo

webrtcbroadcaster's Introduction

WebRTCBroadcaster

WebRTCでカメラ映像(H.264)を複数人に配信するソフトウェアです。Raspberry Pi 3, 4のH.264 ハードウェアエンコーダに対応。

Windows Subsystem for Linuxでのテスト映像での動作は確認済み。未確認ですがWindows, Macでもおそらく動作します。

複数人で一つのカメラ映像を低遅延で閲覧することに特化したシンプルな設計です。

機能

  • カメラデバイスから映像を配信
  • テスト映像を配信
  • HTTPで動く簡易的なWebRTCシグナリングサーバー
  • 簡易閲覧ページ
  • 認証Webhook
  • JPEGスクリーンショットを取得できるHTTP API
  • H264に限定したエンコード

認証Webhookに関しては時雨堂様のAyameを参考にしました。

一部利用しているコードに関してはライセンス表記させていただいています。この場を借りてお礼申し上げます。

WebhookのAPIフォーマットについては異なります。また開発元は異なりますので時雨堂様に問い合わせしないようにお願いします。

実行方法

 ./WebRTCBroadcaster -h
Usage of ./WebRTCBroadcaster:
  -api
        画像、動画取得APIを有効にする (default true)
  -bitrate int
        エンコードする映像ビットレート、帯域 (default 1000000) = 1Mbps
  -dummy
        カメラデバイスを使わず、ダミー映像で配信する
  -framerate float
        フレームレート (default 30)
  -height int
        カメラデバイスから取得する解像度の高さ (default 1080)
  -page
        テストで閲覧するためのWebページを表示する (default true)
  -port int
        シグナリングやテストで閲覧するためのWebページを表示するポート (default 8080)
  -webhook string
        認証WebHookのURL
  -width int
        カメラデバイスから取得する解像度の幅 (default 1920)

ダミー映像での実行例

./WebRTCBroadcaster -dummy

カメラから映像取得、認証Webhookありでの実行例

./WebRTCBroadcaster -webhook http://localhost:8888/auth

1080p 60FPS 5Mbpsで配信したい場合の実行例

./WebRTCBroadcaster -framerate 60 -bitrate 5000000

ストリーミング閲覧方法 (ポートに指定がなく、-pageがfalseと指定されていない場合)

http://localhost:8080/

画像閲覧方法 (ポートに指定がなく、-apiがfalseと指定されていない場合)

http://localhost:8080/api/photo

ビルド方法

Raspberry Piでハードウェアエンコーダを使用する場合は、本体に内臓されている mmal が必要です。

ハードウェアエンコーダが必要な場合は、Rasberry Piでビルドしてください。

Raspberry Pi

sudo apt install pkg-config

go build

./WebRTCBroadcaster

Ubuntu

sudo apt install pkg-config

sudo apt install libx264-dev

go build

./WebRTCBroadcaster

認証WebhookのAPIフォーマット

記述中です...

対応予定の機能

  • 録画HTTP API
  • カスタムできる閲覧ページのテンプレート
  • Linuxサービス化対応
  • 簡易なWeb SDK
  • 閲覧状況を確認できるダッシュボード、HTTP API
  • Rasberry Pi 3, 4のビルド済みバイナリの提供

webrtcbroadcaster's People

Contributors

chujohiroto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webrtcbroadcaster's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.