I found many answers on the subject, but no one works for me. Would you give me directions or working examples of how it works. It may be useful to other people in future
1. Choose audio
You can use pavucontrol to choose which audio source
ffmpeg will record, such as "desktop" or microphone. This is explained in Capturing ONLY desktop audio with
ffmpeg to stream to YouTube:
ffmpeg -f x11grab -framerate 30 -video_size 1280x720 -i :0.0 -f pulse -i default -c:v libx264 -preset fast -cfr 26 -maxrate 2500k -bufsize 5000k -g 60 -vf format=yuv420p -c:a aac -b:a 128k -f flv rtmp://youtube
--enable-libpulse, and therefore no pulse input device, you can try replacing
-f pulse -i defaultwith
-f alsa -i pulseto use the ALSA input device instead.
Don't just copy and paste the example: you'll need to choose an appropriate
-bufsize. See FFmpeg Wiki: Encoding for Streaming Sites for more info.