srs WebRTC: 使用FFmpeg内置opus编码,音频aac转opus时滋滋爆音

yzckvree  于 2022-10-27  发布在  其他
关注(0)|答案(1)|浏览(449)

Description(描述)

只要使用FFmpeg内置opus,就一定爆音,这个可以重现;

Patch Commit ID: 8d61c2a

SRS Version(版本): develop v5.0.36

  1. 编译FFmpeg
  • 使用FFmpeg内置opus: --enable-decoder=opus --enable-encoder=opus
  • 使用libopus库: --enable-libopus
  1. SRS Config(配置):
listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

http_api {
    enabled         on;
    listen          1985;
}

rtc_server {
    enabled on;
    listen 8000; # UDP port
    # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
    #candidate $CANDIDATE;
    candidate 10.254.44.205;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
}

Replay(重现)

Please describe how to replay the bug? (重现Bug的步骤)

  1. rtmp推流:
    ffmpeg -stream_loop -1 -re -i 264_aac_basline_48k.mp4 -c copy -f flv "rtmp://127.0.0.1/live/livestream"
  2. rtc播放,打开播放器 https://127.0.0.1/players/rtc_player.html ,播放:
    https://127.0.0.1/players/rtc_player.html

Expect(期望行为)

rtc播放正常

slmsl1lt

slmsl1lt1#

更改opus库后,得删除FFmpeg了重新编译:

rm -rf objs/ffmpeg/*
./configure 
make

相关问题