I'm trying to render a video. But I want render it as constant speed. Example :
ffmpeg -stream_loop -1 -i 113856_video_0.ts -c:v copy -c:a aac -bufsize 3600k -maxrate 1800k -rtbufsize 15M -metadata comment="screen113856" -preset ultrafast -g 50 -r 4 -sc_threshold 0 -crf 0 -threads 1 out.mp4
This ffmpeg will render video fine, out put like this
frame=77590 fps=113 q=-1.0 size= 596650kB time=00:51:43.67 bitrate=1574.8kbits/s speed=10.51x
You can see speed=10.51x , It's fast but but it take all of my CPU. If I use ffmpeg -re , it render as speed=1x , good for CPU but take time. Can I render video as specific speed ?
There is an option to use cpulimit
cpulimit -l 20 ffmpeg ...
Almost solves my case but : - some time it doesn't works, ffmpeg still take 100% CPU - for each video, I have to set the number CPU limit, (-l 20, 30) to get the specific speed. I want to do it automatically.