From 57fb09fbf1b37aa740e406dae69649e02026b0c8 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 3 Oct 2022 01:09:13 +0200 Subject: [PATCH] Improve `index.html` to provide better description of all options --- cmd/camera-streamer/http.c | 8 +++--- html/index.html | 49 ++++++++++++++++++-------------- html/{video.html => webrtc.html} | 9 +++--- 3 files changed, 37 insertions(+), 29 deletions(-) rename html/{video.html => webrtc.html} (94%) diff --git a/cmd/camera-streamer/http.c b/cmd/camera-streamer/http.c index 83452a0..65d8104 100644 --- a/cmd/camera-streamer/http.c +++ b/cmd/camera-streamer/http.c @@ -9,8 +9,8 @@ extern unsigned char html_index_html[]; extern unsigned int html_index_html_len; -extern unsigned char html_video_html[]; -extern unsigned int html_video_html_len; +extern unsigned char html_webrtc_html[]; +extern unsigned int html_webrtc_html_len; extern camera_t *camera; void *camera_http_set_option(http_worker_t *worker, FILE *stream, const char *key, const char *value, void *headersp) @@ -77,12 +77,12 @@ http_method_t http_methods[] = { { "GET", "/?action=snapshot", http_snapshot }, { "GET", "/?action=stream", http_stream }, { "GET", "/video", http_detect_video }, - { "GET", "/video.html", http_content, "text/html", html_video_html, 0, &html_video_html_len }, { "GET", "/video.m3u8", http_m3u8_video }, { "GET", "/video.h264", http_h264_video }, { "GET", "/video.mkv", http_mkv_video }, { "GET", "/video.mp4", http_mp4_video }, - { "POST", "/video", http_webrtc_offer }, + { "GET", "/webrtc", http_content, "text/html", html_webrtc_html, 0, &html_webrtc_html_len }, + { "POST", "/webrtc", http_webrtc_offer }, { "GET", "/option", camera_http_option }, { "GET", "/", http_content, "text/html", html_index_html, 0, &html_index_html_len }, { } diff --git a/html/index.html b/html/index.html index 9bc5d18..02e10c1 100644 --- a/html/index.html +++ b/html/index.html @@ -12,22 +12,46 @@
  • /snapshot
    - Get a current actual image from the server. + Get a current actual image from the server.


  • - /stream
    - Get a live stream.
    + /stream (MJPEG stream)
    + Get a live stream. Works everywhere, but consumes a ton of bandwidth.


  • +
  • + /webrtc (HTTP page / iframe)
    + Get a live video using WebRTC (low-latency streaming with latency of around 100ms).
    +
    + +
  • +
    +
  • + /video (IP Camera)
    + Get a live (H264) video stream best suited to current browser in a maximum compatibility mode choosing automatically between one of the below formats.
    +
    + +
  • +
  • The mjpg-streamer compatibility layer:

    @@ -38,23 +62,6 @@

  • -
  • - /video
    - Get a live (H264) video stream best suited to current browser in a maximum compatibility mode choosing automatically between one of the below formats.
    -
    - -
  • -
  • The commands available on some cameras:

    diff --git a/html/video.html b/html/webrtc.html similarity index 94% rename from html/video.html rename to html/webrtc.html index 229e161..c2e39bb 100644 --- a/html/video.html +++ b/html/webrtc.html @@ -42,7 +42,7 @@
    - +