Skip to content

Raspberry Pi/FastAPI service for streaming HDMI video/audio over the internet using the WebRTC protocol

Notifications You must be signed in to change notification settings

MattWeinberg24/pi-stream

Repository files navigation

pi-stream

Raspberry Pi/FastAPI service for streaming HDMI video/audio over the internet using the WebRTC protocol

Utilizes https://github.com/meetecho/janus-gateway, https://github.com/catid/kvm

Requirements

  1. Raspberry Pi 4 running 32-bit Raspberry Pi OS (tested with 4 GB RAM)
  2. HDMI-to-USB Capture Card supporting MJPG capture format
  3. (If on corporate network) A STUN/TURN server (see docs/stun.md)

Setup

cd /home/pi
git clone https://github.com/MattWeinberg24/pi-stream.git
cd pi-stream
  1. edit docker-compose.yml in vim or nano to configure environment variables

Usage

  1. docker compose up
  2. Navigate to http:https://<PI IP>:<FASTAPI PORT>/static/index.html in Chrome or Edge (Firefox untested)
  3. Enter STUN/TURN information for frontend
  4. Use the API
    • Test buttons available on the above site
    • Full API documentation available at http:https://<PI IP>:<FASTAPI PORT>/docs
    • Selected topics detailed in /docs
  • Frontend debug messages can be found in the browser console
  • Backend debug messages can be found through docker's output

Ports

  • 8088
    • Janus Gateway WebRTC Server
  • 8000
    • Python FastAPI
    • HTML/Javascript served at /static/index.html on this port
    • Docs served at /docs on this port
  • 5002
    • gstreamer opus RTP audio stream
    • (Used internally)

Special Thanks

KVM (Video) Janus plugin by Chris Taylor (https://github.com/catid)

Janus Gateway server and javascript library by Meetecho (https://github.com/meetecho)

Mentors and coworkers during my summer internship

Contact: [email protected]

About

Raspberry Pi/FastAPI service for streaming HDMI video/audio over the internet using the WebRTC protocol

Topics

Resources

Stars

Watchers

Forks