From aaa4a5dbc6b79364d3144ac90cd7d7da28e005c9 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Thu, 14 May 2026 21:22:17 +0200 Subject: [PATCH] docs: update (#5756) --- docker/ffmpeg-rpi.Dockerfile | 4 +- docker/rpi.Dockerfile | 4 +- docs/3-publish/12-raspberry-pi-cameras.md | 6 +- docs/4-read/05-hls.md | 68 +++++++++++++++++++++-- docs/6-misc/1-compile.md | 2 +- 5 files changed, 72 insertions(+), 12 deletions(-) diff --git a/docker/ffmpeg-rpi.Dockerfile b/docker/ffmpeg-rpi.Dockerfile index fe61285e..b3666dec 100644 --- a/docker/ffmpeg-rpi.Dockerfile +++ b/docker/ffmpeg-rpi.Dockerfile @@ -8,8 +8,8 @@ ADD binaries/mediamtx_*_linux_arm64.tar.gz /linux/arm64 ################################################################# FROM --platform=linux/arm/v7 debian:bullseye-slim AS base-arm-v7 -# even though the base image is arm v7, -# Raspbian libraries and compilers provide arm v6 compatibility. +# even though the base image is armv7, +# Raspbian libraries and compilers provide armv6 compatibility. RUN apt update \ && apt install -y wget gpg \ diff --git a/docker/rpi.Dockerfile b/docker/rpi.Dockerfile index 49bd3aa7..a73bd82d 100644 --- a/docker/rpi.Dockerfile +++ b/docker/rpi.Dockerfile @@ -8,8 +8,8 @@ ADD binaries/mediamtx_*_linux_arm64.tar.gz /linux/arm64 ################################################################# FROM --platform=linux/arm/v7 debian:bullseye-slim AS base-arm-v7 -# even though the base image is arm v7, -# Raspbian libraries and compilers provide arm v6 compatibility. +# even though the base image is armv7, +# Raspbian libraries and compilers provide armv6 compatibility. RUN apt update \ && apt install -y wget gpg \ diff --git a/docs/3-publish/12-raspberry-pi-cameras.md b/docs/3-publish/12-raspberry-pi-cameras.md index 527fd429..4c9e11b4 100644 --- a/docs/3-publish/12-raspberry-pi-cameras.md +++ b/docs/3-publish/12-raspberry-pi-cameras.md @@ -40,7 +40,11 @@ The setup procedure depends on whether you want to run the server outside or ins The Raspberry Pi Camera can be controlled through a wide range of parameters, that are listed in the [configuration file](../5-references/1-configuration-file.md). -Be aware that cameras that require a custom `libcamera` (like some ArduCam products) are not compatible with precompiled binaries and Docker images of _MediaMTX_, since these come with a bundled `libcamera`. If you want to use a custom one, you need to [compile from source](../6-misc/1-compile.md#custom-libcamera). +## Custom libcamera + +Some cameras, in particular ArduCam products, require a custom `libcamera`. These are not compatible with precompiled _MediaMTX_ binaries and Docker images, since they embed a standard `libcamera`. + +If you want to interact with these cameras, you need to [compile MediaMTX from source](../6-misc/1-compile.md#custom-libcamera). ## Adding audio diff --git a/docs/4-read/05-hls.md b/docs/4-read/05-hls.md index 3da37c50..3a753096 100644 --- a/docs/4-read/05-hls.md +++ b/docs/4-read/05-hls.md @@ -20,12 +20,68 @@ http://localhost:8888/mystream/index.m3u8 Some clients that can read with HLS are [FFmpeg](06-ffmpeg.md), [GStreamer](07-gstreamer.md), [VLC](08-vlc.md) and [web browsers](13-web-browsers.md). -HLS content can be generated in several variants: +_MediaMTX_ supports generating HLS in several variants (including Low-Latency mode), and provides various parameters to tune HLS generation. These are listed in the [configuration file](../5-references/1-configuration-file.md): -- MPEG-TS: uses MPEG-TS segments, for maximum compatibility. -- fMP4: uses fragmented MP4 segments, more efficient. -- Low-Latency: based on blocking requests that are unlocked as soon as content is available. - -All HLS pameters are listed in the [configuration file](../5-references/1-configuration-file.md). +```yml +# Allow clients to read streams with the HLS protocol. +hls: true +# Address of the HLS listener. +hlsAddress: :8888 +# Enable HTTPS on the HLS server. +# This is required for Low-Latency HLS to function correctly on Apple devices. +hlsEncryption: false +# Path to the server key. This is needed only when encryption is yes. +# This can be generated with: +# openssl genrsa -out server.key 2048 +# openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650 +hlsServerKey: server.key +# Path to the server certificate. +hlsServerCert: server.crt +# Allowed CORS origins. +# Supports wildcards: ['http://*.example.com'] +hlsAllowOrigins: ["*"] +# IPs or CIDRs of proxies placed before the HLS server. +# If the server receives a request from one of these entries, IP in logs +# will be taken from the X-Forwarded-For header. +hlsTrustedProxies: [] +# By default, HLS is generated only when requested by a user. +# This option allows to generate it always, avoiding the delay between request and generation. +hlsAlwaysRemux: false +# Variant of the HLS protocol to use. Available options are: +# * mpegts - uses MPEG-TS segments, for maximum compatibility. +# * fmp4 - uses fragmented MP4 segments, more efficient. +# * lowLatency - uses Low-Latency HLS. +hlsVariant: lowLatency +# Number of HLS segments to keep on the server. +# Segments allow to seek through the stream. +# Their number doesn't influence latency. +hlsSegmentCount: 7 +# Minimum duration of each segment. +# A player usually puts 3 segments in a buffer before reproducing the stream. +# The final segment duration is also influenced by the interval between IDR frames, +# since the server changes the duration in order to include at least one IDR frame +# in each segment. +hlsSegmentDuration: 1s +# Minimum duration of each part. +# A player usually puts 3 parts in a buffer before reproducing the stream. +# Parts are used in Low-Latency HLS in place of segments. +# Part duration is influenced by the distance between video/audio samples +# and is adjusted in order to produce segments with a similar duration. +hlsPartDuration: 200ms +# Maximum size of each segment. +# This prevents RAM exhaustion. +hlsSegmentMaxSize: 50M +# Directory in which to save segments and non-low-latency playlists. +# This has two purposes: offloading RAM and creating a self-consistent directory +# that can be served by a CDN. +hlsDirectory: "" +# The muxer will be closed when there are no +# reader requests and this amount of time has passed. +hlsMuxerCloseAfter: 60s +# Secret to identify requests coming from a CDN. +# The CDN must insert this secret in every request in the +# 'Authorization: Bearer' header. +hlsCDNSecret: "" +``` HLS can also be used to [scale the server](../2-features/20-scalability.md) through a CDN. diff --git a/docs/6-misc/1-compile.md b/docs/6-misc/1-compile.md index d50c022a..81d8e875 100644 --- a/docs/6-misc/1-compile.md +++ b/docs/6-misc/1-compile.md @@ -17,7 +17,7 @@ ## Custom libcamera -If you need to use a custom or external libcamera to interact with some Raspberry Pi Camera model that requires it, additional steps are required: +If you need to use a custom or external libcamera to interact with some Raspberry Pi Camera models that require it, additional steps are required: 1. Download [mediamtx-rpicamera source code](https://github.com/bluenviron/mediamtx-rpicamera) and compile it against the external libcamera. Instructions are in the repository.