[FFmpeg-user] Distorted audio in screencast

LANGLOIS Olivier PIS -EXT olivier.pis.langlois at transport.alstom.com
Thu Apr 17 22:04:40 CEST 2014

> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of Cecil Westerhof
> Sent: Thursday, April 17, 2014 1:42 PM
> To: ffmpeg-user at ffmpeg.org
> Subject: [FFmpeg-user] Distorted audio in screencast
> I have a problem with a zooming sound:
>     https://www.facebook.com/photo.php?v=619250241480694
> I did not have this in the past as far as I know. But this can also be because in
> the past I only used the microphone of the web-cam (and on another
> computer). Which is a Logitech, Inc. Webcam Pro 9000.
> The command I use is:
> ffmpeg -async 1                         \
>        -f alsa                          \
>        -i "plughw:1"                    \
>        -f x11grab -s "800x600"          \
>        -r 25                            \
>        -i :0.0                          \
>        -acodec libmp3lame               \
>        -ac 1                            \
>        -ar 22050                        \
>        -ab 64k                          \
>        -qscale:video 4                  \
>        testing.avi
> Also sometimes the audio is a little out of sync and there are sometimes
> sharp sounds. What should I change?
ffmpeg inputs are opened sequentially. I have found that opening slow input devices first could help with AV sync. OTOH, if I understand correctly your setup, you display a webcam output on screen and grab that with x11grab. This for sure add some latency in the video signal. There must be a way to manually add a ts offset on the cmdline to compensate for that.

I think that your sharp sounds are caused by saturation. If you had ALSA buffer overruns, ffmpeg would report it and it sounds more like clipping. There are 2 things that I can think that you can play with fix this problem:

1. Check your mic preamp level with the alsamixer app.
2. Use "hw:1" instead of "plughw:1" to let ffmpeg do the signal adaptation.

What plughw is doing is to ask ALSA to adapt device hw params to what the app is asking (sampling rate, bits per sample, etc). You could check if ffmpeg is handling this better.

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

More information about the ffmpeg-user mailing list