ffmpeg -i <input file> -hide_banner -y -c:a aac -ar 48000 -c:v h264 -profile:v baseline -crf 20 -sc_threshold 0 -pix_fmt yuv420p -hls_time 10 -strict -2 -vsync 2 -vf scale=w=XXX:h=XXX -b:v 800k -maxrate XXXk -bufsize 1200k -b:a 96k -hls_time 10 -f hls -hls_list_size 0 <output file>
Replace XXXs for scale settings to match your mediaplayer. Preferable to use an autoscaler on upper-medium settings first and let it process heavier resolutions in background. Maxrate of 1000k-1200k should work fine in most cases - keeping note that bufsize is set to 1200k.
Can get stuck every now and then. Use health monitor to pass the following checks and have Kubernetes restart container:
- Transcoder hasn’t received any message from the messaging bus topic for a while and there are still outstanding messages in the topic.
- Fail the health check if the FFmpeg job is stuck i.e. is not producing any more HLS segments but is still running.