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

Shared array buffer is not defined

Open usamazubair opened this issue 3 years ago • 9 comments

Describe the bug I am using the ffmpeg v0.9.7 but when it try to convert from webm to mp4 it gives me the error i.e. Share array buffer is not defined.

headers console I have uploaded the images one is for my error and one image is to display the headers.

If someone know the solution kindly provide me the solution.

Thank you in advance.

usamazubair avatar Oct 13 '21 15:10 usamazubair

Are you setting the COOP/COEP headers on the base document (the html file) too?

AlexVestin avatar Oct 13 '21 17:10 AlexVestin

Are you setting the COOP/COEP headers on the base document (the html file) too?

No I don’t add these headers. Can you please help me how to add those headers into my index.html file?

usamazubair avatar Oct 14 '21 10:10 usamazubair

It depends on how you serve your files. Just google "(your server, e.g. express) how to set headers" and set the required headers from here https://web.dev/coop-coep/

AlexVestin avatar Oct 14 '21 17:10 AlexVestin

It depends on how you serve your files. Just google "(your server, e.g. express) how to set headers" and set the required headers from here https://web.dev/coop-coep/

I have already added these headers on my server. You can check in the image. I have also share the image of header

usamazubair avatar Oct 14 '21 19:10 usamazubair

Hello, I had same problem. The easiest solution: Add this code to your index.html <script> if (!crossOriginIsolated) SharedArrayBuffer = ArrayBuffer; </script>

SZtyro avatar Oct 30 '21 07:10 SZtyro

@SZtyro When i try this i get a BAD MEMORY error message.

Zophiel avatar Dec 02 '21 13:12 Zophiel

@Zophiel I also get this error, but only the first time I use the plugin, the next time I use it works as normal. For now, this solution is fine for me, but please let me know if you find a better one.

SZtyro avatar Dec 02 '21 14:12 SZtyro

It works for me if to add this block of code into the scripts/server.js file (after 12th row)

app.use(function(req, res, next) { res.header("Cross-Origin-Embedder-Policy", "require-corp"); res.header("Cross-Origin-Opener-Policy", "same-origin"); next(); });

danyayoe avatar Jan 11 '22 22:01 danyayoe

Share array buffer is not defined.

Setting the COEP and COOP headers is one ingredient. The other is accessing the page via https. Are you doing that or are you accessing via http?

bothie avatar Jun 30 '22 06:06 bothie