[FFmpeg-devel] Adding libspeexdsp's AEC to FFmpeg.

Paul B Mahol onemda at gmail.com
Tue Sep 4 10:45:22 EEST 2018


On 9/4/18, Arseniy Skvortsov <ettavolt at gmail.com> wrote:
> Hello,
>
> I'm trying to add AEC from libspeexdsp to libavfilter.
> Target use case: two Android smartphones recording audio, transmitting it
> with RTP to some processor, which cancels echo, adds a delay to sync with
> another video stream, mixes with music and outputs to a stereo system.
>
> First line of the log file attached shows the commandline I use for
> testing. What the filtergraph means: grab mono from USB webcam, pass it as
>
> 'record' to AEC, loopback 'cleaned' output with a frame delay as
> 'playback' for AEC, build a stereo output from a 'cleaned' output and a
> channel of silence.
> OFFTOPIC: Had to use ALSA directly because pulse demuxer has some weird
> delay problem (https://bbs.archlinux.org/viewtopic.php?id=239893).
>
> So far AEC already does something useful because positive
> self-amplification (or what's the term for this?) starts on a [slightly]
> larger volume then without this filter.
> Still, it doesn't remove the effect completely. I suspect, that it may be
> related to warnings
> [alsa @ 0x56554d388bc0] ALSA buffer xrun
> and FF_FILTER_FORWARD_STATUS_BACK_ALL dropping all queued frames when
> output isn't ready. How do you think, is it true?
>
> I've also explored possibility of adding webrtc-audio-processing's AEC,
> but for that I'd need to build a C/C++ wrapper. Of which I haven't found
> any example in FFmpeg's code. People out there say that it's better than
> libspeexdsp's. Plus Xiph seems to be very insisting on 'one-quartz
> recording & playback', while my use case is definitely nothing like this.
> What do you think about this?
>
> Any suggestions are welcome.

Try with input as files, not streams.


More information about the ffmpeg-devel mailing list