I am trying to record my Skype calls using ffmpeg
. I need to record audio (pulseaudio) & video (X). But it seems that it is a bit tricky…
For audio recording I want to use my Scarlet 2i4 audio interface that is listed as device number 10
in pulseaudio:
ziga@ziga-laptop:~$ pactl list short cards
2 alsa_card.pci-0000_00_1b.0 module-alsa-card.c
10 alsa_card.usb-Focusrite_Scarlett_2i4_USB-00 module-alsa-card.c
~$ pactl list short sinks
16 alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40 module-alsa-card.c s32le 4ch 44100Hz SUSPENDED
~$ pactl list short sources
24 alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40.monitor module-alsa-card.c s32le 4ch 44100HzSUSPENDED
25 alsa_input.usb-Focusrite_Scarlett_2i4_USB-00.analog-stereo module-alsa-card.c s32le 2ch 44100Hz IDLE
From this I can see that my desired card is a device 10
so I structured my ffmpeg command like this:
ffmpeg \
-f x11grab -s 1920x1080 -probesize 17M -r 30 -i :0.0+0+0 \
-f pulse -ac 2 -device 10 \
-output.mkv
where:
- 2nd line specifies all video input parameters (tested & working)
- 3rd line specifies all audio parameters (not working)
But when I execute the command I get error:
Output #0, pulse, to 'output.mkv':
Output file #0 does not contain any stream
Does anyone have any idea why? How can I record Skype sound?
ADD
@Gyan's suggestion although did not work it pointed me to the right direction.
I used parameter -device
instead of -i
. The later is an input parameter and if we specify a device number 10
it does not work. We have to specify an input that we can get using pactl list short sources
. So we can use source number 25
e.g.:
ffmpeg -f x11grab -s 1920x1080 -probesize 17M -r 30 -i :0.0+0+0 -f pulse -ac 2 -i 25 output.mkv
This runs but it only records one source which is my microphone. It completely ignores e.g Skype, audio player…
If I open pavucontrol
when running Skype and my audio player, pavucontroll
shows me these application streams:
How do I include "Skype" and "Deadbeef" streams into the recording?
Best Answer
Your pulse input still needs a
-i
option with an arg for ffmpeg to mark it as an input. A quick glance through the code suggests changing the 3rd line to below should work