docs: add instructions on how to extract screenshots (#4920)
This commit is contained in:
@@ -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.
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user