bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.78k stars 1.4k forks source link

RunOnInit #3214

Closed dlucas9 closed 1 month ago

dlucas9 commented 2 months ago

Which version are you using?

v1.6.0

Which operating system are you using?

Describe the issue

RunOnInit complains with "ERR: a path with a regular expression (or path 'all') does not support option 'runOnInit'; use another path"

Describe how to replicate the issue

Set a command for RunOnInit as described in the README and run mediamtx.

Did you attach the server logs?

NO

Did you attach a network dump?

NO

eravellaSC commented 2 months ago

Did you set the RunOnInit for all path? You can't do that, as the error suggests.

aler9 commented 1 month ago

Hello, runOnInit is meant to be moved inside the paths section, in this way:

paths:
  mypath:
    runOnInit: mycommand

The documentation is definitely not clear, this is because all path parameters were recently moved to pathDefaults, which is a new variable that allows to set default values for all paths. There are some variables that cannot be set automatically on all paths but must be set on explicit paths. We'll see what we can do about it in the future.