ChillingVan / AndroidInstantVideo

展现Android硬编码下的视频数据流动,可以对视频做处理,例如加滤镜,加水印等,做直播推流(用RTMP)。 Show the stream of Android video hardware encode, including video processing and video publishing by RTMP.
Apache License 2.0
718 stars 196 forks source link

Stream RTMP Problem #21

Open chentengming opened 6 years ago

chentengming commented 6 years ago

Black screen appears on the push stream and the sound is not continuous, Thanks.

ChillingVan commented 6 years ago

The not continuous could be caused by echo. Could you provide some advise?

ulongx commented 1 year ago

消除回声可以用 AcousticEchoCanceler @ChillingVan 在 mAudioRecord.startRecording() 之前执行

// 消除回声导致的滋啦滋啦声音
if (AcousticEchoCanceler.isAvailable()) {
    aec = AcousticEchoCanceler.create(mAudioRecord.getAudioSessionId());
    if (aec != null) {
        aec.setEnabled(true); //android 11 issue low volume
    }
}
if (AutomaticGainControl.isAvailable()) {
    agc = AutomaticGainControl.create(mAudioRecord.getAudioSessionId());
    if (agc != null) {
        agc.setEnabled(true);
    }
}

mAudioRecord.startRecording();
mMediaCodec.start();