🔥🔥 Fearless AV1 live streaming for Linux and Raspberry PI using the rav1e encoder and Chrome's WebCodecs library 🔥🔥
https://www.youtube.com/watch?v=ysqn2kKsvoE
Use the latest and greatest open source technology to live stream from a Raspberry PI to the Chrome browser.
-
Start Docker
docker-compose up
-
Go to
localhost:3000
Depending on your webcam, you might need to customize the framerate in the docker-compose.yaml file:
environment:
- RUST_LOG=info
- FRAMERATE=30
- VIDEO_DEVICE_INDEX=0
If you notice that the FPS is too low, just set FRAMERATE to 10
AOMedia Video 1 (AV1) is an open, royalty-free video coding format initially designed for video transmissions over the Internet. It was developed as a successor to VP9 by the Alliance for Open Media (AOMedia),
Modern web technologies provide ample ways to work with video. Media Stream API, Media Recording API, Media Source API, and WebRTC API add up to a rich tool set for recording, transferring, and playing video streams. While solving certain high-level tasks, these APIs don't let web programmers work with individual components of a video stream such as frames and unmuxed chunks of encoded video or audio. To get low-level access to these basic components, developers have been using WebAssembly to bring video and audio codecs into the browser. But given that modern browsers already ship with a variety of codecs (which are often accelerated by hardware), repackaging them as WebAssembly seems like a waste of human and computer resources.
WebCodecs API eliminates this inefficiency by giving programmers a way to use media components that are already present in the browser.
Specifically:
- Video and audio decoders
- Video and audio encoders
- Raw video frames
- Image decoders
- The WebCodecs API is useful for web applications that require full control over the way media content is processed, such as video editors, video conferencing, video streaming, etc.
- Camera recorder: nokhwa https://crates.io/crates/nokhwa
- AV1 encoder: rav1e https://crates.io/crates/rav1e
- WebSocket server: warp https://crates.io/crates/warp
- UI Framework: React https://reactjs.org/
- Web AV1 decoder: WebCodecs https://web.dev/webcodecs/
- WebSockets: react-use-websocket https://www.npmjs.com/package/react-use-websocket
Dario |
Griffin Obeid |
Give a ⭐️ if this project helped you!