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 low quality audio after RTMP->RTC transcoding #2673

Closed
streamthing opened this issue Oct 13, 2021 · 6 comments
Closed

WebRTC low quality audio after RTMP->RTC transcoding #2673

streamthing opened this issue Oct 13, 2021 · 6 comments
Assignees
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Milestone

Comments

@streamthing
Copy link

streamthing commented Oct 13, 2021

Description'

Please ensure that the markdown structure is maintained.
RTMP -> WebRTC transcoding provides low audio quality.
There is no option to change opus bitrate in rtmp_to_rtc function.
I provide 256kbps AAC audio via RTMP. Diffrence between RTMP and WebRTC is hearable.

  1. SRS version: SRS/4.0.177(Leo) - Docker build
  2. The configuration of SRS is as follows:
rtc_server {
    enabled on;
    listen 8000;
    candidate $CANDIDATE;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        rtmp_to_rtc on;
        rtc_to_rtmp off;
    }
}

Replay

  1. Open music RTMP Stream
  2. Open music WebRTC Stream
  3. Compare between RTMP and WebRTC streams

Expect
Option to change opus bitrate or best audio quality.

TRANS_BY_GPT3

@streamthing
Copy link
Author

Looks it's around 64kbps?
obraz

@winlinvip winlinvip self-assigned this Oct 15, 2021
@winlinvip winlinvip added the WebRTC WebRTC, RTC2RTMP or RTMP2RTC. label Oct 15, 2021
@winlinvip winlinvip added this to the 5.0 milestone Oct 15, 2021
@winlinvip
Copy link
Member

SRS transcode AAC to OPUS, which is low bitrate.

So the quality is not good enough? Please attach an example file?

@streamthing
Copy link
Author

streamthing commented Oct 15, 2021

Opus can provide max bitrate ~450kbps.
We need at least 192kbps for music streams with Opus.
Audio quality is very poor with 64kbps.

Configuration should be able to change the bitrate depending on the application (voice / music)

Here you can setup bitrate of Opus transcoding - https://github.com/AirenSoft/OvenMediaEngine/blob/master/misc/conf_examples/Server.xml#L250

@streamthing
Copy link
Author

@winlinvip
I tested and can confirm that changing this parametres in trunk/src/app/srs_app_rtc_codec.cpp

Line 239: enc_->bit_rate = 160000; (160Kbps)
Line 244: enc_->compression_level = 8;

Solves problem with bad audio.
Could you add this options to change in .conf file?

@xiaozhihong
Copy link
Collaborator

@winlinvip I tested and can confirm that changing this parametres in trunk/src/app/srs_app_rtc_codec.cpp

Line 239: enc_->bit_rate = 160000; (160Kbps)
Line 244: enc_->compression_level = 8;

Solves problem with bad audio. Could you add this options to change in .conf file?

Good idea, using config solve it.

@winlinvip
Copy link
Member

Fixed by #3515

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT. WebRTC WebRTC, RTC2RTMP or RTMP2RTC.
Projects
None yet
Development

No branches or pull requests

3 participants