FFMPEG 'tee' command discards frames from both streams
FFMPEG 'tee' command discards frames from both streams
FFMPEG is handling video input from RTMP, encoding it, and writing to a file while streaming online. When internet slows down, the live feed drops out briefly and duplicate frames appear locally. The issue isn't local processing speed but upload bandwidth limiting the process. You want local files to stay clean without duplicates, even if the stream quality suffers. Is there a method to prioritize local output quality and try streaming a copy when bandwidth is available, thus keeping local files pristine?
I possess a stream box with an RTMP server set up for receiving streams. On my gaming computer I run a minimal compression OBS instance that sends the feed to the box for processing before streaming. Environment settings are defined in a shell script, and the ffmpeg command runs like this: ffmpeg -loglevel $LOGLEVEL -analyzeduration $ANALYZEDUR -probesize $PROBESIZE -i rtmp://localhost/live/test -s "$INRES" -framerate "$FPS" -f tee -map 0 -flags +global_header -vcodec libx264 -g $GOP -keyint_min $GOPMIN -b:v $CBR -minrate $MINRT -maxrate $MAXRT -pix_fmt yuv420p -s $OUTRES -preset $QUALITY -acodec copy -threads $THREADS -strict normal -bufsize $BUFSIZE "[onfail=ignore:f=flv]output-$DATETIME.flv|[f=flv]rtmp://localhost/live/test2 which should wait a few seconds for me to get OBS streaming to rtmp://localhost/live/test; this saves the stream to the hard drive and streams it to rtmp://localhost/live/test2 which is picked up by a second ffmpeg instance ffmpeg -loglevel $LOGLEVEL -analyzeduration $ANALYZEDUR -probesize $PROBESIZE -i rtmp://localhost/live/test2 -s "$INRES" -framerate "$FPS" -f tee -map 0 -flags +global_header -vcodec copy -acodec copy -strict normal -bufsize $BUFSIZE "[f=flv]$WEBSITENUMBERONE|[f=flv]$OTHERSTREAMSITES"] which should take around 30 seconds."