<p>To speed it up you need to increase the compute power and throughput of your computer. I think on my machine the I/O is the bottleneck, but yours may be different so look at upgrading any or all of the following:</p>
<ul>
<li>CPU - a faster processor allows for more operations per second</li>
<li>Hard drive - running all video operations off a separate drive to your operating system is essential for speed. For even higher throughput, you can use a <a href="https://www.promax.com/blog/what-raid-is-best-for-video-editing" rel="nofollow noreferrer">RAID array</a> of drives</li>
<li>Entire system - running multiple computers in parallel can, well, parallelise lengthy operations like this. This may be overkill for what you want</li>
</ul>
<p>It may be simplest for you to just buy a new machine.</p>

CC BY-SA 4.0
2022-05-23T14:17:36.520Z
Thank you, I had considered several of these options. I have done the conversion by shutting down all other tasks and the Wi-Fi network. Regarding the 'Ferrari', I would say that it's all too easy an answer. :-)
Giacomo Alessandroni
CC BY-SA 4.0
2022-05-23T15:46:48.500Z
I used to do work with cgi rendering, and the only way to do it in a sensible timeframe was to have multiple machines each with multiple processors, using a high speed RAID array. Video is not quite as computationally expensive, but it is a simple solution to get a better machine, if you have the budget
Dr Mayhem
CC BY-SA 4.0
2022-05-23T07:57:53.313Z
2022-05-23T07:57:53.313Z
Dr Mayhem
<p>First of all, consider to avoid &quot;2-pass&quot; if you only need to convert format.
Most of time, CRF is enough unless you have specific requirement on the output file size.</p>
<p>Use &quot;CRF&quot; to control on the quality and size. CRF lower means better quality.</p>
<pre><code>ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 output.webm
</code></pre>
<p>There's parameter &quot;-row-mt&quot; for VP9 encoder to turn on &quot;Row based multithreading&quot; function, which enhances the number of encoder threads.</p>
<pre><code>ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -row-mt 1 output.webm
</code></pre>
<p>And there're some parameters for VP9 encoder to control on the quality/speed tradeoff. So in the &quot;Two-Pass&quot; case, you could try to use those parameter to get more speed by give-up some quality.</p>
<p>-deadline can be set to realtime, good, or best.</p>
<p>-cpu-used sets how efficient the compression will be.</p>
<p><strong>[Reference]</strong></p>
<p><a href="https://trac.ffmpeg.org/wiki/Encode/VP9" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Encode/VP9</a></p>
<p><a href="https://trac.ffmpeg.org/wiki/Encode/H.264" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Encode/H.264</a> - &quot;Two-Pass Section&quot;</p>

CC BY-SA 4.0
2023-02-22T14:45:28.233Z
I have to say you thank you, even if you haven't completely solve my problem, with your script the result it's a file which before it's 1.5 GB, and now is 320 GB, with the same quality.
Giacomo Alessandroni
CC BY-SA 4.0
2023-02-17T11:26:50.900Z
2023-02-17T11:26:50.900Z
Qiang
<p>I have found <a href="https://video.stackexchange.com/a/28276/38402">this solution</a> provided by <a href="https://video.stackexchange.com/users/25965/hackerb9">hackerb9</a>:</p>
<pre><code>ffmpeg  -i input.mp4  -b:v 0  -crf 30  -pass 1  -an -f webm -y /dev/null
ffmpeg  -i input.mp4  -b:v 0  -crf 30  -pass 2  output.webm
</code></pre>
<p>It's works, but the second pass require more than 10 hours (for 30 minutes of video HD).</p>
<p>Now the question is: can I do the same things in a reasonable time?</p>

<ffmpeg><conversion><webvideos>
Convert mp4 to webm in a reasonable time
Giacomo Alessandroni
# Convert mp4 to webm in a reasonable time

(Asked by: username_0 on 2022-05-22)

I have found this solution provided by hackerb9:
ffmpeg  -i input.mp4  -b:v 0  -crf 30  -pass 1  -an -f webm -y /dev/null
ffmpeg  -i input.mp4  -b:v 0  -crf 30  -pass 2  output.webm

It's works, but the second pass require more than 10 hours (for 30 minutes of video HD).
Now the question is: can I do the same things in a reasonable time?

**Tags:** ffmpeg, conversion, webvideos


---

## 2 answers

### Answer by username_2 on 2023-02-17. Score: 1 | Accepted answer

First of all, consider to avoid "2-pass" if you only need to convert format.
Most of time, CRF is enough unless you have specific requirement on the output file size.
Use "CRF" to control on the quality and size. CRF lower means better quality.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 output.webm

There's parameter "-row-mt" for VP9 encoder to turn on "Row based multithreading" function, which enhances the number of encoder threads.
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -row-mt 1 output.webm

And there're some parameters for VP9 encoder to control on the quality/speed tradeoff. So in the "Two-Pass" case, you could try to use those parameter to get more speed by give-up some quality.
-deadline can be set to realtime, good, or best.
-cpu-used sets how efficient the compression will be.
[Reference]
https://trac.ffmpeg.org/wiki/Encode/VP9
https://trac.ffmpeg.org/wiki/Encode/H.264 - "Two-Pass Section"

> **Comments:**
> **username_0**: I have to say you thank you, even if you haven't completely solve my problem, with your script the result it's a file which before it's 1.5 GB, and now is 320 GB, with the same quality.  

---

### Answer by username_1 on 2022-05-23. Score: 0

To speed it up you need to increase the compute power and throughput of your computer. I think on my machine the I/O is the bottleneck, but yours may be different so look at upgrading any or all of the following:

* CPU - a faster processor allows for more operations per second
* Hard drive - running all video operations off a separate drive to your operating system is essential for speed. For even higher throughput, you can use a [RAID array](https://www.promax.com/blog/what-raid-is-best-for-video-editing) of drives
* Entire system - running multiple computers in parallel can, well, parallelise lengthy operations like this. This may be overkill for what you want

It may be simplest for you to just buy a new machine.

> **Comments:**
> **username_0**: Thank you, I had considered several of these options. I have done the conversion by shutting down all other tasks and the Wi-Fi network. Regarding the 'Ferrari', I would say that it's all too easy an answer. :-)  
> **username_1**: I used to do work with cgi rendering, and the only way to do it in a sensible timeframe was to have multiple machines each with multiple processors, using a high speed RAID array. Video is not quite as computationally expensive, but it is a simple solution to get a better machine, if you have the budget  

---

