前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >pjsip webrtc-aec3如何开启

pjsip webrtc-aec3如何开启

原创
作者头像
呱牛笔记
发布2023-04-25 16:40:27
1.1K0
发布2023-04-25 16:40:27
举报
文章被收录于专栏:呱牛笔记呱牛笔记

1、开启webrtc-aec3,configure脚本开启--enable-libwebrtc-aec3

代码语言:javascript
复制
./configure --host=arm-openwrt-linux-muslgnueabi  --prefix=$PWD/install  --disable-libwebrtc --disable-libyuv --disable-v4l2   --disable-opencore-amrnb --disable-speex-codec --disable-speex-aec --with-openh264=/home/lyz/work/broadcast_app/app/thirds_libs_src/pjproject-2.12.1/third_party/openh264-2.3.1  --enable-libwebrtc-aec3 --with-opus=/home/lyz/work/broadcast_app/app/thirds_libs_src/pjproject-2.12.1/third_party/opus/ 

修改third_party\build\os-auto.mak

修改前:

代码语言:javascript
复制

ifneq (1,1)
ifeq (0,1)
# External webrtc AEC3
else
DIRS += webrtc_aec3
WEBRTC_AEC3_OTHER_CFLAGS = -fexceptions 
ifneq ($(findstring sse2,),)
    export WEBRTC_AEC3_SRC = \
	common_audio/resampler/sinc_resampler_sse.o \
	common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.o
    export WEBRTC_AEC3_SRC += \
	common_audio/resampler/sinc_resampler_avx2.o \
	modules/audio_processing/aec3/adaptive_fir_filter_erl_avx2.o \
	modules/audio_processing/aec3/adaptive_fir_filter_avx2.o \
	modules/audio_processing/aec3/fft_data_avx2.o \
	modules/audio_processing/aec3/matched_filter_avx2.o \
	modules/audio_processing/aec3/vector_math_avx2.o \
	modules/audio_processing/agc2/rnn_vad/rnn_vector_math_avx2.o
    WEBRTC_AEC3_OTHER_CFLAGS += -mfma
else ifneq ($(findstring neon,),)
    export WEBRTC_AEC3_SRC = \
	common_audio/resampler/sinc_resampler_neon.o \
	common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.o
    WEBRTC_AEC3_OTHER_CFLAGS += -DWEBRTC_HAS_NEON
endif
endif
endif

修改后:

代码语言:javascript
复制

ifneq (,1)
ifeq (0,1)
# External webrtc AEC3
else
DIRS += webrtc_aec3
WEBRTC_AEC3_OTHER_CFLAGS = -fexceptions -mfpu=neon -mfloat-abi=hard -DWEBRTC_LINUX=1  -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX=1
ifneq ($(findstring sse2,sse2),)
#    export WEBRTC_AEC3_SRC = \
#	common_audio/resampler/sinc_resampler_sse.o \
#	common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.o
#    export WEBRTC_AEC3_SRC += \
#	common_audio/resampler/sinc_resampler_avx2.o \
#	modules/audio_processing/aec3/adaptive_fir_filter_erl_avx2.o \
#	modules/audio_processing/aec3/adaptive_fir_filter_avx2.o \
#	modules/audio_processing/aec3/fft_data_avx2.o \
#	modules/audio_processing/aec3/matched_filter_avx2.o \
#	modules/audio_processing/aec3/vector_math_avx2.o \
#	modules/audio_processing/agc2/rnn_vad/rnn_vector_math_avx2.o
#    WEBRTC_AEC3_OTHER_CFLAGS += -mfma
else ifneq ($(findstring neon,sse2),)
    export WEBRTC_AEC3_SRC = \
	common_audio/resampler/sinc_resampler_neon.o \
	common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.o
    WEBRTC_AEC3_OTHER_CFLAGS += -DWEBRTC_HAS_NEON
endif
endif
endif

2、配置aec-3参数,启动配置文件中增加webrtc echo的配置

代码语言:javascript
复制
#webrtc echo
--ec-opt=4

3、开启回音消除后的效果;

4、如何将opus编码调到sdp协商的最开头,修改pjmedia_codec_register_audio_codecs 调整代码的注册顺序;

代码语言:javascript
复制

#if PJMEDIA_HAS_OPUS_CODEC
    /* Register OPUS */
    status = pjmedia_codec_opus_init(endpt);
    if (status != PJ_SUCCESS)
        return status;
#endif

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档