

SharedArrayBuffer is a pretty new data type in JavaScript, right now most of the browsers still lack of fully support due to security issues. ffmpeg.FS('readdir', '/') : list files inside specific pathįor full list of APIs, you can check: SharedArrayBuffer.ffmpeg.FS('unlink', 'filename') : delete a file in MEMFS.ffmpeg.FS('readFile', 'filename') : read file from MEMFS as output of ffmpeg.wasm.ffmpeg.FS('writeFile', 'filename', data) : write file to MEMFS as input of ffmpeg.wasm.

It is essential as we want to keep minimal changes to FFmpeg source code and reserve its maxium similarity to original command line interface. (In ffmpeg.wasm we use MEMFS / Memory File System) You can imagine this FS just like a hard disk where you can put the input file and pull the output file from ffmpeg.wasm command. When you check the API of ffmpeg.wasm, you may find an API called ffmpeg.FS() to handle File System operations. Download ffmpeg-core.js from remote server (which is around 25MB)ĭepending on your network speed and host machine hardware, this operation can take up to minutes to complete.To fully utilize/understand the power of ffmpeg.wasm (also for most WebAssembly libraries), few technical details you might want to know: Inside ffmpeg.load()įfmpeg.load() is a required API to call before you call others. A demo to transcode AVI to x264 MP4 Behind the scene
