Skip to content

Bad audio quality when using WebRTC publisher #1908

Closed

Description

@zapf2000

Describe the feature

When publishing AV1 video via WebRTC the Opus sound is very bad.
It would be great if the audio bitrate can also be defined in web publisher.

Activity

  1. aler9 commented on Jun 24, 2023

    @aler9
    Member

    Hello, after meddling around with the WebRTC handshake i was able to force Opus to use the full band and respect a certain average bitrate. I used Chrome throughout the test.
    I developed a patch (#1985), please test it by using this nightly release and let me know if it works:

    [link removed]

  2. zapf2000 commented on Jun 25, 2023

    @zapf2000
    Author

    Hello, after meddling around with the WebRTC handshake i was able to force Opus to use the full band and respect a certain average bitrate. I used Chrome throughout the test. I developed a patch (#1985), please test it by using this nightly release and let me know if it works:

    mediamtx_v0.23.6-8-g982f882_darwin_amd64.tar.gz mediamtx_v0.23.6-8-g982f882_darwin_arm64.tar.gz mediamtx_v0.23.6-8-g982f882_linux_amd64.tar.gz mediamtx_v0.23.6-8-g982f882_linux_arm64v8.tar.gz mediamtx_v0.23.6-8-g982f882_linux_armv6.tar.gz mediamtx_v0.23.6-8-g982f882_linux_armv7.tar.gz mediamtx_v0.23.6-8-g982f882_windows_amd64.zip

    Hi and thank you for your work.
    I tested the enhancement in various scenarios. The quality is still very bad. It seems that echo cancelling option for webrtc is enabled by default. That causes music sound very bad. Here are some screenshots:

    publish settings
    player properties
    audio properties

    Perhaps it's neccessary to add some additional configuration options for audio publishing and playing.

  3. aler9 commented on Jun 25, 2023

    @aler9
    Member

    I'll add an option for disabling audio effects too.

    Meanwhile, please confirm that setting audio bitrate works as expected, you can check audio bitrate by opening about://webrtc-internals and checking tab "stats of outgoing stream, media=audio".

  4. zapf2000 commented on Jun 25, 2023

    @zapf2000
    Author

    Yes, I can confirm that the bitrate is set correctly for outbound-rtp audio. Works fine. I think the bad quality is related to enabled effects.

  5. aler9 commented on Jun 26, 2023

    @aler9
    Member

    i've added the option:

    [link removed]

  6. zapf2000 commented on Jun 27, 2023

    @zapf2000
    Author

    This seems to be solved. Sound is much better now. But there is a new issue with AV1 Video playback or encoding.
    Have a look at the video. Every 2 seconds, there seems to be a short interrupt. Looks like he tries to scale or re-scale.
    Also a problem on video: It does not playback on Chrome mobile devices, but AV1 is definitely supported (I tried in webm container with icecast server before). Perhaps the wrong AV1 encoding model is chosen by default. There are several ones, but not all supported by mobile devices.

    2023-06-27_20-38-19.mp4
  7. aler9 commented on Jun 27, 2023

    @aler9
    Member

    Regarding the AV1 bug, open a new issue, specify whether it's a regression or not and provide replication details.
    Furthermore, i've moved all codec selection-related code to client side, hence it should be really easy to hack the code and change things such as the AV1 profile.

  8. aler9 commented on Jul 1, 2023

    @aler9
    Member

    added in v0.23.7

  9. github-actions commented on Jan 3, 2024

    @github-actions
    Contributor

    This issue is being locked automatically because it has been closed for more than 6 months.
    Please open a new issue in case you encounter a similar problem.

  10. locked and limited conversation to collaborators on Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions