Remove:
-profile:v high -level 4.0
- You don't need to set a profile or level because you're not targeting any specific, limited, or outdated devices. These options don't matter because YouTube is going to re-encode whatever you give it and set its own profile and level.
-pix_fmt yuv420p
- You can let YouTube deal with the pixel format.
-bf 2 -coder 1
- These are already handled automatically by -preset
.
-b:v 15M
- This is mutually exclusive with -crf
. Just use -crf
instead. It will let you set the quality instead of you trying to apply an arbitrary bitrate.
-ar 48000 -ac 2
- No need to change the audio rate or channel layout. If you do what to change those do it via the dshow -sample_rate
and -channels
input options.
So your command can look like:
ffmpeg -f gdigrab -framerate 60 -i desktop -f dshow -i audio="Microphone (2- Realtek Audio)" -c:v libx264rgb -preset slow -crf 18 -b:a 384k output.mp4
- The input is RGB, so you can avoid the RGB to YUV conversion by using
-c:v libx264rgb
.
- If your computer can handle it then consider using a slower
-preset
.
- You can use flac or libopus for audio (change
output.mp4
to output.mkv
), but for microphone it will hardly matter.
- You can try
-crf 17
if you think you can see a difference. I wouldn't bother with the huge file increase from using lossless (-crf 0
).
- You can see if dshow is faster than gdigrab for capturing the desktop. I don't use Windows so I can't test for you.
Note that a non-FFmpeg based player may not be able to decode the file, but I'm fairly certain YouTube will have no issues with it.