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.75k stars 382 forks source link

No video from D-Link DCS-2630L camera on rtsp - recvonly / sendonly swapped? #771

Open tracestep opened 10 months ago

tracestep commented 10 months ago

My other cameras work with go2rtc, and D-Link DCS-2630L camera works with other software through RTSP (Scrypted, VLC, Home Assistant). But when restreaming with go2rtc rtsp, I get only sound, no video.

go2rtc.yaml:

log:
  level: debug
  streams: trace
  rtsp: debug

streams:
    dlink:
        - rtsp://user:password@192.168.1.22/play1.sdp
    hikvision:
        - rtsp://user:password@192.168.1.23/Streaming/channels/1001/

This is the output when I open rtsp://localhost:8554/dlink with VLC and get no video:

22:43:18.782 INF go2rtc version 1.8.4 linux/amd64
22:43:18.782 INF [rtsp] listen addr=:8554
22:43:18.782 INF [webrtc] listen addr=:8555
22:43:18.782 INF [api] listen addr=:1984
22:43:18.782 DBG [hass] can't import config: open .storage/core.config_entries: no such file or directory
22:43:29.538 DBG [rtsp] new consumer stream=dlink
22:43:29.538 TRC [streams] check cons=0 media=video, sendonly, ANY
22:43:29.603 TRC [streams] check prod=0 media=video, sendonly, H.264 Baseline 4.1
22:43:29.603 TRC [streams] check prod=0 media=audio, recvonly, MPEG4-GENERIC/8000
22:43:29.603 TRC [streams] check cons=0 media=audio, sendonly, ANY
22:43:29.603 TRC [streams] check prod=0 media=video, sendonly, H.264 Baseline 4.1
22:43:29.603 TRC [streams] check prod=0 media=audio, recvonly, MPEG4-GENERIC/8000
22:43:29.603 TRC [streams] match prod=0 => cons=0
22:43:29.618 DBG [streams] start producer url=rtsp://user:password@192.168.1.22/play1.sdp

And this is the output when I open rtsp://localhost:8554/hikvision with VLC and everything works:

22:55:14.355 INF go2rtc version 1.8.4 linux/amd64
22:55:14.355 INF [rtsp] listen addr=:8554
22:55:14.355 INF [webrtc] listen addr=:8555
22:55:14.355 INF [api] listen addr=:1984
22:55:14.355 DBG [hass] can't import config: open .storage/core.config_entries: no such file or directory
22:55:21.085 DBG [rtsp] new consumer stream=hikvision
22:55:21.085 TRC [streams] check cons=0 media=video, sendonly, ANY
22:55:21.167 TRC [streams] check prod=0 media=video, recvonly, H.264 High 3.1
22:55:21.167 TRC [streams] match prod=0 => cons=0
22:55:21.169 TRC [streams] check cons=0 media=audio, sendonly, ANY
22:55:21.169 TRC [streams] check prod=0 media=video, recvonly, H.264 High 3.1
22:55:21.169 DBG [streams] start producer url=rtsp://user:password@192.168.1.23/Streaming/channels/1001/

It looks like to me that, since the camera works with other software, go2rtc is misinterpreting / swapping recvonly / sendonly reported by the camera somehow... I have alse tried with #backchannel=0# option on rtsp url on streams, same behavior. Using #media=video fails with WRN [rtsp] error="streams: codecs not matched: => ANY" stream=dlink.

I know it's an old camera, but still works and I can't seem to find another with 180-degree rectilinear lens of the D-Link one.

AlexxIT commented 10 months ago

Show stream info from WebUI, while stream playing somewhere

tracestep commented 10 months ago

Output of http://localhost:1984/api/streams?src=dlink while streaming to VLC (no video appears, only audio):

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.1.22/play1.sdp/",
      "remote_addr": "192.168.1.22:554",
      "user_agent": "go2rtc/1.8.4",
      "sdp": "v=0\r\no=CV-RTSPHandler 1123412 0 IN IP4 192.168.1.22\r\ns=Camera\r\nc=IN IP4 192.168.1.22\r\nt=0 0\r\na=charset:Shift_JIS\r\na=range:npt=0-\r\na=control:*\r\na=etag:1234567890\r\nm=video 0 RTP/AVP 99\r\na=rtpmap:99 H264/90000\r\na=fmtp:99 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z0KgKedAPAET8uAIEAABd2AAK/IGAAADAC+vCAAAHc1lP//jAAADABfXhAAADuayn//wIA==,aN48gA==\r\na=control:trackID=1\r\na=sendonly\r\nm=audio 0 RTP/AVP 127\r\na=rtpmap:127 mpeg4-generic/8000/1\r\na=fmtp:127 streamtype=5; profile-level-id=15; mode=AAC-hbr; sizeLength=13; indexLength=3; indexDeltalength=3; config=1588; CTSDeltaLength=0; DTSDeltaLength=0;\r\na=control:trackID=2\r\n",
      "medias": [
        "video, sendonly, H.264 Baseline 4.1",
        "audio, recvonly, MPEG4-GENERIC/8000"
      ],
      "receivers": [
        "127 MPEG4-GENERIC/8000, bytes=11660, senders=1"
      ],
      "recv": 12340
    }
  ],
  "consumers": [
    {
      "type": "RTSP passive consumer",
      "url": "rtsp://localhost:8554/dlink",
      "remote_addr": "127.0.0.1:58036",
      "user_agent": "LibVLC/3.0.20 (LIVE555 Streaming Media v2020.11.05)",
      "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 96\r\na=rtpmap:96 MPEG4-GENERIC/8000\r\na=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; sizeLength=13; indexLength=3; indexDeltalength=3; config=1588; CTSDeltaLength=0; DTSDeltaLength=0;\r\na=control:trackID=0\r\n",
      "medias": [
        "video, sendonly, ANY",
        "audio, sendonly, ANY"
      ],
      "senders": [
        "96 MPEG4-GENERIC/8000, bytes=11660, receivers=1"
      ],
      "recv": 104,
      "send": 12492
    }
  ]
}