5 ms·
Ooh, if this also used ffmpeg-wasm [1], you could then run the command itself in the browser! [1] https://github.com/ffmpegwasm/ffmpeg.wasm https://github.com/
by phailhaus 4y ago
Ooh, if this also used ffmpeg-wasm [1], you could then run the command itself in the browser!
[1] https://github.com/ffmpegwasm/ffmpeg.wasm https://github.com/ffmpegwasm/ffmpeg.wasm
- OzzyB 4y agoHmmm... not really, irrc you will be bound by memory limits of your browser/wasm context. Small videos would be fine, large ones, not so much...
- 0x62 4y agoFWIW we’ve been using ffmpeg-wasm on one of our products [0] for a couple months and the main issue is garbage collection. You’re limited to 4GB memory, but if you don’t kill and restart the workers every N operations it crashes the browser tab (even with proper unlinking of files in the virtual FS). I suspect you could still make it work with clever usage of the File System Access API as a cache, and process larger files in chunks. Then you’d mostly be limited by the Blob storage limits [1], and memory required to merge processed chunks together. [0] https://nft-inator.com/app https://nft-inator.com/app [1] https://chromium.googlesource.com/chromium/src/+/224e43ce1ca4f6ca6f2cd8d677b8684f4b7c2351/storage/browser/blob/README.md https://chromium.googlesource.com/chromium/src/+/224e43ce1ca...
- marclundgren 4y agoIt works great for audio. Here's a wasm-ffmpeg solution I created trim audio. https://wasm-audio-clipper.netlify.app/ https://wasm-audio-clipper.netlify.app/ Check the repo: https://github.com/marclundgren/wasm-audio-clipper https://github.com/marclundgren/wasm-audio-clipper. I ended up lazily registering the context. The memory footprint stays lower even after trimming multiple clips on the same session.
- nabakin 4y agoYou could! I've done it before but ffmpeg-wasm is also very slow and there are memory limitations that come with WASM as well. At least on Chrome.
- thadk 4y agoI wonder if this could be used to make video HDR versions of D3 visualizations, making more colors addressable at the cost of reducing interactivity after baking the movie file?