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 mode crackling sound #361

Closed
spawn451 opened this issue Apr 17, 2023 · 7 comments
Closed

WebRTC mode crackling sound #361

spawn451 opened this issue Apr 17, 2023 · 7 comments
Labels
audio bug Something isn't working webrtc

Comments

@spawn451
Copy link

spawn451 commented Apr 17, 2023

I use the Reolink Video Doorbell, when I use the WebRTC stream the sound crackles on the other hand in MSE mode no worries.

Is this normal? My setup is as follows:

  reolink:
    - rtsp://admin:password@192.168.10.51:554/Preview_01_sub
    - ffmpeg:reolink#audio=opus
@AlexxIT AlexxIT added the question Further information is requested label Apr 19, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 19, 2023

Show stream info json from go2rtc WebUI when you have "crackling" sound.
Can you recognize speech in that crackling sound? Or it totally broken?

@AlexxIT AlexxIT added stream info and removed question Further information is requested labels Apr 19, 2023
@spawn451
Copy link
Author

spawn451 commented Apr 19, 2023

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.10.51/Preview_01_sub/",
      "remote_addr": "192.168.10.51:554",
      "user_agent": "go2rtc/1.3.2",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "audio, sendonly, PCMA/8000"
      ],
      "receivers": [
        "96 H264, bytes=211079, senders=1",
        "97 MPEG4-GENERIC/16000, bytes=47988, senders=1"
      ],
      "recv": 262355
    },
    {
      "type": "RTSP passive producer",
      "url": "rtsp://localhost:8554/17da9f1c85babdeda8625479775390c0",
      "remote_addr": "[::1]:35802",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, PCMA/8000"
      ],
      "receivers": [
        "8 PCMA/8000, bytes=47088, senders=1"
      ],
      "recv": 48248
    }
  ],
  "consumers": [
    {
      "type": "RTSP passive consumer",
      "url": "rtsp://localhost:8554/reolink?audio",
      "remote_addr": "[::1]:40354",
      "user_agent": "go2rtc/ffmpeg",
      "medias": [
        "audio, sendonly, ANY"
      ],
      "senders": [
        "96 MPEG4-GENERIC/16000, bytes=47988, receivers=1"
      ],
      "send": 49476
    },
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "udp4 host 192.168.10.58:52433",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.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"
      ],
      "senders": [
        "96 H264, bytes=211079, receivers=1",
        "8 PCMA/8000, bytes=47088, receivers=1"
      ],
      "send": 262175
    }
  ]
}

Yes, but it sounds metallic

@swbouman
Copy link

swbouman commented Apr 20, 2023

same issue here. audio is horrible, but I can hear the bird. On my YouTube stream, decoded with ffmpeg I putted a noise cancelling filter on top of the stream. Then the sound is gone.

{
  "producers": [
    {
      "type": "RTSP source",
      "url": "rtsp://192.168.178.61/0",
      "remote_addr": "192.168.178.61:554",
      "user_agent": "go2rtc/1.2.0",
      "medias": [
        "video, sendonly, 96 H264/90000",
        "audio, sendonly, 104 MPEG4-GENERIC/48000"
      ],
      "tracks": [
        "96 H264/90000, sinks=3",
        "104 MPEG4-GENERIC/48000, sinks=3"
      ],
      "recv": 1211461163
    },
    {
      "type": "RTSP source",
      "url": "rtsp://localhost:8554/48cb56f59a21ada0aa5c6aa2e3e42cb1",
      "remote_addr": "127.0.0.1:46366",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, sendonly, 96 OPUS/48000/2"
      ],
      "tracks": [
        "96 OPUS/48000/2, sinks=1"
      ],
      "recv": 1310219
    }
  ],
  "consumers": [
    {
      "type": "RTSP client",
      "url": "rtsp://127.0.0.1:8554/Vogelhuis?video=copy\u0026audio=aac",
      "remote_addr": "127.0.0.1:48332",
      "user_agent": "FFmpeg Frigate/0.12.0-da3e197",
      "medias": [
        "video, recvonly, 96 H264/90000",
        "audio, recvonly, 97 MPEG4-GENERIC/48000"
      ],
      "tracks": [
        "96 H264/90000, sinks=3",
        "97 MPEG4-GENERIC/48000, sinks=3"
      ],
      "send": 1211461163
    },
    {
      "type": "RTSP client",
      "url": "rtsp://192.168.178.7:8554/Vogelhuis",
      "remote_addr": "192.168.178.7:37602",
      "user_agent": "Lavf58.45.100",
      "medias": [
        "video, recvonly, 96 H264/90000",
        "audio, recvonly, 97 MPEG4-GENERIC/48000"
      ],
      "tracks": [
        "96 H264/90000, sinks=3",
        "97 MPEG4-GENERIC/48000, sinks=3"
      ],
      "send": 2642664022
    },
    {
      "type": "RTSP client",
      "url": "rtsp://localhost:8554/Vogelhuis?audio",
      "remote_addr": "127.0.0.1:46356",
      "user_agent": "go2rtc/ffmpeg",
      "medias": [
        "audio, recvonly, 96 MPEG4-GENERIC/48000"
      ],
      "tracks": [
        "96 MPEG4-GENERIC/48000, sinks=3"
      ],
      "send": 1252592
    },
    {
      "type": "WebRTC client",
      "remote_addr": "udp4 prflx 192.168.178.20:49615 related :0",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4.1 Safari/605.1.15",
      "send": 63049708
    }
  ]
}

@AlexxIT AlexxIT added bug Something isn't working and removed stream info labels Apr 20, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 20, 2023

Well. Both you transcoding AAC to PCMA or OPUS for WebRTC.
I think we need to work with the ffmpeg settings. Maybe can find better ones.

@swbouman
Copy link

swbouman commented Apr 20, 2023

Hey Alexx,

For YouTube I use the following command to reduce noise: -af "afftdn=nr=10:nf=-40:tn=1"

Hope this points in the right direction. I need to transcode the audio, because camera is only producing AAC sound.

btw this is the YouTube link ;) https://www.youtube.com/live/W_GfyJm-gNk?feature=share

@AlexxIT
Copy link
Owner

AlexxIT commented Jul 11, 2023

@AlexxIT AlexxIT closed this as completed Jul 11, 2023
@spawn451
Copy link
Author

Thanks, issue fixed!

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

No branches or pull requests

3 participants