Closed zeridon closed 1 year ago
Hello, Regarding the presence of G1, G2, G3, i created this script:
#!/bin/sh
echo $1
echo $2
echo $3
env
and i ran it with the configuration you provided:
paths:
"~^(some|not-some|test)/(path|other)(.*)":
source: publisher
runOnReady: ./my_script.sh started $G2 $G1 $G3
The script worked correctly and printed the arguments:
started
path
some
and then the entire environment:
MTX_SOURCE_TYPE=rtmpConn
HOSTNAME=alex
SHLVL=1
MTX_PATH=some/path/tte
HOME=/root
G1=some
RTSP_PATH=some/path/tte
G2=path
G3=/tte
MTX_SOURCE_ID=24ef314c-0fe2-4603-adf5-638c4bfd0b68
_=/usr/local/go/bin/go
TERM=xterm
PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GOPATH=/go
PWD=/s
RTSP_PORT=8554
GOLANG_VERSION=1.20.10
So i could not found any bug here.
Regarding the possibility of using query parameters in hooks, i'll add an additional environment variable that contains query parameters. Next time please create two separate issues.
Correct. If streaming to rtmp://server.com:1935/some/path/otherthings?token=xoxo-token&internal_param=xxx
G3 is populated. Probably i misunderstood how path is being consumed by mediamtx.
Thanks for #2522 that was exactly what i needed.
added in v1.2.1
This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.
Which version are you using?
v1.1.1-32-g9de6423
Which operating system are you using?
Describe the issue
We are streaming via RTMP and consuming via HLS. We are using external authentication. RTMP itself starts to stream to rtmp://server.com:1935/some/path?token=xoxo-token
This leads to starting a path called
some/path
When the path is ready to be streamed by clients (HLS) we want to
runOnReady
ascript.sh
which does some internal housekeeping and additional notifications. For this we needquery
to be available in some form (similar toexternalAuthenticationURL
is perfect).Describe how to replicate the issue
ffmpeg -re -i src.flv -c copy -f flv rtmp://server.com:1935/some/path?token=xoxo-token&internal_param=xxx
G3 capture group does not exists. There is also nothing in the env, there are no additional (usable) vars in the invocation of the script
Did you attach the server logs?
no
Did you attach a network dump?
no