I am currently using FFMPEG to stream on a virtual CENTOS server. I use the following script to stream to youtube live.
ffmpeg -re -i program.01.mp4 -flags +global_header -acodec libmp3lame -ac 1 -ar 44100 -ab 192k -s 1280x720 -vcodec libx264 -pix_fmt yuv420p -g 60 -vb 1700k -profile:v baseline -preset:v faster -r 30 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxxx"
I previously used the very same FFMPEG stream script to stream on a dedicated CENTOS server for over a year, with no technial issues.
I tried to use the very same FFMPEG script on the virtualized server. When I use 1700k encoding speed - I get the following error in the output:
[flv @ 0x56da380] Failed to update header with correct duration. [flv @ 0x56da380] Failed to update header with correct filesize.
The YouTube ingestor also complains that the input stream (coming from the CENTOS server) is slow and that the stream will buffer.
I have checked the available output bandwidth that virtual CENTOS server has access to.
- Download: 57.12 Mbit/s
- Upload: 96.57 Mbit/s
I am forced to use a much lower video encoding speed and output size
ffmpeg -re -i program.01.mp4 -f-flags +global_header -acodec libmp3lame -ac 1 -ar 44100 -ab 128k -s 640x360 -vcodec libx264 -pix_fmt yuv420p -g 60 -vb 425k -profile:v baseline -preset:v faster -r 30 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxxx"
I’m at a loss to understand what the problem could be since I have access to more than enough required bandwidth.