What is the ffmpeg command to record screen and internal audio (on Ubuntu 18.04)?
I'll omit the many things I tried that did not work and skip to the something close to what I am looking for;
V="$(xdpyinfo | grep dimensions | perl -pe 's/.* ([0-9]+x[0-9]+) .*/$1/g')"
A="$(pacmd list-sources | grep -PB 1 "analog.*monitor>" | head -n 1 | perl -pe 's/.* //g')"
F="$(date --iso-8601=minutes).mkv"
ffmpeg -video_size "$V" -framerate 10 -f x11grab -i :0.0 -f pulse -ac 2 -i "$A" "$F"
I can get video but no audio.
parecord -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor example.wav # index: 1
will get audio.
.monitor
source. soecho $A
, startpavucontrol
, verify that the sink corresponding to it is the one that gets the sound. Next step is to verify that you can record from it with some other program, e.g.parecord
. Next step is to tryffmpeg
to record only audio.