After a lot of trial and error the solution below works pretty much perfectly. To make sure it runs 24/7 wrap it inside a service of some description.
This is with an up to date version of FFMPEG to include -stream_loop -1.
The background is an mp4 file.
http://localhost:3888
= an audio stream.
ffmpeg -stream_loop -1 -i $MYPATH/background/$background \
-i http://localhost:3888 -filter:a "volume=$volume" \
-r 24 -g 48 -pix_fmt yuv420p -x264-params keyint=48:min-keyint=48:scenecut=-1 \
-s $size -b:v $bitrate -b:a 128k -ar 44100 -acodec aac \
-vcodec libx264 -preset superfast -bufsize 960k -crf 28 -threads 2 \
-f flv rtmp://a.rtmp.youtube.com/live2/$key
Config File:
# Config File
background=out.mp4
size=1280x720
bitrate=1500k
key=----KEY----
volume=0.5
EDIT -- Old Solution below
So i have a solution.
ffmpeg -re -loop 1 -framerate 2 -i test1.jpg -i https://xxxxxxx:8443/live.ogg -c:a aac -s 2560x1440 -ab 128k -maxrate 2048k -bufsize 2048k -framerate 30 -g 60 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/xxxxxxxxxxxxx
The important parts are the
-re
at the start which deals with a buffering issue.
Then the
-framerate 2
between the "-loop 1" and the image. This works and i get a good clean high quality stream that does not buffer.
Hoped this helped!
Edit 1
ffmpeg -re -loop 1 -framerate 2 -i test1.jpg -i https://xxxxxxxxxxx:8443/live.ogg -c:a aac -s 2560x1440 -ab 128k -vcodec libx264 -pix_fmt yuv420p -maxrate 2048k -bufsize 2048k -framerate 30 -g 2 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/xxxxxxxxxxxxx
Ok So this updated version should fix almost all problems with the stream.
-vcodec libx264 -pix_fmt yuv420p
Changed to H.264 Codex Fixed that problem
-g 2
This fixes the final buffering issue.