<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dodly Forbi</title>
    <description>The latest articles on DEV Community by Dodly Forbi (@dodly-jr).</description>
    <link>https://dev.to/dodly-jr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4026794%2F8ace9046-7393-4ce7-bae3-2a0c37c984cc.png</url>
      <title>DEV Community: Dodly Forbi</title>
      <link>https://dev.to/dodly-jr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dodly-jr"/>
    <language>en</language>
    <item>
      <title># Which licence is your ffmpeg.wasm? A 2-minute check, and an LGPL build for audio apps</title>
      <dc:creator>Dodly Forbi</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:41:46 +0000</pubDate>
      <link>https://dev.to/dodly-jr/-which-licence-is-your-ffmpegwasm-a-2-minute-check-and-an-lgpl-build-for-audio-apps-21bc</link>
      <guid>https://dev.to/dodly-jr/-which-licence-is-your-ffmpegwasm-a-2-minute-check-and-an-lgpl-build-for-audio-apps-21bc</guid>
      <description>&lt;p&gt;I'm Dodly Forbi, an electrical engineering student in Germany. On the side I build &lt;a href="https://www.weconvertit.com" rel="noopener noreferrer"&gt;WeConvertIt&lt;/a&gt;, a set of free file tools that run entirely in your browser, which mostly means my laptop fan has strong opinions about WebAssembly. Nothing gets uploaded. Your audio, PDFs and photos stay on your device, and that's the whole point of the site.&lt;/p&gt;

&lt;p&gt;A lot of that runs on FFmpeg, compiled to WebAssembly. Like most people, I got it from npm through the ffmpeg.wasm project. The package said MIT, so I didn't think about it twice.&lt;/p&gt;

&lt;p&gt;Then, while planning a new audio editor, I audited every dependency the site ships. One result stopped me. The FFmpeg core I'd been serving to every visitor contains this sentence, printed by the binary itself when you ask for its licence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This version of ffmpeg has nonfree parts compiled in. Therefore it is not legally redistributable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's not something you want to find in a file you've been handing out to strangers for months. It's a bit like learning that the cake you've been serving at every party had a "not for resale" sticker on the bottom the whole time. So I dug in, fixed it, and published the fix. This post is what I learned, how you can check your own build in two minutes, and the LGPL build I now use in production.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm an electrical engineer in training, not a lawyer, and nothing here is legal advice. It's simply what the binaries say about themselves when you ask them nicely.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually inside the packages
&lt;/h2&gt;

&lt;p&gt;FFmpeg records how it was built inside the binary. So you don't have to trust labels; you can ask the file. I checked the published npm packages on 22 November 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;npm "license" field&lt;/th&gt;
&lt;th&gt;Build flags that decide the licence&lt;/th&gt;
&lt;th&gt;What the binary says (&lt;code&gt;-L&lt;/code&gt;)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@ffmpeg/core&lt;/code&gt; / &lt;code&gt;@ffmpeg/core-st&lt;/code&gt; 0.11.x&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;--enable-gpl --enable-nonfree --enable-libfdk-aac&lt;/code&gt;, plus x264 and x265&lt;/td&gt;
&lt;td&gt;nonfree, "not legally redistributable"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;@ffmpeg/core&lt;/code&gt; / &lt;code&gt;@ffmpeg/core-mt&lt;/code&gt; 0.12.10&lt;/td&gt;
&lt;td&gt;GPL-2.0-or-later&lt;/td&gt;
&lt;td&gt;&lt;code&gt;--enable-gpl --enable-libx264 --enable-libx265&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GPL version 2 or later&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To be fair to the maintainers: the current 0.12 packages are honestly labelled. Someone reported the wrong field in &lt;a href="https://github.com/ffmpegwasm/ffmpeg.wasm/issues/685" rel="noopener noreferrer"&gt;issue #685&lt;/a&gt;, it was fixed in &lt;a href="https://github.com/ffmpegwasm/ffmpeg.wasm/pull/686" rel="noopener noreferrer"&gt;PR #686&lt;/a&gt;, and the GPL label has been on npm since 0.12.8. The project's FAQ also says the core follows "the same licenses as FFmpeg and its external libraries", which is correct.&lt;/p&gt;

&lt;p&gt;What's still easy to miss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The older 0.11.x cores are still on npm, still labelled MIT, and they're the non-free ones. I was using &lt;code&gt;@ffmpeg/core-st&lt;/code&gt; 0.11.1, the single-threaded build, because it works without special server headers. I doubt I'm the only one.&lt;/li&gt;
&lt;li&gt;The repository's README badge says MIT. That's true for the JavaScript wrapper, &lt;code&gt;@ffmpeg/ffmpeg&lt;/code&gt;. It isn't true for the core, which is the part that does the work.&lt;/li&gt;
&lt;li&gt;The npm tarballs don't include a licence file or a way to get the corresponding source.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/ffmpegwasm/ffmpeg.wasm/issues/902" rel="noopener noreferrer"&gt;Issue #902&lt;/a&gt;, opened in September 2025, asks about exactly this and hasn't had a reply yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why it matters
&lt;/h2&gt;

&lt;p&gt;FFmpeg's own &lt;code&gt;configure --help&lt;/code&gt; explains the two flags better than I can:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--enable-gpl      allow use of GPL code, the resulting libs
                  and binaries will be under GPL [no]
--enable-nonfree  allow use of nonfree code, the resulting libs
                  and binaries will be unredistributable [no]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So a GPL build is fine if your project can live with the GPL. Plenty of projects can't, especially closed-source web apps. And a non-free build isn't fine for anyone who serves it to the public, because serving a file to a browser is distributing it. FFmpeg's &lt;a href="https://ffmpeg.org/legal.html" rel="noopener noreferrer"&gt;legal page&lt;/a&gt; puts it first in its checklist: "Compile FFmpeg without "--enable-gpl" and without "--enable-nonfree"."&lt;/p&gt;

&lt;p&gt;The irony for me was that I only do audio. I never needed x264 or x265, which are video encoders. They were in my build because the prebuilt core is made for video, and they're what pulled the whole thing into the GPL. I was basically carrying a full film studio around just to cut ringtones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your own build in two minutes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Option 1: read the build line straight out of the .wasm.&lt;/strong&gt; I wrote a small script with no dependencies for this. It works on single- and multi-threaded cores from any source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node tools/check-licence.mjs node_modules/@ffmpeg/core/dist/umd/ffmpeg-core.wasm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flags of interest: --enable-gpl --enable-libx264 --enable-libx265
licence FFmpeg's configure assigns to this configuration: GPL version 2 or later
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It exits with 0 for an LGPL build, 1 if it finds &lt;code&gt;--enable-gpl&lt;/code&gt; or &lt;code&gt;--enable-nonfree&lt;/code&gt;, and 2 if it can't find a build line at all, so you can drop it into CI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2: no Node at hand?&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;strings ffmpeg-core.wasm &lt;span class="o"&gt;|&lt;/span&gt; grep -- --target-os
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then read the line yourself and look for &lt;code&gt;--enable-gpl&lt;/code&gt; and &lt;code&gt;--enable-nonfree&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 3: ask the binary.&lt;/strong&gt; With the ffmpeg.wasm 0.12 API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;ffmpeg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'log'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ffmpeg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'-L'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building an LGPL core for audio
&lt;/h2&gt;

&lt;p&gt;I wanted three things: no GPL and no non-free parts, everything a normal audio tool needs, and a build anyone can check without taking my word for it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's in it.&lt;/strong&gt; FFmpeg 5.1.10, unmodified, built with Emscripten 3.1.40. For formats FFmpeg can't encode on its own, I added LAME 3.100 for MP3 and libvorbis 1.3.7 with libogg 1.3.6 for Vorbis. AAC, FLAC, Opus, ALAC and WAV use FFmpeg's own encoders. Everything is LGPL or more permissive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why 5.1 and not something newer.&lt;/strong&gt; It's the newest FFmpeg series whose command-line tool still builds without threads. From 6.0 on, it needs threads, and threads in the browser mean SharedArrayBuffer and special cross-origin headers on your whole site. Single-threaded keeps it a drop-in file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I gave up.&lt;/strong&gt; x264, x265 and fdk-aac. For audio that cost nothing. If I ever need video encoding, browsers now have their own hardware encoders through WebCodecs, which avoids the GPL question entirely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Making it reproducible.&lt;/strong&gt; Every source tarball is pinned by its SHA-256 checksum. The Docker image with the compiler is pinned by its digest. The build fixes the timestamp, time zone and locale, so nothing about my machine leaks into the result. Then I rebuilt it from scratch twice: once on my own PC, and once on GitHub's servers through CI. Both times the output was &lt;strong&gt;byte-for-byte identical&lt;/strong&gt; to the published files. Two computers agreeing down to the last byte is the least dramatic result possible, which is exactly what you want from a build. The CI also fails if &lt;code&gt;--enable-gpl&lt;/code&gt; or &lt;code&gt;--enable-nonfree&lt;/code&gt; ever appears, or if &lt;code&gt;-L&lt;/code&gt; stops reporting the LGPL. So the licence can't quietly drift back.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it went in production
&lt;/h2&gt;

&lt;p&gt;I swapped it into every audio tool on the site in early November. A few things I measured along the way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The core went from 24.4 MB to 16.7 MB, because the video codecs are gone. Visitors download less on their first visit.&lt;/li&gt;
&lt;li&gt;I ran 170 conversion jobs through the old and new core side by side, in Chrome and Firefox. All 170 worked on both.&lt;/li&gt;
&lt;li&gt;AAC got better. FFmpeg 5 switched its default AAC encoding method, so quality went up by 2 to 3.5 dB. The trade-off is that it's about half a second slower per minute of audio, which I'm happy with.&lt;/li&gt;
&lt;li&gt;WMA files stopped getting about 46 ms of silence added at the start, a quirk of the old core. The new one matches desktop FFmpeg exactly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same audit turned up one more case: a HEIC image decoder I used had LGPL-3.0 code bundled inside its JavaScript, with no way to get the matching source. I replaced it with my own reproducible build too. That's a story for another post, but if you ship heic2any, it's worth a look.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use it, or check mine
&lt;/h2&gt;

&lt;p&gt;Everything is on GitHub: &lt;strong&gt;&lt;a href="https://github.com/Eden-Gomez/ffmpeg-wasm-lgpl" rel="noopener noreferrer"&gt;github.com/Eden-Gomez/ffmpeg-wasm-lgpl&lt;/a&gt;&lt;/strong&gt;. That includes the build files, the exact source tarballs, the licence checker, the CI that proves the build, and the Web Worker my site uses in production. The core is a plain Emscripten module. If you want a different build later, you can swap the core file without touching your code.&lt;/p&gt;

&lt;p&gt;One tip: in Node, pass &lt;code&gt;-nostdin&lt;/code&gt;, or FFmpeg will politely wait for you to press a key. Forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thanks
&lt;/h2&gt;

&lt;p&gt;None of this exists without &lt;a href="https://github.com/ffmpegwasm/ffmpeg.wasm" rel="noopener noreferrer"&gt;ffmpeg.wasm&lt;/a&gt;. It's what made FFmpeg in the browser practical, and my build stands on years of their work. If the maintainers find something in this post that's wrong or unfair, I'll correct it.&lt;/p&gt;

&lt;p&gt;And if you find a mistake in my build, open an issue. I'd much rather hear it from you than from a lawyer.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Dodly Forbi, November 2026&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>opensource</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>I shipped three AI tools that run entirely in the browser — here's everything that broke</title>
      <dc:creator>Dodly Forbi</dc:creator>
      <pubDate>Fri, 24 Jul 2026 20:04:12 +0000</pubDate>
      <link>https://dev.to/dodly-jr/i-shipped-three-ai-tools-that-run-entirely-in-the-browser-heres-everything-that-broke-1o0e</link>
      <guid>https://dev.to/dodly-jr/i-shipped-three-ai-tools-that-run-entirely-in-the-browser-heres-everything-that-broke-1o0e</guid>
      <description>&lt;p&gt;I set myself one rule for a side project: every tool has to run entirely in the user's browser. No file ever gets uploaded to a server. If I couldn't do something client-side, it didn't ship.&lt;/p&gt;

&lt;p&gt;That rule turned out to be a great filter for &lt;em&gt;what&lt;/em&gt; to build, and a brutal filter for &lt;em&gt;how&lt;/em&gt;. Here's what actually broke along the way — a broken model file caught by physically-impossible output, an upstream ONNX Runtime bug, and a memory ceiling that only shows up on long files. If you're building AI features that run on-device, some of this will save you a week.&lt;/p&gt;

&lt;p&gt;The site is WeConvertIt — image, PDF and audio tools that all run locally. Three of them use real models in the browser: background removal, music/vocal stem separation, and speech-to-text.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. The model file was broken, and it took a physics violation to prove it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The stem splitter (split a song into vocals and instrumental) uses Meta's HTDemucs, which is MIT-licensed and genuinely state of the art. I grabbed a third-party ONNX export of it, wired it up with onnxruntime-web, and the output was garbage — robotic artifacts, vocals still sitting in the "instrumental" track at nearly full volume.&lt;/p&gt;

&lt;p&gt;The obvious suspects were all mine. I'd converted the model to fp16 to halve the download; transformers are famously sensitive to precision loss, so that was suspect number one. I ran the same song through fp16 and fp32 natively: &lt;strong&gt;numerically identical to four significant figures.&lt;/strong&gt; Not it.&lt;/p&gt;

&lt;p&gt;Sample rate? Demucs wants 44.1kHz stereo; I logged what actually reached the model. Correct. Not it.&lt;/p&gt;

&lt;p&gt;So I did the thing I should have done first: &lt;strong&gt;diffed against the reference implementation.&lt;/strong&gt; I reimplemented HTDemucs's own &lt;code&gt;_spec()&lt;/code&gt;/&lt;code&gt;_ispec()&lt;/code&gt; (the STFT and inverse STFT) from the PyTorch source, and compared them against the JavaScript versions in my pipeline on identical input. Every probed value matched &lt;strong&gt;to eight decimal places&lt;/strong&gt;, in both directions. My code was innocent.&lt;/p&gt;

&lt;p&gt;Then I installed the real PyTorch demucs with the official checkpoint and ran the same full-band song through both. That's where it fell out:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Reference (PyTorch)&lt;/th&gt;
&lt;th&gt;My ONNX model&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;vocals @ 20–60Hz&lt;/td&gt;
&lt;td&gt;4.8% of mix&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;69.3%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vocals @ 2–6kHz&lt;/td&gt;
&lt;td&gt;0.6% of mix&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;75.4%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bass @ sub-bass&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;145.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;other @ sub-bass&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;174.7%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Look at the bottom rows. Stems coming out at 145% and 174% of the original mix's own magnitude. That isn't "lower quality" — it's &lt;strong&gt;impossible&lt;/strong&gt;. You cannot extract more energy from a signal than went into it. That single number told me the model file itself was defective, not my pipeline, not the architecture.&lt;/p&gt;

&lt;p&gt;The fix was to stop trusting someone else's conversion and export my own ONNX from the official pretrained checkpoint (this export is documented as finicky — it needs custom handling for the STFT ops, which is presumably how the broken one got broken). Then I validated the new export against the reference before shipping it: 0.987/0.999 correlation, no stem exceeding mix magnitude. The tool went from unusable to genuinely good.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; when a well-regarded model produces garbage, suspect the &lt;em&gt;file&lt;/em&gt; before the architecture — and find a number that's physically impossible if things were working. That's a much faster signal than "sounds bad."&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2. An upstream ONNX Runtime bug that only fires on tied embeddings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Speech-to-text uses Whisper via transformers.js. Session creation failed outright:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;TransposeDQWeightsForMatMulNBits Missing required scale ... model.decoder.embed_tokens.weight_transposed_DequantizeLinear&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My first assumption was that I'd downloaded a 4-bit quantized variant by mistake — &lt;code&gt;MatMulNBits&lt;/code&gt; is a 4-bit op. Wrong. The committed file was the standard uint8 build, and the binary contained zero &lt;code&gt;MatMulNBits&lt;/code&gt; strings.&lt;/p&gt;

&lt;p&gt;The op wasn't &lt;em&gt;in&lt;/em&gt; the file. ONNX Runtime's graph optimizer was &lt;strong&gt;creating it at session-creation time&lt;/strong&gt; — a fusion pass that turns &lt;code&gt;DequantizeLinear + MatMul&lt;/code&gt; into &lt;code&gt;MatMulNBits&lt;/code&gt;, which crashes when a weight initializer is shared by two consumers. Whisper's tied embedding/lm_head is exactly that pattern, so every quantized Whisper decoder trips it. It's a known regression (onnxruntime#28306).&lt;/p&gt;

&lt;p&gt;Two things made this worse to diagnose. First, no amount of re-downloading model files would ever have fixed it. Second, &lt;code&gt;@huggingface/transformers&lt;/code&gt; &lt;strong&gt;statically inlines its onnxruntime-web build at publish time&lt;/strong&gt; — so bumping onnxruntime-web in your own &lt;code&gt;package.json&lt;/code&gt; does nothing to that code path.&lt;/p&gt;

&lt;p&gt;The fix was one line: pass &lt;code&gt;session_options: { graphOptimizationLevel: 'basic' }&lt;/code&gt; to the pipeline, skipping the buggy aggressive fusion while keeping the cheap optimizations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; if an ONNX error names an operator your model doesn't contain, the optimizer is generating it. Check the graph optimization level before you touch the weights.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;3. Long audio doesn't fail loudly, it fails quietly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two separate traps here, both of which ship silently if you don't test long files.&lt;/p&gt;

&lt;p&gt;Whisper's context window is &lt;strong&gt;30 seconds&lt;/strong&gt;. Hand it a five-minute recording without setting &lt;code&gt;chunk_length_s&lt;/code&gt; and it doesn't throw — it transcribes the first 30 seconds and returns a tidy, complete-looking result. I reproduced this: 238 characters returned for a five-minute speech. Imagine a user transcribing an hour-long lecture and never noticing 98% is missing. Now the chunking constants are hardcoded in the worker where the UI can't reach them, plus a sanity check that flags a transcript implausibly short for the audio duration.&lt;/p&gt;

&lt;p&gt;Then the memory ceiling. The WASM heap caps around 1GB, and my first architecture handed the entire file's decoded PCM to one transcription call — so memory grew chunk after chunk until it blew, and when it blew it took the whole job with it. That produced the world's most confusing bug report: "transcript is shorter than the audio."&lt;/p&gt;

&lt;p&gt;The fix was architectural: process long files in &lt;strong&gt;5-minute segments&lt;/strong&gt;, decode each segment on demand rather than holding the whole file's PCM, and &lt;strong&gt;terminate and recreate the worker between segments&lt;/strong&gt; so the browser actually reclaims WASM memory. That bounds peak memory to one segment regardless of total length. A failing segment retries once, then gets marked in the transcript — never silently dropped. A 29-minute file now completes in about 7.5 minutes with no crash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; for browser ML, memory is the real duration limit, not the model. Terminating the worker is a blunt but very effective way to force reclamation.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;4. Sometimes the ceiling is real&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I ran the identical investigation on the background remover, expecting another broken conversion. It wasn't. The model file was byte-identical (MD5-verified) to what the official Python package downloads, and its output matched the reference at &lt;strong&gt;0.9999 correlation&lt;/strong&gt;. My own post-processing measured 0.00% erosion on three of four deliberately hard test images.&lt;/p&gt;

&lt;p&gt;The tool is just… at its ceiling. That model runs at &lt;strong&gt;320×320&lt;/strong&gt;. Individual hair strands are sub-pixel at that resolution; they physically cannot be resolved. The cloud tools beat it because they run far bigger models on their servers — which is exactly the trade I'm not willing to make.&lt;/p&gt;

&lt;p&gt;So the honest answer there was a manual erase/restore brush: let the model do 85% and let the user finish it in ten seconds. Every good cutout tool works this way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; run the same diagnostic even when you expect bad news. "Confirmed ceiling" is a genuinely useful answer — it stops you tuning knobs against a problem that doesn't exist.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What running locally actually buys you&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The thing I keep coming back to: for a stem splitter or a transcription tool, the file is someone's unreleased track, or a private interview, or a medical consult. Every mainstream alternative uploads it. Running on-device means the privacy claim is &lt;em&gt;verifiable&lt;/em&gt; rather than promised — open the Network tab, run a job, watch nothing leave. When I tested the stem splitter end to end, there were zero requests with a POST body in the entire session. The model comes down; the audio never goes up.&lt;/p&gt;

&lt;p&gt;The cost is real: bigger downloads, slower processing, and a hard ceiling on model size. But for this category, I'll take it.&lt;/p&gt;

&lt;p&gt;WeConvertIt is a client-side web application built with Next.js, utilizing ffmpeg.wasm for audio, pdf-lib/pdf.js for PDFs, qpdf-wasm for encryption, and Canvas for image processing. The application is live at weconvertit.com. — first real project, built solo, and I'd genuinely value feedback, especially anything that breaks.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>machinelearning</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
