Previously, there was no way to detect if WebRTC clients were still connected to the stream. This lead to the RTC streams being kept open indefinitely when clients focibly closed the stream. This can happen with Chrome, Edge, Safari, etc when the tab is closed or on mobile devices when the screen is locked or browser closed. This change adds a data channel to the stream and requires users to respond to ping requests. While sending a frame the ping might be sent to the client. If clients do not respond to these ping requests before the timeout duration the stream is closed and the client is removed from the server. This causes the client to reinitiate the connection. The timeout defaults to 30 seconds. The client needs to send `keepAlive: true` as part of webrtc request. On the received `ping` send back the `pong` over data-channel.
camera-streamer
Use
main
branch for semi-stable changes, ordevelop
for experimental changes.
There's a number of great projects doing an UVC/CSI camera streaming on SBC (like Raspberry PI's).
This is yet another camera-streamer project that is primarly focused on supporting a fully hardware accelerated streaming of MJPEG streams and H264 video streams for minimal latency.
This supports well CSI cameras that provide 10-bit Bayer packed format from sensor, by using a dedicated ISP of Raspberry PI's.
Take into account that this is a draft project, and is nowhere as complete and well supported as awesome ustreamer. This project was inspired by mentioned ustreamer.
To clone this repository be sure to use the following command:
git clone --recurse-submodules https://github.com/ayufan/camera-streamer.git
Requirements
- Debian Bullseye, with at least 5.15 kernel
- Best: Raspberry PI for hardware acceleration
Install
- Use precompiled debian package (recommended)
- Compile manually (advanced)
Configure
- Configure resolution, brightness or image quality
- See different streaming options
- See example configurations
Advanced
This section contains some advanced explanations that are not complete and might be outdated:
- High-performance mode via ISP for CSI
- High-performance mode via direct decoding for USB
- High-compatibility via
libcamera
on Raspberry PI - Performance analysis
License
GNU General Public License v3.0
References
This project uses: