Skip to content
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

How does it compare with ffmpeg.js? #75

Closed
Tracked by #1
florian-milky opened this issue Jul 9, 2020 · 5 comments
Closed
Tracked by #1

How does it compare with ffmpeg.js? #75

florian-milky opened this issue Jul 9, 2020 · 5 comments

Comments

@florian-milky
Copy link

Hey! It would be nice if there was some explanations about the differences with ffmpeg.js
There is a big warning at the beginning of the README, but nothing more than that.

@troibe
Copy link

troibe commented Sep 17, 2020

Yes please address this in the README.

@ahuglajbclajep
Copy link

ahuglajbclajep commented Oct 2, 2020

Both ffmpeg.wasm and ffmpeg.js are built using emscripten, but ffmpeg.js does not output WASM.
This is because ffmpeg.js is built with the WASM=0 flag, and you can also check this by npm install and tree.
ffmpeg.js is probably outputting asm.js, which can be very slow.

$ npm install ffmpeg.js@4.2.9003
$ tree node_modules/ffmpeg.js
├── COPYING.GPLv2
├── COPYING.LGPLv2.1
├── LICENSE.MP4
├── LICENSE.WEBM
├── README.md
├── ffmpeg-mp4.js
├── ffmpeg-webm.js
├── ffmpeg-worker-mp4.js
├── ffmpeg-worker-webm.js
└── package.json

In contrast, ffmpeg.wasm uses WASM threads and is fast, but this requires SharedArrayBuffer, which is difficult to implement due to Spectre, so it will only work on Chrome 74 or later.

@florian-milky
Copy link
Author

Thanks a lot for the explanations.
For what it's worth, I did a quick comparison with both libraries, and I found out that this one is indeed faster (about 2x faster for my use case).
Unfortunately in my use case, it's still too slow to be usable in production. I'm following #84 to see if this could be another performance improvement.

@AlexVestin
Copy link

I took a stab at porting som of the SIMD code for x264 to intrinsics (https://github.com/AlexVestin/x264-simd). There's definitely some room for speedups, though I couldn't get it match the native (relative) performance. Also since it's not released yet (although it seems to be coming soonisch) it might be worth to wait for something like WebCodecs

@jeromewu
Copy link
Collaborator

jeromewu commented Nov 4, 2020

@AlexVestin Looking forward to x264-simd! I believe it will be a huge speed up to ffmpeg.wasm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants