SharedArrayBuffer is not defined error in chrome ver 111
Describe the bug SharedArrayBuffer error
To Reproduce Steps to reproduce the behavior: When perform load() function using ffmpeg, error is occured. (//cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/ffmpeg.min.js)
- create html file.
- type like below.
- call ffmpeg.load on javascript file.
- Error!!
Expected behavior Not error, working well.
Screenshots

Desktop (please complete the following information):
- OS: [e.g. iOS] Ubuntu 20.04
- Browser [e.g. chrome, safari] chrome
- Version [e.g. 22] 111
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context [ fileUpload.html ]
[ fileHandler.js ] const startButton = document.getElementById('encodeButton'); startButton.addEventListener('click', async () => { const inputFile = document.getElementById('inputFile').files[0]; if (!inputFile) { return; }
const { createFFmpeg } = FFmpeg; const ffmpeg = createFFmpeg({ log: true });
// FFmpeg loading console.log("Before ffmpeg.load"); await ffmpeg.load(); console.log("After ffmpeg.load");
alert(inputFile.name); });
Read the Browser section https://github.com/ffmpegwasm/ffmpeg.wasm#installation
Why does this project work without SharedArrayBuffer? https://github.com/bgrins/videoconverter.js
I faced this error when trying to multithread with this library if you are trying to do that, make sure you setup a server in backend and see the sample code provided in this repo for reference, take a look at it for solving your problem
https://github.com/ffmpegwasm/ffmpeg.wasm/tree/main/apps/vanilla-app
You can use https://github.com/gzuidhof/coi-serviceworker which fix the issue for me.
@gabrielstuff
Thanks for the share, coi-serviceworker do help SharedArrayBuffer problem in latest chrome.
Old version chrome do support SharedArrayBuffer syntax js, but deprecated.
convert 10/fps mp4 is fast, h265 works also with ffmpeg.wasm,
trying to feed file via websocket, if ffmpeg.wasm could convert RTSP firectly.
RTSP -> websocket -> mp4 -> ffmpeg -> livePlay