-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
Please add browser build of ffmpeg.js #172
Comments
@zackees this package already works on the browser, but it is also a single threaded build. You can use the Web Worker version and run multiple instances in parallel to process multiple files, but a single file can only be processed in a single thread. |
Here's an example that I created: https://www.zaxtunes.com/client_transcoder/ Now everyone trying to find the same thing can just use my code instead. Cheers, |
@zackees Aren't you using https://github.com/bgrins/videoconverter.js instead tho? At least this is what is in the header of the
|
https://github.com/bgrins/videoconverter.js doesn't know how to seperate responsibilities, the gui code is intrained with the ffmpeg stuff. My example is entirely separate. |
@zackees Is this example still available somewhere? I'm also struggling to use ffmpeg.js in the browser. The NPM build seems to be using some
|
I was able to find a working version in another code repo somewhere but it was SOOOOOOOOOOO SLOWWWW it wasn't worth it. |
@siebediels - did you ever find a solution to this? @zackees, I can't access https://www.zaxtunes.com/client_transcoder/ \ anymore. Are you using ffmpeg.js or ffmpeg.wasm? I believe the only solution right now for this issue is to use this library instread https://github.com/ffmpegwasm/ffmpeg.wasm |
I've made the repo public and you can clone to this commit: |
I'm using vite with the plugin "vite-plugin-require". import { defineConfig } from 'vite';
import vitePluginRequire from "vite-plugin-require";
export default defineConfig({
plugins: [
vitePluginRequire.default()
]
}); That way I can use require in the browser as shown in the readme.
Works fine but I haven't tried the web worker yet. |
你好请问你在浏览器端正常使用了吗?我从npm上安装的版本会报错 |
Yes I use this library in the browser. Note that I use vite together with the plugin "vite-plugin-require" for that. You can take this repository for reference on how to use ffmpeg.js in your browser with and without WebWorkers: |
|
In my tests, ffmpeg({
...
arguments: ["-i", inputFileName, outputFileName], //add further arguments here
...
}) |
Right now the internet is stuck on ffmpeg wasm because of the shared array buffer issue. The solution apparently is a single threaded version of ffmpeg.js
Right now you have a node version. This request is to have a build for the browser version. This would open up a whole bunch of excited tooling to really accelerate video and audio editing in the browser.
The text was updated successfully, but these errors were encountered: