29 Commits

Author SHA1 Message Date
Kamil Trzciński
400e036ea2 webrtc: check datachannel label for ping/pong 2025-07-04 18:07:50 +02:00
Kamil Trzciński
2d3a488437 webrtc: add ping/pong when sending a frame 2025-07-03 00:07:59 +02:00
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
Christoph Wiechert
3fe5d2106f
html: fix id_key to use device.name (#92)
* html: use const/let; add baseURL constant

* html: fix id_key [Object object]
2025-06-08 18:47:38 +02:00
Zeyu Dong
afff8b9d78
html: fix syntax problem in iceServers (#77) 2023-06-26 13:46:41 +02:00
Kamil Trzcinski
01b0e969b3 webrtc: always use iceServers instead of ice_servers 2023-06-14 00:18:56 +02:00
Kamil Trzcinski
272b16ee1c webrtc: accept iceServers: [] provided in POST /webrtc, support trickle ICE
Thanks https://github.com/ayufan/camera-streamer/pull/65
2023-06-13 20:35:48 +02:00
Kamil Trzcinski
589c5fa602 html: fix control endpoints 2023-06-12 23:46:03 +02:00
Kamil Trzcinski
7cb28d810d html: add control.html and change POST /option interface 2023-06-12 22:39:28 +02:00
Kamil Trzcinski
c88d5c9b17 Rename status.json to status 2023-04-29 10:21:52 +02:00
Kamil Trzcinski
6e89ac9663 Ensure that /snapshot is always "up-to date" 2023-04-29 10:16:04 +02:00
Kamil Trzciński
ca08adb62f Add -snapshot.height, -stream.height and -video.height 2023-02-22 17:32:46 +01:00
Stefan Dej
d143f3019e
fix: use current url to connect to server (#22)
instead of using absolute path `/webrtc`

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2022-10-30 17:16:06 +01:00
Kamil Trzcinski
cb7795ad2e Fix typo 2022-10-24 00:22:48 +02:00
MK3S+ Printer
e509c328f1 Disable usage of STUN server (it should not be needed for local) 2022-10-10 20:27:22 +02:00
Kamil Trzcinski
57fb09fbf1 Improve index.html to provide better description of all options 2022-10-03 01:25:51 +02:00
Kamil Trzcinski
5801152b03 Add /video to automatically give HLS to supported browser 2022-09-24 10:40:52 +02:00
Kamil Trzcinski
5ee0bee59f Add WebRTC support using libdatachannel
The WebRTC is exposed via `/video.html` endpoint
and enabled by default as long as h264 stream
is available.
2022-09-24 10:38:37 +02:00
Kamil Trzcinski
b4668aa320 Output all properties and options 2022-07-08 12:12:30 +02:00
Kamil Trzcinski
ab7e87d5ef Compile with _GNU_SOURCE 2022-07-08 09:41:43 +02:00
Kamil Trzcinski
62372d3d16 Fix .mkv link 2022-07-07 12:38:14 +02:00
Kamil Trzcinski
4eaa42f1ea Add Af-Trigger 2022-07-05 12:05:17 +02:00
Kamil Trzcinski
70b9a513ad Add info about res=low 2022-04-12 11:07:52 +02:00
Kamil Trzcinski
1dd4f7142d Pass params to video.h264 from video.html 2022-04-12 10:53:15 +02:00
Kamil Trzcinski
45724981ad Fix HTML 2022-04-08 14:24:51 +02:00
Kamil Trzcinski
eaf6f3d9ba Add index.html 2022-04-08 14:17:13 +02:00
Kamil Trzcinski
3240fa9336 Add ffmpeg_remuxer 2022-04-08 13:33:54 +02:00
Kamil Trzcinski
d5aa2e5f99 Improve Makefile 2022-04-07 17:28:34 +02:00
Kamil Trzcinski
2562d9881b Organize sources 2022-04-05 08:33:27 +02:00