srs WebRTC low quality audio after RTMP->RTC transcoding

vx6bjr1n  于 2022-12-31  发布在  其他
关注(0)|答案(5)|浏览(224)

描述(Description)
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. SRS的配置如下(Config):
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.

tvmytwxo

tvmytwxo1#

Looks it's around 64kbps?

q9rjltbz

q9rjltbz2#

SRS transcode AAC to OPUS, which is low bitrate.

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

hmtdttj4

hmtdttj43#

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

bihw5rsg

bihw5rsg4#

@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?

a0x5cqrl

a0x5cqrl5#

@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.

相关问题