28.05.2021, 21:53
Hello!
I use FFmpeg to create videos from one image and an Opus audio file. The expected outcome is a video that contains the given image at a rate of 4-6 FPS (manually selected) and the audio file; of course, the video should be as long as the audio track is - not longer, not shorter (as far as possible).
My workload sometimes requires me to process up to 100 audio files at once, so, since my CPU has 12 threads, I'd like all of them to be utilized, so I could finish the queue faster. Only problem is FFmpeg does not utilize more than 2 threads and cannot render faster than 12-18 FPS (~3x faster than real-time, no matter the settings).
At some point, I needed Hybrid for some workload, so I gave that a try. Importing the pre-rendered by FFmpeg video into Hybrid and re-encoding it yields 25x real-time encoding times and the CPU being utilized to 90%. Seeing this, I tried using Hybrid's FFmpeg version to process my workload, but the thread count did not rise.
My command is:
Any help would be appreciated!
P.S.: I have a program that applies the command to a batch of files, hence the simple command.
I use FFmpeg to create videos from one image and an Opus audio file. The expected outcome is a video that contains the given image at a rate of 4-6 FPS (manually selected) and the audio file; of course, the video should be as long as the audio track is - not longer, not shorter (as far as possible).
My workload sometimes requires me to process up to 100 audio files at once, so, since my CPU has 12 threads, I'd like all of them to be utilized, so I could finish the queue faster. Only problem is FFmpeg does not utilize more than 2 threads and cannot render faster than 12-18 FPS (~3x faster than real-time, no matter the settings).
At some point, I needed Hybrid for some workload, so I gave that a try. Importing the pre-rendered by FFmpeg video into Hybrid and re-encoding it yields 25x real-time encoding times and the CPU being utilized to 90%. Seeing this, I tried using Hybrid's FFmpeg version to process my workload, but the thread count did not rise.
My command is:
ffmpeg -loop 1 -i image -threads 18 -i audio.opus -c:v libx264 -crf:v 23 -preset ultrafast -strict -2 -r 6 -c:a copy -shortest audio_name.mkv
Any help would be appreciated!
P.S.: I have a program that applies the command to a batch of files, hence the simple command.