Need help getting FFmpeg working on Workers (close, have got it working when running locally)
With some help from @Rui Figueira, I can get ffmpeg-wasm working on Workers, but cannot upload the bundle to Cloudflare as it is over 10mb. I have tried to download the wasm binary from a bucket and load it dynamically, but I cannot seem to get it to work with the Workers runtime and the Wrangler build tool. I saw something about Vite maybe being able to use URLs for imports, but I have no experience with this. Has anyone been able to do this? Or know of any solutions.
Here is the code:
I thought of maybe recompiling the wasm to only include the formats I needed, but I am unsure on how to do this - might try it tomorrow.
If anyone has any ideas or tips, that would be very helpful.
5 Replies
GitHub
ffmpeg.audio.wasm/build/ffmpeg.audio.core/v5 at master · JorenSix/...
An audio focused ffmpeg build for the web. Contribute to JorenSix/ffmpeg.audio.wasm development by creating an account on GitHub.
that ffmpeg.core.wasm is only 5MB
from the project README: . This repository provides a audio focused WebAssembly build of ffmpeg together with some examples on how it can be used.
Cloudflare Docs
Containers (Beta)
Run code written in any programming language, built for any runtime, as part of apps built on Workers.
I think containers may be the best tool for running ffmpeg
that's actually the usecase of this video: https://www.youtube.com/watch?v=oyOaxMY4eNo
Cloudflare Developers
YouTube
Cloudflare Containers 101 - Run Docker Containers on the Edge
Cloudflare Containers combine the speed and simplicity of Workers with the flexibility of full server-side runtimes like Go, Python, or custom binaries. In this video, we’ll walk you through deploying your first container, understanding how it works, and what you can build with it.
Whether you're building AI tools, using legacy binaries, or j...