Open MalgathThelamin opened 1 month ago
11:04:58.949 ERR github.com/AlexxIT/go2rtc/internal/rtmp/rtmp.go:61 > error="rtmp: read command 020007636f6e6e656374003ff000000000000003000361707002000000047479706502000a6e6f6e70726976617465000e737570706f727473476f417761790101000673776655726c02001272746d703a2f2f3139322e3136382e302e320005746355726c02001272746d703a2f2f3139322e3136382e302e32000009"
@AlexxIT, do you mean that the problem is on the camera side?
I don't know. RTMP awful legacy protocol. I need to check what inside this message.
This message is encoded in AMF0 format and represents the following data:
"connect"
1.0
{
"app": "",
"type": "nonprivate",
"supportsGoAway": true,
"swfUrl": "rtmp://192.168.0.2",
"tcUrl": "rtmp://192.168.0.2"
}
@AlexxIT, the error is being raised in https://github.com/AlexxIT/go2rtc/blob/master/pkg/rtmp/server.go:120
if c.App == "" {
return fmt.Errorf("rtmp: read command %x", b)
}
The app
field is "" in the message (see my previous comment). The camera sends the RTMP stream to an URL without an application name: rtmp://192.168.0.2/mystream
. This is because the documentation says so. The URL with an application name would be, for example, rtmp://192.168.0.2/myapp/mystream
.
Later in https://github.com/AlexxIT/go2rtc/blob/master/internal/rtmp/rtmp.go:80 you use the app name as a stream name:
stream := streams.Get(rtmpConn.App)
if stream == nil {
return errors.New("stream not found: " + rtmpConn.App)
}
I tried to push the video to rtmp://192.168.0.2/mystream/mystream
, but I still got an error: stream not found: mystream
.
"stream not found" - because you haven't created it manually in config: https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#incoming-sources
My go2rtc.yaml is:
streams:
mystream
rtmp:
listen: ":1935"
log:
level: trace
api: trace
exec: trace
ngrok: trace
rtsp: trace
streams: trace
webrtc: trace
I stream to rtmp://192.168.0.2/mystream/mystream
.
I get an error:
18:10:49.018 ERR github.com/AlexxIT/go2rtc/internal/rtmp/rtmp.go:61 > error="stream not found: mystream"
What am I doing wrong?
By the way, how do you create a log file, not only display the log information on the screen?
You need ":" after stream name. YAML rules
Thank you! Now I can see the stream in the go2rtc console.
Please note, that even without :
, it is a valid YAML. Please consider adding an example of what you mean by stream with empty source to the documentation.
It seems that the correct URL to push RTMP to is rtmp://192.168.0.2/mystream/anything
, where anything
means really anything. If I am right, please consider adding it to the documentation.
Unfortunately, the stream shows up, but does not play in the go2rtc console. The built-in player shows mse: streams: unknown error
.
Please see the attached go2rtc.log.
Try to get stream info for active stream. I can't see any codecs information for your stream in logs.
{
"producers": [
{
"id": 16,
"format_name": "rtmp",
"protocol": "rtmp",
"remote_addr": "192.168.0.188:57012",
"bytes_recv": 22970920
}
],
"consumers": null
}
I am using go2rtc version 1.9.4 on Debian Bookworm arm64.
Issue description
I push an RTMP stream from my camera (102.168.0.188, running OpenIPC) to go2rtc (192.168.0.2). However, http://192.168.0.2:1984/stream.html?src=mystream shows black video player with
webrtc/offer: stream not found
message.If I stop the video pushing from the camera and configure go2rtc to pull the video from the camera via RTSP protocol, the player shows video normally.
How to replicate the issue
Files
go2rtc.yaml
go2rtc.log