0

I am developing an application in Next.js and I need to be able to send images and videos to an API. These images and videos need to be compressed and they have to be in a specific format. I need to be able to process these medias in the frontend but I don't know if that is possible. I would like to know if there is a sharp package equivalent in the frontend and the same for videos. I thought about using WebAssembly but I don't know if that is the way to go.

I saw the solution that uses canvas but I don't like this option and that doesn't let me process videos.

1 Answers1

0

The most versatile video processing approach for front end, i.e. browser, is likely a ffmpeg based JavaScript implementation.

One of the leading implementations, which leverages Web Assemnply language is:

You do need to be aware of the need for SharedArrayBuffer support:

Only browsers with SharedArrayBuffer support can use ffmpeg.wasm, you can check HERE for the complete list. The link referred to above is here:

https://caniuse.com/sharedarraybuffer

Mick
  • 24,231
  • 1
  • 54
  • 120