-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling into WebAssembly #43
Comments
@bgrins this would definitely be a welcome feature! It would allow for significant performance gains. |
Resolve bgrins#43
Hello @FluorescentHallucinogen and @amilajack, I have compiled videoconverter.js to WebAssembly, see pull request #63. HowJust change the bellow emcc line from "build_lgpl.sh" and all runs ok. Emscripten does the job. Before: After: Add also "cp ffmpeg.wasm* ../demo" I removed OUTLINING_LIMIT and add ALLOW_MEMORY_GROWTH=1 to avoid memory table errors. DemoSee https://jonasof.github.io/videoconverter.js-wasm-demo/ - in WebAssembly version remember to wait disappear the spinner loading icon on right of "run command" button before run any command. ResultsThe filesizes are:
I'm using Firefox 52.1.0 ESR. The small tasks like image manipulation and the benchmark options gave me poor results because in each iteration (there are around 5 for each benchmark) the browser download and parse the full ffmpeg.wasm file (12 MB), while in asm.js the browser only downloads the ffmpeg.js.mem (3MB). This clearly give more advantage to asm.js. But when running a longer single test - "Video to mp4", WebAssembly performs 3 times more faster than asm.js:
|
@jonasof hey do you know how I can use the libx264 codec? Currently if I try to do that I'm getting this error (even for all_codec version):
Your version of asm.js is also not working, but the original page on http://bgrins.github.io/videoconverter.js/demo/ works with that codec. |
No @timaschew, I have tried to resolve that issue months ago but I had no success - jonasof/videoconverter.js-wasm-demo#2. Since I was more interested in testing webassembly than the usage of ffmpeg specifically I haven't put much efforts in resolving that. |
What about compiling videoconverter.js to WebAssembly?
There are experimental native WebAssembly implementations for Google Chrome, Mozilla Firefox, Microsoft Edge and Apple Safari.
The text was updated successfully, but these errors were encountered: