<p>Pass <code>-benchmark</code> to ffmpeg with some samples. You'll have to test it on another system to estimate what will be required, because memory and CPU usage also depends on the version of ffmpeg and its libraries as well as the contents of the video you're transcoding.</p>
<p>A few examples of SVT-AV1 at various presets (8, 6, and 0):</p>
<pre><code>cropbox:~$ ffmpeg -benchmark -f lavfi -i &quot;testsrc2=d=30&quot; -c:v libsvtav1 -preset 9 -f null - 2&gt;&amp;1 | grep ^bench
bench: utime=20.163s stime=0.366s rtime=7.933s
bench: maxrss=163548KiB
cropbox:~$ ffmpeg -benchmark -f lavfi -i &quot;testsrc2=d=30&quot; -c:v libsvtav1 -preset 6 -f null - 2&gt;&amp;1 | grep ^bench
bench: utime=42.690s stime=0.513s rtime=18.362s
bench: maxrss=226440KiB
cropbox:~$ ffmpeg -benchmark -f lavfi -i &quot;testsrc2=d=30&quot; -c:v libsvtav1 -preset 0 -f null - 2&gt;&amp;1 | grep ^bench
bench: utime=369.513s stime=0.882s rtime=166.848s
bench: maxrss=243972KiB
</code></pre>
<p>So you can see that it's not just the codec or resolution, but the presets that matter too.</p>
<p>And for shits and grins, MPEG-1:</p>
<pre><code>cropbox:~$ ffmpeg -benchmark -f lavfi -i &quot;testsrc2=d=30&quot; -c:v mpeg1video -f null - 2&gt;&amp;1 | grep ^bench
bench: utime=0.596s stime=0.059s rtime=0.303s
bench: maxrss=23408KiB
</code></pre>

CC BY-SA 4.0
2024-05-06T03:28:59.060Z
2024-05-06T03:28:59.060Z
veppy
<p>I have a SAAS software that does video transcoding using ffmpeg. The hardware is expected to have no GPU and other hardware acceleration technologies. The input video stream will have the following basic parameters: 1 video stream, full HD resolution, bitrate = 5500 kbps, h264 codec, audio codec is aac, 160 kbps. The desired output includes 3 video streams with the following parameters: - Stream 1: Full HD resolution, bitrate = 3500 kbps, h264 codec; - Stream 2: HD resolution, bitrate = 1800 kbps, h264 codec; - Stream 3: SD resolution, bitrate = 500, h264 codec. The sound is the same as the input stream, unchanged. The question is whether there is a specific calculation method or anyone has experience calculating the required hardware resources (CPU + Memory) for each 10 input streams and the requirements as I have stated?</p>

<ffmpeg><video>
How to calculate the CPU resources required to use ffmpeg to transcode a video stream
Hải Đào Ngọc
# How to calculate the CPU resources required to use ffmpeg to transcode a video stream

(Asked by: username_0 on 2023-08-16)

I have a SAAS software that does video transcoding using ffmpeg. The hardware is expected to have no GPU and other hardware acceleration technologies. The input video stream will have the following basic parameters: 1 video stream, full HD resolution, bitrate = 5500 kbps, h264 codec, audio codec is aac, 160 kbps. The desired output includes 3 video streams with the following parameters: - Stream 1: Full HD resolution, bitrate = 3500 kbps, h264 codec; - Stream 2: HD resolution, bitrate = 1800 kbps, h264 codec; - Stream 3: SD resolution, bitrate = 500, h264 codec. The sound is the same as the input stream, unchanged. The question is whether there is a specific calculation method or anyone has experience calculating the required hardware resources (CPU + Memory) for each 10 input streams and the requirements as I have stated?

**Tags:** ffmpeg, video


---

## 1 answers

### Answer by username_1 on 2024-05-06. Score: 0

Pass -benchmark to ffmpeg with some samples. You'll have to test it on another system to estimate what will be required, because memory and CPU usage also depends on the version of ffmpeg and its libraries as well as the contents of the video you're transcoding.
A few examples of SVT-AV1 at various presets (8, 6, and 0):
cropbox:~$ ffmpeg -benchmark -f lavfi -i "testsrc2=d=30" -c:v libsvtav1 -preset 9 -f null - 2>&1 | grep ^bench
bench: utime=20.163s stime=0.366s rtime=7.933s
bench: maxrss=163548KiB
cropbox:~$ ffmpeg -benchmark -f lavfi -i "testsrc2=d=30" -c:v libsvtav1 -preset 6 -f null - 2>&1 | grep ^bench
bench: utime=42.690s stime=0.513s rtime=18.362s
bench: maxrss=226440KiB
cropbox:~$ ffmpeg -benchmark -f lavfi -i "testsrc2=d=30" -c:v libsvtav1 -preset 0 -f null - 2>&1 | grep ^bench
bench: utime=369.513s stime=0.882s rtime=166.848s
bench: maxrss=243972KiB

So you can see that it's not just the codec or resolution, but the presets that matter too.
And for shits and grins, MPEG-1:
cropbox:~$ ffmpeg -benchmark -f lavfi -i "testsrc2=d=30" -c:v mpeg1video -f null - 2>&1 | grep ^bench
bench: utime=0.596s stime=0.059s rtime=0.303s
bench: maxrss=23408KiB


---

