'How to change bitrate on ffmpeg stream?

After i saw a tutorial on youtube i tried to stream a radio 24/7 on youtube with a looping mp4 and azuracast. So far so good, but with a problem. I rend a VPS from vultr with ubuntu 18.4 , 1cpu 2gb ram, everything works smoothly but even if the down/up speeds of vps are more than 300mbps, i cant get my bitrate to run more than 2200kbps on streams, and end up with buffering if i try to raise that or no stream at all. I run the exact code written on tutorial. Is there anything i can do about it? (2 days since i started the stream, 2 times a pipe error and something with header ended the stream after 18 continuous hours of play). Im a newbie on ffmpeg and linux but im learning fast! Since i connect remotely i noticed that if i copy paste all the code together it doesnt recognise the ffmpeg / command so i had to copy paste half and each line after the ffmpeg command to work to check the error, because i cant find a way to write a log of it… Thanks in advance!


VBR=”2500k”
FPS=”24″
QUAL=”superfast”

YOUTUBE_URL=”rtmp://a.rtmp.youtube.com/live2″
KEY=”key”

VIDEO_SOURCE=”/root/Desktop/cat.mp4″
AUDIO_SOURCE=”http://ip/radio/8000/radio.mp3"


ffmpeg \
-re -f lavfi -i “movie=filename=$VIDEO_SOURCE:loop=0, setpts=N/(FRAME_RATE*TB)” \
-thread_queue_size 512 -i “$AUDIO_SOURCE” \
-map 0:v:0 -map 1:a:0 \
-map_metadata:g 1:g \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale:v 3 -b:a 320000 -bufsize 512k \
-f flv “$YOUTUBE_URL/$KEY”```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source