kazam no sound and no rectangular red border during screencast in ubuntu 20.04
kazam worked fine on ubuntu 19.04, recording audio and video, and showing the red rectangular border during screencast recording;
after installing ubuntu 20.04, kazam (from the repository) records video with no sound and does not show the red border as a visual cue so you know which part of screen is recorded
I looked at pavucontrol and nothing is muted, the sound is fine, it is just that kazam is not recording the sound
Also, going to File-Preferences in Kazam, in the General tab, the speaker sound is set to off. I can set it on, to max even, but there is no OK or Apply button, so as soon as I close this dialog, upon returning, the speaker sound shows again off as before. And recording with this dialog open and the sound set to max in the dialog, still has no effect, video is recorded muted.
I tried editing the
~/.config/kazam/kazam.conf
file manually and set audio_toggled = True and restarted kazam but there was no effect
this is probably not related, but sure doesn't help, that in ubuntu 18.04, installing alsa-utils made available the really nifty and useful text-based commandline audio control/config tool
alsamixer
where you could use arrow keys to adjust the volume of the speakers, headphone etc. The alsamixer from alsa-utils in 20.04 seems to have taken all those options away and seems to have no way of visualizing or adjusting any volumes. Wish I could have the alsamixer from 18.04 that was so much more useful. Here is what alsamixer used to look like:
Probable solution to audio problem at #8, #12 of https://bugs.launchpad.net/kazam/+bug/1875530
the fix is to modify this file:
/usr/lib/python3/dist-packages/kazam/pulseaudio/pulseaudio.py
and replace
time.clock()
with
time.perf_counter()
in all 8 places
I tried xvidcap which I used to use before kazam, but after building it from source, I found it records each frame in a separate xwd file. So the solution appears to be to give up on kazam, just like on xvidcap.
I found that ffmpeg can be used to record a screencast like this. First, find out the screen resolution
xrandr
next, find out the audio source - we are looking for the number of the source that says alsa_output
pactl list sources
then start the screencast
ffmpeg -video_size 1920x1080 -framerate 20 -f x11grab -i :0.0 -f pulse -ac 2 -i 4 output.mp4
in this command, 1920x1080 is the screen resolution output from xrandr
-i 4 is the source number of alsa_output from pactl list sources
-ac 2 set 2 audio channels
-f pulse expected format is pulse audio
-i :0.0 video input from main screen
-f x11grab video input format is X server output format
the video is saved in output.mp4 and to stop the screencast, go to the terminal window and control-C