kazam no sound and no red border for screencast 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.

I tried editing the

~/.config/kazam/kazam.conf 


file manually and set audio_toggled = True and restarted kazam but there was no effect
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