Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Three things that broke when I moved video compression into the browser

I run a video compressor that works entirely in the browser . No upload, no server, nothing leaves the machine. Two of the three bugs below only showed up when I stopped reading code and started timing things, so I want to write them down while the numbers are still in front of me. The pipeline has three paths. If the file already meets the target, copy the encoded samples and encode nothing. If…

Three key issues emerged when moving video compression into the browser. First, timestamps were absent in AVI files, causing issues with copying the media. The fix involved adding the +genpts flag to ffmpeg, which generated presentation timestamps. Second, output sizes varied significantly between H.264 AVI and Xvid AVI files. The H.264 AVI compression with WebCodecs took just 7.5 seconds, resulting in a 12.3 MB file, while the Xvid AVI with ffmpeg.wasm took 53.4 seconds, yielding a 12.5 MB file.

Finally, the audio copy path was not always available due to encoder priming delay. This delay caused audio tracks to double in size compared to the source, rendering the passthrough path unusable. To address this, a floor was implemented to return the original source file if the copy would increase the file size.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

"Through the Door I Never Saw: A Journey Into Cybersecurity"

I never imagined cybersecurity would become part of my life. For years, it felt like a world meant for other people — people who grew up technical, people who understood the language of logs and…

  • Former waitress turned cybersecurity expert
  • Identity stolen, sparking journey into tech
  • Empowers others with newfound skills

More from Wednesday 19 August →