A WebRTC sink node for dora-rs that streams video via WebRTC with built-in signaling server. Supports multiple video sources and multiple clients per source.
sudo apt-get update
sudo apt-get install \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav
brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly
Download and install from GStreamer official website
git clone https://github.com/yourusername/dora-gst-webrtc-sink.git
cd dora-gst-webrtc-sink
cargo build --release
cd example
./run_demo.sh
example/webrtc-viewer.html in your web browserSIGNALING_PORT: WebSocket signaling server port (default: 8080)RUST_LOG: Log level (default: info)The node supports two input formats:
Legacy format (backward compatible):
imageMulti-camera format:
<video_id>/framecamera1/frame, camera2/frame, front_camera/framevideo_id creates a separate video streamAll inputs expect:
Connect to the WebSocket signaling server at:
ws://localhost:8080/<video_id>
Example URLs:
ws://localhost:8080/camera1 - First cameraws://localhost:8080/camera2 - Second cameraws://localhost:8080/default - Legacy supportnodes:
- id: camera
path: camera-node
outputs:
- image
- id: webrtc-sink
path: dora-gst-webrtc-sink
inputs:
image: camera/image
nodes:
- id: camera1
path: camera-node
outputs:
- frame
- id: camera2
path: camera-node
outputs:
- frame
- id: webrtc-sink
path: dora-gst-webrtc-sink
inputs:
camera1/frame: camera1/frame
camera2/frame: camera2/frame
The included webrtc-viewer.html provides:
┌─────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Camera Node │────▶│ dora-gst-webrtc │────▶│ Web Browser │
│ (RGB8) │ │ -sink │ │ (WebRTC) │
└─────────────┘ │ │ └─────────────┘
│ ┌─────────────┐ │
┌─────────────┐ │ │ Signaling │ │ ┌─────────────┐
│ Camera Node │────▶│ │ Server │ │────▶│ Web Browser │
│ (RGB8) │ │ └─────────────┘ │ │ (WebRTC) │
└─────────────┘ └──────────────────┘ └─────────────┘
cargo build --release
cargo test
src/main.rs - Main entry point and dora node integrationsrc/webrtc_server.rs - WebRTC server implementationsrc/peer_connection.rs - Individual peer connection managementsrc/video_source_manager.rs - Multiple video source managementsrc/signaling.rs - WebRTC signaling protocol messagesContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Ensure GStreamer plugins are properly installed:
gst-inspect-1.0 webrtcbin
create_pipeline()For questions, issues, or contributions, please use the GitHub issue tracker.