[FFmpeg-user] Trouble capturing speaker audio with video on Ubuntu 20.04

Bo Berglund bo.berglund at gmail.com
Thu Feb 25 02:02:16 EET 2021


I am transfering a streaming video recorder program from Windows to Ubuntu Linux
and I am having trouble capturing video and audio together.

When I run ffmpeg commands using the following arguments I get only the audio
coming in to the microphone, which includes the ambient sound plus the output
from the laptop speaker as listened to by the laptop microphone. Really bad
quality...

-f pulse -i default
-f alsa -i hw:0

When I use this I get no audio at all:

-f pulse -i alsa_output.pci.....analog-stereo-monitor

the i parameter is really long and is retrieved using the command:

pacmd list-sources


On Windows I use this full capture command and it works fine:

ffmpeg -hide_banner -f gdigrab -framerate 25 -offset_x 1042 -offset_y 228
-video_size 854x480 -i desktop  -f dshow -i audio="virtual-audio-capturer"
-vcodec libx264 -pix_fmt yuv420p -t 3600 test.mp4

But this does not work on Ubuntu of course...

I can supply more details if you tell me what is needed.
I am writing this on Windows and the Linux computer is a bit difficult to reach
for copying command results etc....
But it can be done if I am given instructions on what is needed to find out the
proper command.


-- 
Bo Berglund
Developer in Sweden



More information about the ffmpeg-user mailing list