diff --git a/docs/2-usage/12-extract-screenshots.md b/docs/2-usage/12-extract-screenshots.md new file mode 100644 index 00000000..50f06049 --- /dev/null +++ b/docs/2-usage/12-extract-screenshots.md @@ -0,0 +1,16 @@ +# Extract screenshots + +You can periodically extract screenshots from available streams by using FFmpeg inside the `runOnReady` hook: + +```yml +pathDefaults: + runOnReady: | + bash -c " + while true; do + mkdir -p $(dirname screenshots/$MTX_PATH) + ffmpeg -i rtsp://localhost:8554/$MTX_PATH -frames:v 1 -update true -y screenshots/$MTX_PATH.jpg + sleep 10 + done" +``` + +Where `10` is the interval between screenshots. diff --git a/docs/2-usage/12-on-demand-publishing.md b/docs/2-usage/13-on-demand-publishing.md similarity index 100% rename from docs/2-usage/12-on-demand-publishing.md rename to docs/2-usage/13-on-demand-publishing.md diff --git a/docs/2-usage/13-route-absolute-timestamps.md b/docs/2-usage/14-route-absolute-timestamps.md similarity index 100% rename from docs/2-usage/13-route-absolute-timestamps.md rename to docs/2-usage/14-route-absolute-timestamps.md diff --git a/docs/2-usage/14-expose-the-server-in-a-subfolder.md b/docs/2-usage/15-expose-the-server-in-a-subfolder.md similarity index 100% rename from docs/2-usage/14-expose-the-server-in-a-subfolder.md rename to docs/2-usage/15-expose-the-server-in-a-subfolder.md diff --git a/docs/2-usage/15-start-on-boot.md b/docs/2-usage/16-start-on-boot.md similarity index 100% rename from docs/2-usage/15-start-on-boot.md rename to docs/2-usage/16-start-on-boot.md diff --git a/docs/2-usage/16-hooks.md b/docs/2-usage/17-hooks.md similarity index 96% rename from docs/2-usage/16-hooks.md rename to docs/2-usage/17-hooks.md index d0f08b13..652ca7f2 100644 --- a/docs/2-usage/16-hooks.md +++ b/docs/2-usage/17-hooks.md @@ -2,6 +2,8 @@ The server allows to specify commands that are executed when a certain event happens, allowing the propagation of events to external software. +## runOnConnect + `runOnConnect` allows to run a command when a client connects to the server: ```yml @@ -16,6 +18,8 @@ runOnConnect: curl http://my-custom-server/webhook?conn_type=$MTX_CONN_TYPE&conn runOnConnectRestart: no ``` +## runOnDisconnect + `runOnDisconnect` allows to run a command when a client disconnects from the server: ```yml @@ -24,6 +28,8 @@ runOnConnectRestart: no runOnDisconnect: curl http://my-custom-server/webhook?conn_type=$MTX_CONN_TYPE&conn_id=$MTX_CONN_ID ``` +## runOnInit + `runOnInit` allows to run a command when a path is initialized. This can be used to publish a stream when the server is launched: ```yml @@ -41,6 +47,8 @@ paths: runOnInitRestart: no ``` +## runOnDemand + `runOnDemand` allows to run a command when a path is requested by a reader. This can be used to publish a stream on demand: ```yml @@ -59,6 +67,8 @@ pathDefaults: runOnDemandRestart: no ``` +## runOnUnDemand + `runOnUnDemand` allows to run a command when there are no readers anymore: ```yml @@ -68,6 +78,8 @@ pathDefaults: runOnUnDemand: ``` +## runOnReady + `runOnReady` allows to run a command when a stream is ready to be read: ```yml @@ -88,6 +100,8 @@ pathDefaults: runOnReadyRestart: no ``` +## runOnNotReady + `runOnNotReady` allows to run a command when a stream is not available anymore: ```yml @@ -97,6 +111,8 @@ pathDefaults: runOnNotReady: curl http://my-custom-server/webhook?path=$MTX_PATH&source_type=$MTX_SOURCE_TYPE&source_id=$MTX_SOURCE_ID ``` +## runOnRead + `runOnRead` allows to run a command when a client starts reading: ```yml @@ -116,6 +132,8 @@ pathDefaults: runOnReadRestart: no ``` +## runOnUnread + `runOnUnread` allows to run a command when a client stops reading: ```yml @@ -125,6 +143,8 @@ pathDefaults: runOnUnread: curl http://my-custom-server/webhook?path=$MTX_PATH&reader_type=$MTX_READER_TYPE&reader_id=$MTX_READER_ID ``` +## runOnRecordSegmentCreate + `runOnRecordSegmentCreate` allows to run a command when a recording segment is created: ```yml @@ -139,6 +159,8 @@ pathDefaults: runOnRecordSegmentCreate: curl http://my-custom-server/webhook?path=$MTX_PATH&segment_path=$MTX_SEGMENT_PATH ``` +## runOnRecordSegmentComplete + `runOnRecordSegmentComplete` allows to run a command when a recording segment is complete: ```yml diff --git a/docs/2-usage/17-control-api.md b/docs/2-usage/18-control-api.md similarity index 100% rename from docs/2-usage/17-control-api.md rename to docs/2-usage/18-control-api.md diff --git a/docs/2-usage/17-metrics.md b/docs/2-usage/19-metrics.md similarity index 100% rename from docs/2-usage/17-metrics.md rename to docs/2-usage/19-metrics.md diff --git a/docs/2-usage/18-pprof.md b/docs/2-usage/20-pprof.md similarity index 100% rename from docs/2-usage/18-pprof.md rename to docs/2-usage/20-pprof.md diff --git a/docs/2-usage/19-srt-specific-features.md b/docs/2-usage/21-srt-specific-features.md similarity index 100% rename from docs/2-usage/19-srt-specific-features.md rename to docs/2-usage/21-srt-specific-features.md diff --git a/docs/2-usage/20-webrtc-specific-features.md b/docs/2-usage/22-webrtc-specific-features.md similarity index 100% rename from docs/2-usage/20-webrtc-specific-features.md rename to docs/2-usage/22-webrtc-specific-features.md diff --git a/docs/2-usage/21-rtsp-specific-features.md b/docs/2-usage/23-rtsp-specific-features.md similarity index 100% rename from docs/2-usage/21-rtsp-specific-features.md rename to docs/2-usage/23-rtsp-specific-features.md diff --git a/docs/2-usage/22-rtmp-specific-features.md b/docs/2-usage/24-rtmp-specific-features.md similarity index 100% rename from docs/2-usage/22-rtmp-specific-features.md rename to docs/2-usage/24-rtmp-specific-features.md