mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-15 02:47:38 +00:00
enable runOnDemandRestart by default (#3605)
This commit is contained in:
parent
012cc6c701
commit
547e56e82b
@ -1428,7 +1428,6 @@ Edit `mediamtx.yml` and replace everything inside section `paths` with the follo
|
||||
paths:
|
||||
ondemand:
|
||||
runOnDemand: ffmpeg -re -stream_loop -1 -i file.ts -c copy -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
|
||||
runOnDemandRestart: yes
|
||||
```
|
||||
|
||||
The command inserted into `runOnDemand` will start only when a client requests the path `ondemand`, therefore the file will start streaming only when requested.
|
||||
@ -1588,8 +1587,6 @@ pathDefaults:
|
||||
# * G1, G2, ...: regular expression groups, if path name is
|
||||
# a regular expression.
|
||||
runOnDemand: ffmpeg -i my_file.mp4 -c copy -f rtsp rtsp://localhost:8554/mypath
|
||||
# Restart the command if it exits.
|
||||
runOnDemandRestart: no
|
||||
```
|
||||
|
||||
`runOnUnDemand` allows to run a command when there are no readers anymore:
|
||||
|
@ -77,6 +77,7 @@ func TestConfFromFile(t *testing.T) {
|
||||
RPICameraAfRange: "normal",
|
||||
RPICameraAfSpeed: "normal",
|
||||
RPICameraTextOverlay: "%Y-%m-%d %H:%M:%S - MediaMTX",
|
||||
RunOnDemandRestart: true,
|
||||
RunOnDemandStartTimeout: 5 * StringDuration(time.Second),
|
||||
RunOnDemandCloseAfter: 10 * StringDuration(time.Second),
|
||||
}, pa)
|
||||
|
@ -220,6 +220,7 @@ func (pconf *Path) setDefaults() {
|
||||
pconf.RPICameraTextOverlay = "%Y-%m-%d %H:%M:%S - MediaMTX"
|
||||
|
||||
// Hooks
|
||||
pconf.RunOnDemandRestart = true
|
||||
pconf.RunOnDemandStartTimeout = 10 * StringDuration(time.Second)
|
||||
pconf.RunOnDemandCloseAfter = 10 * StringDuration(time.Second)
|
||||
}
|
||||
|
@ -615,7 +615,7 @@ pathDefaults:
|
||||
# a regular expression.
|
||||
runOnDemand:
|
||||
# Restart the command if it exits.
|
||||
runOnDemandRestart: no
|
||||
runOnDemandRestart: yes
|
||||
# Readers will be put on hold until the runOnDemand command starts publishing
|
||||
# or until this amount of time has passed.
|
||||
runOnDemandStartTimeout: 10s
|
||||
|
Loading…
Reference in New Issue
Block a user