AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.81k stars 389 forks source link

Cryptic EOF error with strream from Scrypted #1396

Open DavidIlie opened 4 days ago

DavidIlie commented 4 days ago

I setup a brand new camera on Scrypted, added it to to Home Assistant to use the go2rtc camera integration with the custom instance (for a GPU) and for this camera only I get a cryptic error which doesn't make sense as the stream is working when I play it in VLC.

21:05:38.864 info [streams] create new stream url=rtsp://192.168.100.17:46813/7550fd0abfa379b7
21:05:38.867 debug [mp4] add consumer error=streams: EOF
AlexxIT commented 4 days ago

Try to increase log level for rtsp module to trace

DavidIlie commented 4 days ago
a=range:npt=0-
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==
a=control:track1
m=audio 0 RTP/AVP 8
a=rtpmap:8 PCMA/8000
c=IN IP4 0.0.0.0
b=AS:64
a=control:track2
22:20:53.541 TRC [streams] dial cons=1 prod=0 error=EOF
22:20:53.541 TRC [streams] check cons=1 media=audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML, OPUS
22:20:53.541 TRC [streams] skip cons=1 prod=0
22:20:53.541 TRC [streams] skip stop none producer
22:20:53.541 DBG [mp4] add consumer error="streams: EOF"
22:20:53.544 TRC [api] ws msg type=mjpeg
22:20:53.544 TRC [streams] check cons=0 media=video, sendonly, JPEG, RAW
22:20:53.545 TRC [rtsp] client request:
DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0
Accept: application/sdp
Require: www.onvif.org/ver20/backchannel
User-Agent: go2rtc/1.9.4
CSeq: 1
22:20:53.547 TRC [rtsp] client response:
RTSP/1.0 200 OK
Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276
Content-Type: application/sdp
Cseq: 1
Content-Length: 561
v=0
o=- 14665860 31787219 1 IN IP4 192.168.100.83
s=Session streamed by "TP-LINK RTSP Server"
i=stream2
t=0 0
a=tool:TP-LINK Streaming Media v2015.05.12
a=type:broadcast

a=control:*
a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:4096
a=range:npt=0-
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==
a=control:track1
m=audio 0 RTP/AVP 8
a=rtpmap:8 PCMA/8000
c=IN IP4 0.0.0.0
b=AS:64
a=control:track2
22:20:53.547 TRC [rtsp] describe (backchannel=true) err: EOF
22:20:53.547 TRC [rtsp] client request:
DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0
Accept: application/sdp
User-Agent: go2rtc/1.9.4
CSeq: 1
22:20:53.549 TRC [rtsp] client response:
RTSP/1.0 200 OK
Cseq: 1
Content-Length: 561
Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276
Content-Type: application/sdp
v=0
o=- 14665860 31787219 1 IN IP4 192.168.100.83
s=Session streamed by "TP-LINK RTSP Server"
i=stream2
t=0 0
a=tool:TP-LINK Streaming Media v2015.05.12
a=type:broadcast

a=control:*
a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:4096
a=range:npt=0-
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==
a=control:track1
m=audio 0 RTP/AVP 8
a=rtpmap:8 PCMA/8000
c=IN IP4 0.0.0.0
b=AS:64
a=control:track2
22:20:53.549 TRC [streams] dial cons=0 prod=0 error=EOF
22:20:53.549 TRC [streams] skip stop none producer
22:20:53.549 DBG [mjpeg] add consumer error="streams: EOF"
22:20:53.624 DBG [streams] stop producer url=rtsp://192.168.100.17:41341/ccdf9547d9ee1a64
22:20:53.624 TRC [rtsp] client request:
TEARDOWN rtsp://192.168.100.17:41341/ccdf9547d9ee1a64 RTSP/1.0
CSeq: 5
Session: 4558e3ed
22:20:53.624 TRC [streams] stop reconnect url=rtsp://192.168.100.17:41341/ccdf9547d9ee1a64
DavidIlie commented 4 days ago

These logs do not really make sense, as it seems that data is being transported but it randomly closes? I've never seen this happen with my other cameras.

AlexxIT commented 3 days ago

Some problem with DESCRIBE request. This can be broken SDP. You have some strange symbols after a=type:broadcast line. I need either access to this RTSP stream or tcpdump.

Also you can use FFmpeg source to fix this problem.

DavidIlie commented 3 days ago

I think it was because of how I copied it, i don't see it anymore

23:15:22.994 trace [api] GET /api/log 192.168.25.5:60504
23:15:24.318 trace [api] GET /log.html 192.168.25.5:60504
23:15:24.331 trace [api] GET /main.js 192.168.25.5:60504
23:15:24.349 trace [api] GET /api/log 192.168.25.5:60504
23:15:26.435 trace [api] GET /stream.html?src=camera.parking_camera_hd_stream 192.168.25.5:60504
23:15:26.442 trace undefined error=websocket: close 1001 (going away) caller=github.com/AlexxIT/go2rtc/internal/api/ws/ws.go:124
23:15:26.451 trace [api] GET /video-stream.js 192.168.25.5:60504
23:15:26.461 trace [api] GET /video-rtc.js 192.168.25.5:60504
23:15:26.475 trace [api] GET /api/ws?src=camera.parking_camera_hd_stream 192.168.25.5:33536
23:15:26.530 trace [api] ws msg type=webrtc/offer
23:15:26.530 trace [api] ws msg type=mse
23:15:26.530 trace [mp4] new WS/MSE consumer codecs=avc1.640029,avc1.64002A,avc1.640033,hvc1.1.6.L153.B0,mp4a.40.2,mp4a.40.5,flac,opus
23:15:26.530 trace [streams] check cons=0 media=video, sendonly, H264, H265
23:15:26.530 debug [webrtc] new consumer src=camera.parking_camera_hd_stream
23:15:26.531 trace [rtsp] client request:DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0Accept: application/sdpRequire: www.onvif.org/ver20/backchannelUser-Agent: go2rtc/1.9.4CSeq: 1
23:15:26.531 trace [webrtc] offer:v=0o=- 5433540222121047391 2 IN IP4 127.0.0.1s=-t=0 0a=group:BUNDLE 0 1a=extmap-allow-mixeda=msid-semantic: WMSm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 35 36 37 38 102 103 104 105 106 107 108 109 127 125 39 40 41 42 43 44 45 46 47 48 112 113 114 115 116 117 118 49c=IN IP4 0.0.0.0a=rtcp:9 IN IP4 0.0.0.0a=ice-ufrag:CeO1a=ice-pwd:/SQebptb8Sep75Nf/dpCY7Xha=ice-options:tricklea=fingerprint:sha-256 C2:77:3C:68:04:DC:EF:B8:C8:37:5D:DA:E8:46:B2:8C:CB:EC:E9:BA:8A:E8:D5:A9:40:0B:C4:12:9C:51:24:1Ca=setup:actpassa=mid:0a=extmap:1 urn:ietf:params:rtp-hdrext:toffseta=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-timea=extmap:3 urn:3gpp:video-orientationa=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delaya=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-typea=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timinga=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-spacea=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mida=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-ida=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-ida=recvonlya=rtcp-muxa=rtcp-rsizea=rtpmap:96 VP8/90000a=rtcp-fb:96 goog-remba=rtcp-fb:96 transport-cca=rtcp-fb:96 ccm fira=rtcp-fb:96 nacka=rtcp-fb:96 nack plia=rtpmap:97 rtx/90000a=fmtp:97 apt=96a=rtpmap:98 VP9/90000a=rtcp-fb:98 goog-remba=rtcp-fb:98 transport-cca=rtcp-fb:98 ccm fira=rtcp-fb:98 nacka=rtcp-fb:98 nack plia=fmtp:98 profile-id=0a=rtpmap:99 rtx/90000a=fmtp:99 apt=98a=rtpmap:100 VP9/90000a=rtcp-fb:100 goog-remba=rtcp-fb:100 transport-cca=rtcp-fb:100 ccm fira=rtcp-fb:100 nacka=rtcp-fb:100 nack plia=fmtp:100 profile-id=2a=rtpmap:101 rtx/90000a=fmtp:101 apt=100a=rtpmap:35 VP9/90000a=rtcp-fb:35 goog-remba=rtcp-fb:35 transport-cca=rtcp-fb:35 ccm fira=rtcp-fb:35 nacka=rtcp-fb:35 nack plia=fmtp:35 profile-id=1a=rtpmap:36 rtx/90000a=fmtp:36 apt=35a=rtpmap:37 VP9/90000a=rtcp-fb:37 goog-remba=rtcp-fb:37 transport-cca=rtcp-fb:37 ccm fira=rtcp-fb:37 nacka=rtcp-fb:37 nack plia=fmtp:37 profile-id=3a=rtpmap:38 rtx/90000a=fmtp:38 apt=37a=rtpmap:102 H264/90000a=rtcp-fb:102 goog-remba=rtcp-fb:102 transport-cca=rtcp-fb:102 ccm fira=rtcp-fb:102 nacka=rtcp-fb:102 nack plia=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001fa=rtpmap:103 rtx/90000a=fmtp:103 apt=102a=rtpmap:104 H264/90000a=rtcp-fb:104 goog-remba=rtcp-fb:104 transport-cca=rtcp-fb:104 ccm fira=rtcp-fb:104 nacka=rtcp-fb:104 nack plia=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001fa=rtpmap:105 rtx/90000a=fmtp:105 apt=104a=rtpmap:106 H264/90000a=rtcp-fb:106 goog-remba=rtcp-fb:106 transport-cca=rtcp-fb:106 ccm fira=rtcp-fb:106 nacka=rtcp-fb:106 nack plia=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01fa=rtpmap:107 rtx/90000a=fmtp:107 apt=106a=rtpmap:108 H264/90000a=rtcp-fb:108 goog-remba=rtcp-fb:108 transport-cca=rtcp-fb:108 ccm fira=rtcp-fb:108 nacka=rtcp-fb:108 nack plia=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01fa=rtpmap:109 rtx/90000a=fmtp:109 apt=108a=rtpmap:127 H264/90000a=rtcp-fb:127 goog-remba=rtcp-fb:127 transport-cca=rtcp-fb:127 ccm fira=rtcp-fb:127 nacka=rtcp-fb:127 nack plia=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001fa=rtpmap:125 rtx/90000a=fmtp:125 apt=127a=rtpmap:39 H264/90000a=rtcp-fb:39 goog-remba=rtcp-fb:39 transport-cca=rtcp-fb:39 ccm fira=rtcp-fb:39 nacka=rtcp-fb:39 nack plia=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001fa=rtpmap:40 rtx/90000a=fmtp:40 apt=39a=rtpmap:41 H264/90000a=rtcp-fb:41 goog-remba=rtcp-fb:41 transport-cca=rtcp-fb:41 ccm fira=rtcp-fb:41 nacka=rtcp-fb:41 nack plia=fmtp:41 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001fa=rtpmap:42 rtx/90000a=fmtp:42 apt=41a=rtpmap:43 H264/90000a=rtcp-fb:43 goog-remba=rtcp-fb:43 transport-cca=rtcp-fb:43 ccm fira=rtcp-fb:43 nacka=rtcp-fb:43 nack plia=fmtp:43 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001fa=rtpmap:44 rtx/90000a=fmtp:44 apt=43a=rtpmap:45 AV1/90000a=rtcp-fb:45 goog-remba=rtcp-fb:45 transport-cca=rtcp-fb:45 ccm fira=rtcp-fb:45 nacka=rtcp-fb:45 nack plia=fmtp:45 level-idx=5;profile=0;tier=0a=rtpmap:46 rtx/90000a=fmtp:46 apt=45a=rtpmap:47 AV1/90000a=rtcp-fb:47 goog-remba=rtcp-fb:47 transport-cca=rtcp-fb:47 ccm fira=rtcp-fb:47 nacka=rtcp-fb:47 nack plia=fmtp:47 level-idx=5;profile=1;tier=0a=rtpmap:48 rtx/90000a=fmtp:48 apt=47a=rtpmap:112 H264/90000a=rtcp-fb:112 goog-remba=rtcp-fb:112 transport-cca=rtcp-fb:112 ccm fira=rtcp-fb:112 nacka=rtcp-fb:112 nack plia=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001fa=rtpmap:113 rtx/90000a=fmtp:113 apt=112a=rtpmap:114 H264/90000a=rtcp-fb:114 goog-remba=rtcp-fb:114 transport-cca=rtcp-fb:114 ccm fira=rtcp-fb:114 nacka=rtcp-fb:114 nack plia=fmtp:114 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=64001fa=rtpmap:115 rtx/90000a=fmtp:115 apt=114a=rtpmap:116 red/90000a=rtpmap:117 rtx/90000a=fmtp:117 apt=116a=rtpmap:118 ulpfec/90000a=rtpmap:49 flexfec-03/90000a=rtcp-fb:49 goog-remba=rtcp-fb:49 transport-cca=fmtp:49 repair-window=10000000m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126c=IN IP4 0.0.0.0a=rtcp:9 IN IP4 0.0.0.0a=ice-ufrag:CeO1a=ice-pwd:/SQebptb8Sep75Nf/dpCY7Xha=ice-options:tricklea=fingerprint:sha-256 C2:77:3C:68:04:DC:EF:B8:C8:37:5D:DA:E8:46:B2:8C:CB:EC:E9:BA:8A:E8:D5:A9:40:0B:C4:12:9C:51:24:1Ca=setup:actpassa=mid:1a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-levela=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-timea=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mida=recvonlya=rtcp-muxa=rtcp-rsizea=rtpmap:111 opus/48000/2a=rtcp-fb:111 transport-cca=fmtp:111 minptime=10;useinbandfec=1a=rtpmap:63 red/48000/2a=fmtp:63 111/111a=rtpmap:9 G722/8000a=rtpmap:0 PCMU/8000a=rtpmap:8 PCMA/8000a=rtpmap:13 CN/8000a=rtpmap:110 telephone-event/48000a=rtpmap:126 telephone-event/8000
23:15:26.532 trace [streams] check cons=1 media=video, sendonly, VP8, VP9, H264, AV1
23:15:26.533 trace [rtsp] client response:RTSP/1.0 200 OKCseq: 1Content-Length: 561Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276Content-Type: application/sdpv=0o=- 14665860 31787219 1 IN IP4 192.168.100.83s=Session streamed by "TP-LINK RTSP Server"i=stream2t=0 0a=tool:TP-LINK Streaming Media v2015.05.12a=type:broadcasta=control:*a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"m=video 0 RTP/AVP 96c=IN IP4 0.0.0.0b=AS:4096a=range:npt=0-a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==a=control:track1m=audio 0 RTP/AVP 8a=rtpmap:8 PCMA/8000c=IN IP4 0.0.0.0b=AS:64a=control:track2
23:15:26.533 trace [rtsp] describe (backchannel=true) err: EOF
23:15:26.533 trace [rtsp] client request:DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0Accept: application/sdpUser-Agent: go2rtc/1.9.4CSeq: 1
23:15:26.535 trace [rtsp] client response:RTSP/1.0 200 OKContent-Length: 561Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276Content-Type: application/sdpCseq: 1v=0o=- 14665860 31787219 1 IN IP4 192.168.100.83s=Session streamed by "TP-LINK RTSP Server"i=stream2t=0 0a=tool:TP-LINK Streaming Media v2015.05.12a=type:broadcasta=control:*a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"m=video 0 RTP/AVP 96c=IN IP4 0.0.0.0b=AS:4096a=range:npt=0-a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==a=control:track1m=audio 0 RTP/AVP 8a=rtpmap:8 PCMA/8000c=IN IP4 0.0.0.0b=AS:64a=control:track2
23:15:26.535 trace [streams] dial cons=0 prod=0 error=EOF
23:15:26.535 trace [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML, OPUS
23:15:26.535 trace [streams] skip cons=0 prod=0
23:15:26.535 debug [mp4] add consumer error=streams: EOF
23:15:26.535 trace [rtsp] client request:DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0Require: www.onvif.org/ver20/backchannelUser-Agent: go2rtc/1.9.4CSeq: 1Accept: application/sdp
23:15:26.535 trace [api] ws msg type=webrtc/candidate
23:15:26.535 trace [webrtc] remote candidate=candidate:3905494009 1 udp 2113937151 a54037b8-b88b-4b8f-8698-180d4343fcc8.local 53721 typ host generation 0 ufrag CeO1 network-cost 999
23:15:26.537 trace [api] ws msg type=webrtc/candidate
23:15:26.537 trace [webrtc] remote candidate=candidate:32314287 1 udp 2113939711 40c7e6fe-cc7f-4a06-8075-2afce503a62a.local 53215 typ host generation 0 ufrag CeO1 network-cost 999
23:15:26.537 trace [rtsp] client response:RTSP/1.0 200 OKCseq: 1Content-Length: 561Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276Content-Type: application/sdpv=0o=- 14665860 31787219 1 IN IP4 192.168.100.83s=Session streamed by "TP-LINK RTSP Server"i=stream2t=0 0a=tool:TP-LINK Streaming Media v2015.05.12a=type:broadcasta=control:*a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"m=video 0 RTP/AVP 96c=IN IP4 0.0.0.0b=AS:4096a=range:npt=0-a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==a=control:track1m=audio 0 RTP/AVP 8a=rtpmap:8 PCMA/8000c=IN IP4 0.0.0.0b=AS:64a=control:track2
23:15:26.537 trace [rtsp] describe (backchannel=true) err: EOF
23:15:26.537 trace [rtsp] client request:DESCRIBE rtsp://192.168.100.17:38863/5b4ac69753091276 RTSP/1.0Accept: application/sdpUser-Agent: go2rtc/1.9.4CSeq: 1
23:15:26.540 trace [api] ws msg type=mjpeg
23:15:26.540 trace [streams] check cons=1 media=video, sendonly, JPEG, RAW
23:15:26.540 trace [rtsp] client response:RTSP/1.0 200 OKContent-Type: application/sdpCseq: 1Content-Length: 561Content-Base: rtsp://192.168.100.17:38863/5b4ac69753091276v=0o=- 14665860 31787219 1 IN IP4 192.168.100.83s=Session streamed by "TP-LINK RTSP Server"i=stream2t=0 0a=tool:TP-LINK Streaming Media v2015.05.12a=type:broadcasta=control:*a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"m=video 0 RTP/AVP 96c=IN IP4 0.0.0.0b=AS:4096a=range:npt=0-a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1; profile-level-id=4D0032; sprop-parameter-sets=Z00AMukASAFHQgAAAwACAAADAD0I,aOqPIA==a=control:track1m=audio 0 RTP/AVP 8a=rtpmap:8 PCMA/8000c=IN IP4 0.0.0.0b=AS:64a=control:track2
23:15:26.540 trace [streams] dial cons=1 prod=0 error=EOF
23:15:26.540 trace [streams] check cons=1 media=audio, sendonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000, L16, PCML
23:15:26.540 trace [streams] skip cons=1 prod=0
23:15:26.540 debug [webrtc] add consumer error=streams: EOF
AlexxIT commented 3 days ago

Your new copy also broke all formatting. From a log like this, I can't verify if there are problems in SDP.