This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan
<p><a href="https://github.com/Kagami/ffmpeg.js">FFMPEG.js</a> is an amazing project and it helped me
building one of my latest projects: <a href="https://paulkinlan.github.io/deviceframe.es/">Device
Frame</a>. It basically builds
ffmpeg (with a good set of defaults to keep the size small — as small
as it can be). If the default build doesn't support the filters and encoders
you need, then you will need to build it yourself.</p>
<p>This is more of a note for me in the future, but this is what I did to get it
working. (Note: I tried on macOS sierra and was getting compile errors).</p>
<h4 id="install-deps">Install Deps</h4>
<ol>
<li><code>sudo apt-get install automake libtool build-essential cmake</code></li>
</ol>
<h4 id="download-ffmpegjs">Download ffmpeg.js</h4>
<ol>
<li><code>git clone git@github.com:Kagami/ffmpeg.js.git</code></li>
<li><code>cd ffmpeg.js</code></li>
<li><code>git submodule init</code></li>
<li><code>git submodule update --recursive</code></li>
</ol>
<h4 id="install-emscripten">Install Emscripten:</h4>
<ol>
<li>Linux: <a href="https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz">Download</a></li>
<li><code>./emsdk update</code></li>
<li><code>./emsdk install latest</code></li>
<li>Wait...</li>
<li><code>./emsdk activate latest</code></li>
<li><code>source ./emsdk_env.sh</code></li>
</ol>
<h4 id="build-ffmpegjs">Build ffmpeg.js</h4>
<ul>
<li><code>make all</code></li>
</ul>
<p>If there are errors with fribidi:</p>
<ul>
<li><code>cd build/fribidi/ && ./bootstrap && configure</code></li>
</ul>
<p>You might see errors like:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">./configure: line 4255: syntax error near unexpected token <span style="color:#e6db74">`</span>2.2<span style="color:#e6db74">'
</span><span style="color:#e6db74">./configure: line 4255: `LT_PREREQ(2.2)'</span>
</code></pre></div><p>Make sure you have <code>libtool</code> installed.</p>
<h4 id="done">Done.</h4>
This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan