Check out the MegaGlest Wiki! Anyone can be an editor, and we want you!
if you use pulseaudio you will need --enable-libpulse https://www.ffmpeg.org/ffmpeg-devices.html#pulse
ffmpeg -hwaccel cuvid -f pulse -ac 2 -i 0 -f x11grab -vsync passthrough -framerate 30 -video_size 1920*1080 -i :0.0+0,0 -c:v h264_nvenc -maxrate 1984k -bufsize 3968k -vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/mystreamkey