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

Webrtc frame skipping #789

Open
Ignattious opened this issue Dec 1, 2023 · 8 comments
Open

Webrtc frame skipping #789

Ignattious opened this issue Dec 1, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@Ignattious
Copy link

Ignattious commented Dec 1, 2023

Im seeing some weird behaviour using webrtc where I get frame skipping / stuttering every 2 seconds.

The issue isnt present when using mse whatsoever. Ive tried the default Frigate version of go2rtc and also updated to 1.8.4 with no change.

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://10.200.128.50:554/cam/realmonitor?channel=1\u0026subtype=0/",
      "remote_addr": "10.200.128.50:554",
      "user_agent": "go2rtc/1.8.4",
      "sdp": "v=0\r\no=- 2251940367 2251940367 IN IP4 0.0.0.0\r\ns=Media Server\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\na=control:*\r\na=packetization-supported:DH\r\na=rtppayload-supported:DH\r\na=range:npt=now-\r\nm=video 0 RTP/AVP 96\r\na=control:trackID=0\r\na=framerate:25.000000\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1;profile-level-id=4D0033;sprop-parameter-sets=Z00AM+kAeACH0IAAAfSAAGHBAgA=,aOqPIAA=\r\na=recvonly\r\nm=audio 0 RTP/AVP 8\r\na=control:trackID=5\r\na=rtpmap:8 PCMA/8000\r\na=sendonly\r\n",
      "medias": [
        "video, recvonly, H.264 Main 5.1",
        "audio, sendonly, PCMA/8000"
      ],
      "receivers": [
        "96 H264, bytes=165715478, senders=3"
      ],
      "recv": 167130230
    }
  ],
  "consumers": [
    {
      "type": "RTSP passive consumer",
      "url": "rtsp://127.0.0.1:8554/front",
      "remote_addr": "127.0.0.1:55208",
      "user_agent": "FFmpeg Frigate/0.12.1-367d724",
      "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=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1;profile-level-id=4D0033;sprop-parameter-sets=Z00AM+kAeACH0IAAAfSAAGHBAgA=,aOqPIAA=\r\na=control:trackID=0\r\n",
      "medias": [
        "video, sendonly, H264, H265",
        "audio, sendonly, MPEG4-GENERIC"
      ],
      "senders": [
        "96 H264, bytes=165715478, receivers=1"
      ],
      "send": 167591030
    },
    {
       "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "tcp4 prflx 10.200.120.253:54068 related :0",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, VP8, RTX, VP9, H264, AV1, RED, ULPFEC, FLEXFEC-03",
        "audio, sendonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000, L16, PCML"
      ],
      "senders": [
        "102 H264, bytes=113648791, receivers=1"
      ],
      "send": 114843212
    },
    {
      "type": "RTSP passive consumer",
      "url": "rtsp://10.200.128.100:8554/front",
      "remote_addr": "10.200.128.200:57216",
      "user_agent": "Lavf59.27.100",
      "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=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1;profile-level-id=4D0033;sprop-parameter-sets=Z00AM+kAeACH0IAAAfSAAGHBAgA=,aOqPIAA=\r\na=control:trackID=0\r\n",
      "medias": [
        "video, sendonly, H264, H265",
        "audio, sendonly, MPEG4-GENERIC"
      ],
      "senders": [
        "96 H264, bytes=71272938, receivers=1"
      ],
      "send": 72074346
    }
  ]
}
@Ignattious
Copy link
Author

Ignattious commented Dec 1, 2023

Just a quick update there is nothing in the chrome debug stats outside of:

total freezeduration 21.141
freezecount 109

I have ruled out any network or transport related issues. MSE/Websocket is buttery smooth.

No dropped frames are detected

@AlexxIT AlexxIT added the question Further information is requested label Dec 2, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 2, 2023

You should try to use go2rtc addon. I can see that WebRTC works for you via TCP. This is strange because for LAN connection it should be UDP. Maybe problem related to port forwarding for Frigate docker container.

@Ignattious
Copy link
Author

Ignattious commented Dec 2, 2023 via email

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 2, 2023

And also has problems? What's the bitrate of the stream?

@Ignattious
Copy link
Author

Ignattious commented Dec 2, 2023 via email

@Ignattious
Copy link
Author

Ignattious commented Dec 2, 2023 via email

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 2, 2023

This is hi bitrate and can be a problem real time streaming for WebRTC

@AlexxIT AlexxIT added bug Something isn't working and removed question Further information is requested labels Dec 7, 2023
@erenoglu
Copy link

I'm seeing similar behavior but on both MSE and WebRTC. I tried to disable audio transcoding as well but no change. My streams are transcoded to H264 (from H265 of camera) by go2rtc. To avoid any other posssibilities, I'm testing using go2rtc web interface on port 1984 using "stream" link to test.

All my 4K streams are stuttering like this, skipping frames on both MSE & RTC. On the exact same device, ie a Chromebook or a PC, if I launch VLC and point it to the RTSP stream of go2rtc, like rtsp://go2rtc_ip:8554/Cameraname then it plays flawlessly.
This confuses me as it happens in Chrome, Edge and even Thorium, while RTSP stream on VLC works perfectly fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants