ffmpeg.js icon indicating copy to clipboard operation
ffmpeg.js copied to clipboard

Please add browser build of ffmpeg.js

Open zackees opened this issue 3 years ago • 9 comments

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.

zackees avatar Jan 08 '22 21:01 zackees

@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.

thiagorb avatar Jan 09 '22 09:01 thiagorb

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, ~Z~

zackees avatar Jan 10 '22 02:01 zackees

@zackees Aren't you using https://github.com/bgrins/videoconverter.js instead tho? At least this is what is in the header of the ffmpeg-asm.js you pointed out in the H1 of your website.

/*
Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other
files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
FFmpeg.
The source code used to build this file can be obtained at https://github.com/bgrins/videoconverter.js,
and in zip form at https://github.com/bgrins/videoconverter.js/archive/master.zip
*/

brunoluiz avatar Jan 12 '22 23:01 brunoluiz

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 avatar Jan 17 '22 05:01 zackees

@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 process.stdin() methods which aren't available in browser (#137). I would like to use it in a normal webpack app, e.g.


import ffmpeg from 'ffmpeg.js'; // Import node_module

const result = ffmpeg({
  MEMFS: [{ name: 'test.mkv', data: new Uint8Array() }], // Uint8Array is of course filled with actual data
  arguments: ['-i', 'test.mkv', '-c:v', 'rawvideo', '-an', 'out.webm'],
});

siebediels avatar May 03 '22 16:05 siebediels

I was able to find a working version in another code repo somewhere but it was SOOOOOOOOOOO SLOWWWW it wasn't worth it.

zackees avatar May 03 '22 21:05 zackees

@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

eulphean avatar Jun 23 '22 02:06 eulphean

I've made the repo public and you can clone to this commit:

https://github.com/zackees/zaxtunes.com/commit/e3d438eb65efb5110fd71ed2d816a258ee64f579

zackees avatar Jun 23 '22 18:06 zackees