Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No video producer with backchannel? (Uniview/Zuum) #1576

Open
dagleaves opened this issue Jan 29, 2025 · 2 comments
Open

No video producer with backchannel? (Uniview/Zuum) #1576

dagleaves opened this issue Jan 29, 2025 · 2 comments
Labels
question Further information is requested

Comments

@dagleaves
Copy link

dagleaves commented Jan 29, 2025

I have found two separate camera/NVR models (Zuum and Uniview) that are experiencing the same weird issue.

If backchannel is enabled, there is no video producer found at all. If backchannel is disabled, there is a video producer, but it experiences a weird lag tied to the iframe interval.

For 25 fps / 50 iframe interval, it seems to just update the full frame every 2 seconds or so. If I lower the iframe interval to 5, it gets closer to a "normal" stream. I assume because it actually is just sending the full frame instead of correctly using iframes. There's also lots of noise, causing the image to be grainy. I can attach a recording if it would help.

Have you seen anything like this before? Do you have any suggestions with where to look to try and get this worked out? I can't imagine they have a bad h264 or h265 implementation. If anything stands out to you, it would help a lot on trying to pin this down.

Stream Info w/ Backchannel Enabled

{
 "producers": [
   {
     "id": 4,
     "format_name": "rtsp",
     "protocol": "rtsp+tcp",
     "remote_addr": "172.168.115.22:554",
     "url": "rtsp://admin:[email protected]:554/unicast/c5/s1/live",
     "sdp": "v=0\r\no=- 93 1 IN IP4 172.168.115.22\r\ns=ONVIF RTSP Server\r\nc=IN IP4 172.168.115.22\r\nm=audio 0 RTP/AVP 0\r\na=rtpmap:0 PCMU/8000\r\na=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/audio\r\na=recvonly\r\nm=audio 0 RTP/AVP 0\r\na=rtpmap:0 PCMU/8000\r\na=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/backchl\r\na=sendonly\r\n",
     "user_agent": "go2rtc/1.9.7",
     "medias": [
       "audio, recvonly, PCMU/8000",
       "audio, sendonly, PCMU/8000"
     ],
     "receivers": [
       {
         "id": 5,
         "codec": {
           "codec_name": "pcm_mulaw",
           "codec_type": "audio",
           "sample_rate": 8000
         },
         "childs": [
           6
         ]
       }
     ],
     "senders": [
       {
         "id": 8,
         "codec": {
           "codec_name": "pcm_mulaw",
           "codec_type": "audio",
           "sample_rate": 8000
         },
         "parent": 7
       }
     ]
   }
 ],
 "consumers": [
   {
     "id": 3,
     "format_name": "probe",
     "protocol": "http",
     "remote_addr": "[::1]:49606",
     "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
     "medias": [
       "video, sendonly, ALL",
       "audio, sendonly, ALL",
       "audio, recvonly, ANY"
     ],
     "receivers": [
       {
         "id": 7,
         "codec": {
           "codec_name": "ANY",
           "codec_type": ""
         },
         "childs": [
           8
         ]
       }
     ],
     "senders": [
       {
         "id": 6,
         "codec": {
           "codec_name": "pcm_mulaw",
           "codec_type": "audio",
           "sample_rate": 8000
         },
         "parent": 5
       }
     ]
   }
 ]
}

Logs w/ Backchannel Enabled

go2rtc-1  | 19:57:14.121 TRC [mp4] new WS/MSE consumer codecs=avc1.640029,avc1.64002A,avc1.640033,mp4a.40.2,mp4a.40.5,opus
go2rtc-1  | 19:57:14.121 TRC [streams] check cons=0 media=video, sendonly, H264
go2rtc-1  | 19:57:14.170 TRC [rtsp] client request:
go2rtc-1  | DESCRIBE rtsp://172.168.115.22:554/unicast/c5/s1/live RTSP/1.0
go2rtc-1  | CSeq: 1
go2rtc-1  | Accept: application/sdp
go2rtc-1  | Require: www.onvif.org/ver20/backchannel
go2rtc-1  | User-Agent: go2rtc/1.9.7
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.237 TRC [rtsp] client response:
go2rtc-1  | RTSP/1.0 401 Unauthorized
go2rtc-1  | Cseq: 1
go2rtc-1  | Www-Authenticate: Digest realm="6cf17e812039",nonce="1615629790", stale="FALSE"
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.237 TRC [rtsp] client request:
go2rtc-1  | DESCRIBE rtsp://172.168.115.22:554/unicast/c5/s1/live RTSP/1.0
go2rtc-1  | Require: www.onvif.org/ver20/backchannel
go2rtc-1  | User-Agent: go2rtc/1.9.7
go2rtc-1  | CSeq: 2
go2rtc-1  | Authorization: Digest username="admin", realm="6cf17e812039", nonce="1615629790", uri="rtsp://172.168.115.22:554/unicast/c5/s1/live", response="85f8a3ed119fccd915fa2086bfc983e8"
go2rtc-1  | Accept: application/sdp
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.251 TRC [api] GET /api/streams 100.71.203.26:58133
go2rtc-1  | 19:57:14.400 TRC [rtsp] client response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 2
go2rtc-1  | Content-Type: application/sdp
go2rtc-1  | Content-Length: 319
go2rtc-1  | 
go2rtc-1  | v=0
go2rtc-1  | o=- 97 1 IN IP4 172.168.115.22
go2rtc-1  | s=ONVIF RTSP Server
go2rtc-1  | c=IN IP4 172.168.115.22
go2rtc-1  | m=audio 0 RTP/AVP 0
go2rtc-1  | a=rtpmap:0 PCMU/8000
go2rtc-1  | a=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/audio
go2rtc-1  | a=recvonly
go2rtc-1  | m=audio 0 RTP/AVP 0
go2rtc-1  | a=rtpmap:0 PCMU/8000
go2rtc-1  | a=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/backchl
go2rtc-1  | a=sendonly
go2rtc-1  | 
go2rtc-1  | 19:57:14.400 TRC [streams] check cons=0 prod=0 media=audio, recvonly, PCMU/8000
go2rtc-1  | 19:57:14.400 TRC [streams] check cons=0 prod=0 media=audio, sendonly, PCMU/8000
go2rtc-1  | 19:57:14.420 DBG [ffmpeg] bin libavformat="60. 16.100" version=6.1.2
go2rtc-1  | 19:57:14.421 DBG [exec] run rtsp args=["ffmpeg","-hide_banner","-v","error","-fflags","nobuffer","-flags","low_delay","-timeout","5000000","-user_agent","go2rtc/ffmpeg","-rtsp_flags","prefer_tcp","-i","rtsp://127.0.0.1:8554/test?audio&source=ffmpeg:test%23audio%3Dopus","-c:a","libopus","-application:a","lowdelay","-min_comp","0","-vn","-user_agent","ffmpeg/go2rtc","-rtsp_transport","tcp","-f","rtsp","rtsp://127.0.0.1:8554/8e5c2b7686909cebfd4415374625e059"]
go2rtc-1  | 19:57:14.438 TRC [rtsp] server request:
go2rtc-1  | OPTIONS rtsp://127.0.0.1:8554/test?audio&source=ffmpeg:test%23audio%3Dopus RTSP/1.0
go2rtc-1  | Cseq: 1
go2rtc-1  | User-Agent: go2rtc/ffmpeg
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.439 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 1
go2rtc-1  | Public: OPTIONS, SETUP, TEARDOWN, DESCRIBE, PLAY, PAUSE, ANNOUNCE, RECORD
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.440 TRC [rtsp] server request:
go2rtc-1  | DESCRIBE rtsp://127.0.0.1:8554/test?audio&source=ffmpeg:test%23audio%3Dopus RTSP/1.0
go2rtc-1  | Accept: application/sdp
go2rtc-1  | Cseq: 2
go2rtc-1  | User-Agent: go2rtc/ffmpeg
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.440 DBG [rtsp] new consumer stream=test
go2rtc-1  | 19:57:14.440 TRC [streams] check cons=1 media=audio, sendonly, ANY
go2rtc-1  | 19:57:14.440 TRC [streams] check cons=1 prod=0 media=audio, recvonly, PCMU/8000
go2rtc-1  | 19:57:14.440 TRC [streams] match cons=1 <= prod=0
go2rtc-1  | 19:57:14.440 TRC [rtsp] client request:
go2rtc-1  | SETUP rtsp://172.168.115.22:554/unicast/c5/s1/live/audio RTSP/1.0
go2rtc-1  | Transport: RTP/AVP/TCP;unicast;interleaved=0-1
go2rtc-1  | CSeq: 3
go2rtc-1  | Authorization: Digest username="admin", realm="6cf17e812039", nonce="1615629790", uri="rtsp://172.168.115.22:554/unicast/c5/s1/live/audio", response="3f95939e67ec3a5476f4d19fd32c7548"
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] client response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Session: 98
go2rtc-1  | Cseq: 3
go2rtc-1  | Transport: RTP/AVP/TCP;unicast;interleaved=2-3
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 DBG [streams] start producer url=rtsp://admin:[email protected]:554/unicast/c5/s1/live
go2rtc-1  | 19:57:14.508 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 2
go2rtc-1  | Content-Length: 136
go2rtc-1  | Content-Type: application/sdp
go2rtc-1  | 
go2rtc-1  | v=0
go2rtc-1  | o=- 1 1 IN IP4 0.0.0.0
go2rtc-1  | s=go2rtc/1.9.7
go2rtc-1  | c=IN IP4 0.0.0.0
go2rtc-1  | t=0 0
go2rtc-1  | m=audio 0 RTP/AVP 96
go2rtc-1  | a=rtpmap:96 PCMU/8000
go2rtc-1  | a=control:trackID=0
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] client request:
go2rtc-1  | PLAY rtsp://172.168.115.22:554/unicast/c5/s1/live RTSP/1.0
go2rtc-1  | CSeq: 4
go2rtc-1  | Authorization: Digest username="admin", realm="6cf17e812039", nonce="1615629790", uri="rtsp://172.168.115.22:554/unicast/c5/s1/live", response="ee9912dda510191cdd5d68474523bc43"
go2rtc-1  | Session: 98
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] server request:
go2rtc-1  | SETUP rtsp://127.0.0.1:8554/test?audio&source=ffmpeg:test%23audio%3Dopus/trackID=0 RTSP/1.0
go2rtc-1  | User-Agent: go2rtc/ffmpeg
go2rtc-1  | Transport: RTP/AVP/TCP;unicast;interleaved=0-1
go2rtc-1  | Cseq: 3
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Session: 80731198;timeout=60
go2rtc-1  | Transport: RTP/AVP/TCP;unicast;interleaved=0-1
go2rtc-1  | Cseq: 3
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] server request:
go2rtc-1  | PLAY rtsp://127.0.0.1:8554/test?audio&source=ffmpeg:test%23audio%3Dopus RTSP/1.0
go2rtc-1  | Range: npt=0.000-
go2rtc-1  | Cseq: 4
go2rtc-1  | User-Agent: go2rtc/ffmpeg
go2rtc-1  | Session: 80731198
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.508 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 4
go2rtc-1  | Session: 80731198
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.574 TRC [rtsp] client response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 4
go2rtc-1  | Session: 98
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.681 TRC [rtsp] server request:
go2rtc-1  | OPTIONS rtsp://127.0.0.1:8554/8e5c2b7686909cebfd4415374625e059 RTSP/1.0
go2rtc-1  | Cseq: 1
go2rtc-1  | User-Agent: ffmpeg/go2rtc
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.681 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Public: OPTIONS, SETUP, TEARDOWN, DESCRIBE, PLAY, PAUSE, ANNOUNCE, RECORD
go2rtc-1  | Cseq: 1
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.724 TRC [rtsp] server request:
go2rtc-1  | ANNOUNCE rtsp://127.0.0.1:8554/8e5c2b7686909cebfd4415374625e059 RTSP/1.0
go2rtc-1  | Content-Type: application/sdp
go2rtc-1  | Cseq: 2
go2rtc-1  | User-Agent: ffmpeg/go2rtc
go2rtc-1  | Content-Length: 183
go2rtc-1  | 
go2rtc-1  | v=0
go2rtc-1  | o=- 0 0 IN IP4 127.0.0.1
go2rtc-1  | s=go2rtc/1.9.7
go2rtc-1  | c=IN IP4 127.0.0.1
go2rtc-1  | t=0 0
go2rtc-1  | a=tool:libavformat 60.16.100
go2rtc-1  | m=audio 0 RTP/AVP 96
go2rtc-1  | b=AS:64
go2rtc-1  | a=rtpmap:96 opus/48000/2
go2rtc-1  | a=control:streamid=0
go2rtc-1  | 
go2rtc-1  | 19:57:14.724 TRC [rtsp] server response:
go2rtc-1  | RTSP/1.0 200 OK
go2rtc-1  | Cseq: 2
go2rtc-1  | 
go2rtc-1  | 
go2rtc-1  | 19:57:14.724 TRC [rtsp] server request:
go2rtc-1  | SETUP rtsp://127.0.0.1:8554/8e5c2b7686909cebfd4415374625e059/streamid=0 RTSP/1.0
go2rtc-1  | Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=record
go2rtc-1  | Cseq: 3
go2rtc-1  | User-Agent: ffmpeg/go2rtc
@dagleaves dagleaves changed the title No video producer with backchannel? No video producer with backchannel? (Uniview/Zuum) Jan 29, 2025
@AlexxIT AlexxIT added the question Further information is requested label Jan 30, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 30, 2025

  1. It's an expected situation that some cameras glitch in backchannel mode. Especially noname brand cameras. I've seen problems even with Dahua cameras.
  2. Show stream probe with backchannel turned off.
  3. If the camera only shows keyframes in WebRTC mode, it may have B-frames. Such frames are only supported in MSE mode.

@dagleaves
Copy link
Author

MSE does the same thing, only keyframes, so must not be B-frames issue. MSE works fine with H265, seems to be isolated to when the camera is set to H264.

Probe w/ Backchannel Disabled

{
  "producers": [
    {
      "id": 2,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "172.168.115.22:554",
      "url": "rtsp://admin:[email protected]:554/unicast/c5/s1/live",
      "sdp": "v=0\r\no=- 63 1 IN IP4 172.168.115.22\r\ns=ONVIF RTSP Server\r\nc=IN IP4 172.168.115.22\r\nm=video 0 RTP/AVP 105\r\na=rtpmap:105 H264/90000\r\na=fmtp:105 packetization-mode=1;profile-level-id=4D001F;sprop-parameter-sets=Z00AH52oFAFuhAAAD6QAAw4KEA==,aOqPIA==\r\na=framerate:25\r\na=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/video\r\nm=audio 0 RTP/AVP 0\r\na=rtpmap:0 PCMU/8000\r\na=control:rtsp://172.168.115.22:554/unicast/c5/s1/live/audio\r\n",
      "user_agent": "go2rtc/1.9.7",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, PCMU/8000"
      ],
      "receivers": [
        {
          "id": 3,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video",
            "level": 31,
            "profile": "Main"
          },
          "childs": [
            4
          ],
          "bytes": 137611,
          "packets": 120
        },
        {
          "id": 6,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "childs": [
            7,
            10
          ],
          "bytes": 2560,
          "packets": 5
        }
      ],
      "bytes_recv": 141671
    },
    {
      "id": 8,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "127.0.0.1:55840 forwarded 127.0.0.1:8554",
      "source": "exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i rtsp://127.0.0.1:8554/test?audio\u0026source=ffmpeg:test%23audio%3Dopus -c:a libopus -application:a lowdelay -min_comp 0 -vn -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/8e5c2b7686909cebfd4415374625e059",
      "url": "rtsp://127.0.0.1:8554/test?audio\u0026source=ffmpeg:test%23audio%3Dopus",
      "sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=go2rtc/1.9.7\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat 61.1.100\r\nm=audio 0 RTP/AVP 96\r\nb=AS:64\r\na=rtpmap:96 opus/48000/2\r\na=control:streamid=0\r\n",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        {
          "id": 9,
          "codec": {
            "channels": 2,
            "codec_name": "opus",
            "codec_type": "audio",
            "sample_rate": 48000
          },
          "childs": [
            11
          ]
        }
      ]
    }
  ],
  "consumers": [
    {
      "id": 5,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "127.0.0.1:55830",
      "source": "ffmpeg:test#audio=opus",
      "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.9.7\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 96\r\na=rtpmap:96 PCMU/8000\r\na=control:trackID=0\r\n",
      "user_agent": "go2rtc/ffmpeg",
      "medias": [
        "audio, sendonly, ANY"
      ],
      "senders": [
        {
          "id": 7,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 6,
          "bytes": 2560,
          "packets": 5
        }
      ],
      "bytes_send": 2640
    },
    {
      "id": 1,
      "format_name": "probe",
      "protocol": "http",
      "remote_addr": "[::1]:50844",
      "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, ALL",
        "audio, sendonly, ALL",
        "audio, recvonly, ANY"
      ],
      "senders": [
        {
          "id": 4,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video",
            "level": 31,
            "profile": "Main"
          },
          "parent": 3,
          "bytes": 137611,
          "packets": 120
        },
        {
          "id": 10,
          "codec": {
            "codec_name": "pcm_mulaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 6
        },
        {
          "id": 11,
          "codec": {
            "channels": 2,
            "codec_name": "opus",
            "codec_type": "audio",
            "sample_rate": 48000
          },
          "parent": 9
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants