If you are used to use OBS, well, if you just only want to stream your computer desktop screen to YoTube, you can just use ffmpeg.
Make sure you have ffmpeg downloaded and you can run it via CMD. Google it about how to install ffmpeg in Windows and how to run it in CMD.
Once you can run it using command prompt program, then run this command:
ffmpeg -f gdigrab -framerate 30 -i desktop -f lavfi -i anullsrc -c:v libx264 -preset veryfast -maxrate 2000k -bufsize 4000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMINGKEY
Make sure you change YOURSTREAMINGKEY with your actual key.
That command will stream your desktop without audio. The command to stream desktop audio is more complicated. But instead, I prefer to play an mp3 file while streaming my desktop. The command is this:
ffmpeg -f gdigrab -framerate 30 -i desktop -stream_loop -1 -i "C:/myaudio.mp3" -c:v libx264 -preset veryfast -maxrate 2000k -bufsize 4000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMINGKEY
Just in case you want to stream only a window of your application, such as Notepad, here is the code:
ffmpeg -f gdigrab -framerate 30 -i title=Untitled - Notepad -stream_loop -1 -i "C:/myaudio.mp3" -c:v libx264 -preset veryfast -maxrate 2000k -bufsize 4000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMINGKEY
Notes:
- Replace
Untitled - Notepadwith the exact title of the Notepad window (as shown in the window’s title bar). - If your Notepad document has a name, e.g.,
notes.txt - Notepad, use that full title. - Enclose the title in quotes if it contains spaces (e.g.,
title="notes.txt - Notepad").