Joshua Piccari e4fe25fdb6 webrtc: add liveness check to WebRTC output using data channel
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.
2025-07-03 00:07:59 +02:00
2024-05-07 11:41:59 +02:00
2023-06-12 12:30:20 +02:00
2022-09-06 14:11:27 +00:00

camera-streamer

Use main branch for semi-stable changes, or develop 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

  1. Debian Bullseye, with at least 5.15 kernel
  2. Best: Raspberry PI for hardware acceleration

Install

  1. Use precompiled debian package (recommended)
  2. Compile manually (advanced)

Configure

  1. Configure resolution, brightness or image quality
  2. See different streaming options
  3. See example configurations

Advanced

This section contains some advanced explanations that are not complete and might be outdated:

  1. High-performance mode via ISP for CSI
  2. High-performance mode via direct decoding for USB
  3. High-compatibility via libcamera on Raspberry PI
  4. Performance analysis

License

GNU General Public License v3.0

References

This project uses:

Description
High-performance low-latency camera streamer for Raspberry PI's
Readme 5.7 MiB
Languages
C 61.3%
C++ 23.9%
HTML 10.6%
Shell 2.9%
Makefile 1.3%