5 ms·
FFmpeg-online: ffpmeg running on the browser
- netsharc 3y agoAs their github page says, based on https://ffmpegwasm.netlify.app https://ffmpegwasm.netlify.app ... I'm guessing no one did GPU-optimizations? I saw a web app (not an ffmpeg transpilation) that went clever and used WebGL so it can access the GPU and use its parallel processing capabilities...
- xyst 3y agoIt’s nice if you have a modern computer, but I wonder what happens when the client has a very old computer or a “Chromebook”. Will the experience for those low end computers be degraded? It’s been awhile since I actually used ffmeg directly but I do recall trying to transcode some video to a different format and it took some time on a 2015 MacBook (not a MBP, like a thinner version of the MBA, lol)
- devwastaken 3y agoThe algs for media codecs are typically in handwritten assembly in combination with C. Actual GPU hardware acceleration implements specific media algorithms in hardware and is not accessible from the browser. I'm not aware of any kind of gpu codec algs that work in browser.
- johntb86 3y agoThey could use the WebCodec APIs to decode frames using the hardware, similar to how ffmpeg already supports VA-API for hardware decoding.
- pojzon 3y agoAnyone can explain to me why order of input file flag has such an impact on the accuracy of copy ? (Ffmpeg adds/removes randomly few sec)
- leptons 3y agoI implemented ffmpeg.wasm in my own web app, and it's working out really well. I didn't have to set up a Lambda to resize video, it happens in the user's browser and the result is uploaded directly to S3. It saves me processing cost, and complexity. It was really easy to implement and works perfectly.
- haltist 3y agoHow large is the wasm binary?
- dadsquad 3y agois this open sourced somewhere?
- leptons 3y agostart here: https://www.npmjs.com/package/@ffmpeg.wasm/main https://www.npmjs.com/package/@ffmpeg.wasm/main
- danShumway 3y agoThe only caveat I'd mention here for anyone else looking to do something similar is that if you're planning to use ffmpeg to convert a video into multiple different formats for serving at different bitrates or to different devices, then doing it clientside opens up the door for users to upload completely different videos for different formats; you are trusting the client ultimately to send you the data. Plenty of scenarios where that doesn't matter and it's fine to trust the client, but just something to be aware of.
- hokkos 3y agoOr better use the WebCodecs API to be able to use your hardware encoding and decoding facilities.
- crazygringo 3y agoGenerally speaking, CPU decoding isn't that slow in the first place (compared to any kind of encoding), and hardware encoding is low-quality and lacking in options. Hardware encoding is great for quickly getting a camera feed to disk at a non-professional quality level, but it's hard to imagine ever using it to do a re-encode of anything -- where you usually want to prioritize quality and a smaller size over encoding speed.
- dpe82 3y agoDepends what you're decoding. :) 4k H.265 or AVC will cook your CPU.
- amelius 3y agoWhen will it become practical to run Linux inside the browser using WASM?
- deleted 3y ago[deleted]
- Buttons840 3y agoProbably before WASM bytecode can manipulate the DOM without JavaScript. The browser seems on track to do everything except giving first-class support for other languages. I've been studying the WebGPU API, which seems good, and visions of even our game engines being written in JavaScript are continually before my eyes.
- daxelrod 3y agoIt’s been possible for years. I’m not sure what a good definition of “practical” would be though. https://bellard.org/jslinux/ https://bellard.org/jslinux/
- amelius 3y agoThat's exactly why I said "practical" ;)
- jonplackett 3y agoAnyone know what the browser support is likely to be for this? I’m working on something right now where I’m having to use a web service to merge an mp3 and mp4. Doesn’t even need to re-encode. So this might be perfect if a decent amount of browsers can run it.
- lights0123 3y ago"Not IE": https://caniuse.com/?search=wasm https://caniuse.com/?search=wasm Multithreading probably requires https://caniuse.com/sharedarraybuffer https://caniuse.com/sharedarraybuffer
- untitaker_ 3y agoSimilar, but nicer UI: https://ffmpeg.app https://ffmpeg.app
- dang 3y agoRelated: ffmpeg.wasm – a pure WebAssembly / JavaScript port of FFmpeg - https://news.ycombinator.com/item?id=33794122 https://news.ycombinator.com/item?id=33794122 - Nov 2022 (23 comments) FFmpeg for browser and Node, powered by WebAssembly - https://news.ycombinator.com/item?id=28251801 https://news.ycombinator.com/item?id=28251801 - Aug 2021 (87 comments) A pure WebAssembly / JavaScript port of FFmpeg - https://news.ycombinator.com/item?id=24987861 https://news.ycombinator.com/item?id=24987861 - Nov 2020 (125 comments)
- deleted 3y ago[deleted]
- syrusakbary 3y agoThis might also be interesting to the readers. In Wasmer we recently ported ffmpeg to Wasm/WASIX. It runs fully in both client (browser) and also fully on the server: https://wasmer.io/wasmer/ffmpeg https://wasmer.io/wasmer/ffmpeg (is multithreaded, all codecs supported) Here's a video showcasing it! https://twitter.com/wasmerio/status/1687238131395768320 https://twitter.com/wasmerio/status/1687238131395768320 I believe we can bring ffmpeg to any programming language quite easily... stay tuned!