Closed wangborong12345 closed 10 months ago
This is not a problem with the callback, but with your streaming command. In the bash command line, the special character &
represents starting in the background. You should modify your command line:
ffmpeg -f gdigrab -framerate 2 -i desktop -c:v libx264 -x264-params "bframes=0" \
-profile:v baseline -b:v 100k -s 1280x720 -preset veryfast -tune zerolatency -pix_fmt yuv420p \
-f flv "rtmp://yulee.local:1935/live/livestream?secret=spy&token=hellotoken"
Use double quotes or single quotes to avoid the &
issue.
TRANS_BY_GPT4
Description
English: I use the RTMP URL:
rtmp://yulee.local:1935/live/livestream?secret=spy&token=hellotoken
to push the stream. Then, I can receive the on_publish action in the HTTP Hook. Up to this point, everything works fine. However,?secret=spy&token=hellotoken
does not exist in the on_publish action request parameter. It only sends "?secret=spy" in theparam
field.Chinese: I use the URL:
rtmp://yulee.local:1935/live/livestream?secret=spy&token=hellotoken
to push the stream toSRS
, and everything is working fine. Then, I ran themain
branch ofSRS Stack
, and debugged the method on line 54 insrs_hooks.go
, which is the HTTP Hook for on_publish. I found that the request parameters for the on_publish Hook are incomplete, missing&token=hellotoken
and only having?secret=spy
.SRS Version: 5.0
SRS Config:
Replay
Please describe how to replay the bug?
Step 1:
Step 2:
debug on_publish function
Expect
English: return all param, "?secret=spy&token=hellotoken"
Chinese: I think it should return all parameters.
TRANS_BY_GPT4