<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Licensing on PHP Boy Scout</title><link>https://phpboyscout.uk/tags/licensing/</link><description>Recent content in Licensing on PHP Boy Scout</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><copyright>Matt Cockayne</copyright><lastBuildDate>Fri, 28 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://phpboyscout.uk/tags/licensing/index.xml" rel="self" type="application/rss+xml"/><item><title>An encoder on borrowed time</title><link>https://phpboyscout.uk/an-encoder-on-borrowed-time/</link><pubDate>Fri, 28 Aug 2026 00:00:00 +0000</pubDate><guid>https://phpboyscout.uk/an-encoder-on-borrowed-time/</guid><description>&lt;img src="https://phpboyscout.uk/an-encoder-on-borrowed-time/cover-an-encoder-on-borrowed-time.png" alt="Featured image of post An encoder on borrowed time" /&gt;&lt;p&gt;There&amp;rsquo;s a date circled in ffmpeg-wasi&amp;rsquo;s documentation: &lt;strong&gt;2027-11-29&lt;/strong&gt;. On that day the last US essential patent in the AVC pool expires, H.264 becomes just another bit of maths in America, and a whole paragraph of careful legal hedging in my docs gets to retire. Until then the LGPL build of ffmpeg-wasi ships an encoder that exists on sufferance. And if you&amp;rsquo;re going to ship something on those terms, you say so. Out loud, prominently, with the date attached.&lt;/p&gt;
&lt;p&gt;This is the story of the most-requested capability in any media toolkit (making mp4s people can actually play) and what it costs to offer it in a permissively-licensed build.&lt;/p&gt;
&lt;h2 id="decode-was-never-the-gap"&gt;Decode was never the gap
&lt;/h2&gt;&lt;p&gt;The &lt;a class="link" href="https://phpboyscout.uk/introducing-afmpeg-and-ffmpeg-wasi/" &gt;two-variant scheme&lt;/a&gt; gives ffmpeg-wasi an LGPL floor and a GPL full-fat build. From day one the LGPL floor could &lt;em&gt;decode&lt;/em&gt; H.264; FFmpeg&amp;rsquo;s own decoder carries no GPL strings. The gap was encode. FFmpeg&amp;rsquo;s blessed H.264 encoder is x264, and x264 is GPL: enable it and the whole artifact graduates to the GPL variant. So the LGPL build, the one a permissively-licensed Go library wants to lean on, could read the world&amp;rsquo;s videos and write none of them.&lt;/p&gt;
&lt;p&gt;Enter &lt;a class="link" href="https://gitlab.com/phpboyscout/ffmpeg-wasi/-/blob/164163ecac85930bfd972faf48ba3ce536bf41c8/build/libav.sh#L22-25" target="_blank" rel="noopener"
 &gt;openh264&lt;/a&gt;, Cisco&amp;rsquo;s H.264 codec, BSD-2-Clause licensed. Two build flags (&lt;code&gt;--enable-libopenh264 --enable-encoder=libopenh264&lt;/code&gt;, no &lt;code&gt;--enable-gpl&lt;/code&gt; in sight) and the LGPL artifact encodes H.264. Shipped in &lt;a class="link" href="https://gitlab.com/phpboyscout/ffmpeg-wasi/-/releases/n8.1.2-2" target="_blank" rel="noopener"
 &gt;n8.1.2-2&lt;/a&gt;, in both variants.&lt;/p&gt;
&lt;p&gt;If that sounds too easy&amp;hellip; it is. The BSD licence was never the hard bit.&lt;/p&gt;
&lt;h2 id="copyright-is-one-umbrella-patents-are-another"&gt;Copyright is one umbrella; patents are another
&lt;/h2&gt;&lt;p&gt;A codec has two legal layers, and they don&amp;rsquo;t care about each other. The &lt;em&gt;copyright&lt;/em&gt; on openh264&amp;rsquo;s source is Cisco&amp;rsquo;s to give away, and BSD gives it away. The &lt;em&gt;patents&lt;/em&gt; on the H.264 techniques themselves belong to a pool of rights-holders (administered by Via LA), and no source licence in the world can waive them.&lt;/p&gt;
&lt;p&gt;Cisco&amp;rsquo;s famous move was to pay the pool&amp;rsquo;s royalties on everyone&amp;rsquo;s behalf&amp;hellip; for the binary modules &lt;em&gt;Cisco itself builds and distributes&lt;/em&gt;. That grant does not travel with the source code. My docs put it in a red box rather than a footnote: ffmpeg-wasi compiles openh264 from source for &lt;code&gt;wasm32-wasi&lt;/code&gt; (Cisco doesn&amp;rsquo;t publish a wasm binary), so our artifact is &lt;strong&gt;not under Cisco&amp;rsquo;s umbrella&lt;/strong&gt;. Anyone who tells you &amp;ldquo;it&amp;rsquo;s fine, Cisco pays&amp;rdquo; for a self-compiled openh264 has read the first half of the licence page.&lt;/p&gt;
&lt;p&gt;What makes it tenable is duller and more precise, and the &lt;a class="link" href="https://gitlab.com/phpboyscout/ffmpeg-wasi/-/blob/164163ecac85930bfd972faf48ba3ce536bf41c8/docs/explanation/licensing.md#L57-83" target="_blank" rel="noopener"
 &gt;licensing docs&lt;/a&gt; spell it out: the pool&amp;rsquo;s terms are royalty-free beneath an annual volume threshold (the first 100,000 units a year), a horizon this project&amp;rsquo;s expectations sit comfortably under. And the docs make a plain commitment on top: if Via LA or any AVC rights-holder asks us to stop distributing the encoder, we pull it. No fight, no fundraiser. The docs also say, twice, that none of this is legal advice, and neither is this post.&lt;/p&gt;
&lt;h2 id="the-horse-had-already-bolted"&gt;The horse had already bolted
&lt;/h2&gt;&lt;p&gt;You might ask why I&amp;rsquo;d take on any of this for the &lt;em&gt;permissive&lt;/em&gt; build when the GPL build already existed. The answer is that the patent exposure was already there. Patents don&amp;rsquo;t read your source licence: an x264 binary practises exactly the same claims as an openh264 one, so the GPL variant had opened whatever door there was to open. Declining to add encode to the LGPL floor wouldn&amp;rsquo;t have closed it; it would only have kept the safer variant less useful. Same risk either way, and turning encode down would&amp;rsquo;ve bought me nothing but a less useful build. Call that caution if you like. I&amp;rsquo;d call it cost with no upside.&lt;/p&gt;
&lt;p&gt;So both variants carry the risk, both carry the caveat, and the caveat comes with a date on it. Rather than embed a list of patent numbers that would only rot in place, the docs link Via LA&amp;rsquo;s maintained roster and state the one fact worth remembering: the final US essential patent lapses on 2027-11-29 (other jurisdictions track a similar horizon). None of this is meant to hold forever. There&amp;rsquo;s a clock running on it.&lt;/p&gt;
&lt;h2 id="making-ciscos-code-believe-in-wasi"&gt;Making Cisco&amp;rsquo;s code believe in WASI
&lt;/h2&gt;&lt;p&gt;Getting openh264 v2.6.0 to build for &lt;code&gt;wasm32-wasi&lt;/code&gt; took &lt;a class="link" href="https://gitlab.com/phpboyscout/ffmpeg-wasi/-/blob/164163ecac85930bfd972faf48ba3ce536bf41c8/build/deps.sh#L50-87" target="_blank" rel="noopener"
 &gt;a small patch and a shim&lt;/a&gt;: a &lt;code&gt;__wasi__&lt;/code&gt; path through its threading library, a single-threaded pthread stand-in compiled into the archive, a hand-written pkg-config file (upstream&amp;rsquo;s insists on &lt;code&gt;-lstdc++ -lpthread&lt;/code&gt;, neither of which exists on wasi)&amp;hellip; and one genuinely fun find: a function declared with one signature in C and defined with another in C++, an arity slip native linkers have silently forgiven for years. Wasm&amp;rsquo;s strict function typing forgave nothing, and trapped on the spot. Which makes the sandbox an accidental linter, catching a bug that had sat there unbothered for years.&lt;/p&gt;
&lt;h2 id="a-feature-with-a-use-by-date"&gt;A feature with a use-by date
&lt;/h2&gt;&lt;p&gt;It nets out about as well as this kind of thing can. The LGPL build does the thing everyone actually needs, the risk is written down where you can&amp;rsquo;t miss it, the escape hatch is pre-committed, and the whole lot comes with a sell-by date, after which there&amp;rsquo;s nothing left to hedge and it&amp;rsquo;s back to being maths. Fifteen months on the clock. That red box in the docs is really just a changelog entry with the date left blank.&lt;/p&gt;</description></item></channel></rss>