
The lower -bufsize means your stream has potential to be dropping inbetween low and high quality every second. You can also set the bitrate max and min with: -maxrate and -minrate. It wont be exactly 2 Megabits all the time but will be close, this is dependent on the -bufsize. Adjusting this will be dependent on your upload speed and the original quality of the video you are streaming.

b:v 2m is the target bitrate which is 2 Megabits (2,000 Kbps). YOURVIDEO.mp4 is the video that will be streamed, make sure you change it to your video file, including and depending on its location (/folder/anotherfolder/video.mp4 etc). ffmpeg -re -i YOURVIDEO.mp4 -c:v libx264 -b:v 2M -c:a copy -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 2100k -f flv rtmp://a./live2/YOUTUBESTREAMKEY My post about restreaming an m3u8 link to YouTube Live can be found here.

Read the docs to learn more and/or understand the commands used. There are many configuration options but here is what i found works best. Here is a method to live stream a mp4 video file to YouTube with FFmpeg.
