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.