performance – FFmpeg – Low/unstable encoding speed

Trying to transcode two streams into one gives me poor/unstable encoding speeds from x0.400 to x0.988, sometimes above x1.

fmpeg \
   -thread_queue_size 15 -rtbufsize 100M -i "https://.../stream.m3u8" \
   -thread_queue_size 15 -rtbufsize 100M -i "http://.../video.mjpg" \
   -filter_complex \
   "[0:v]setpts=PTS-STARTPTS [bg]; \
    [1:v]scale=200:-1,setpts=PTS-STARTPTS [fg]; \
    [bg][fg]overlay=W-w-10:10" \
   -c:v mpeg1video \
   -b:v 1000k \
    -r 25 \
   -threads 1 \
   -f mjpeg udp://127.0.0.1:1235?pkt_size=1316

Hardware specs :

  • CPU is Intel Core 2 Duo
  • Mechanical hard drive

I choose the mpeg1video encoder because of the low CPU usage. It seems that my Core 2 Duo can’t keep up with libx264 .

I played with output bitrates, fps and threads, -re but nothing seems to improve and stabilize encoding speed to x1. Wich parameters do I need to change/add/remove to achieve a reliable x1 encoding speed ?

Input streams are not reliable, download internet connection is slow and unreliable.

Read more here: Source link