ffmpeg support?
Hi, I'm trying to use ffmpeg on an action, I see that it is not installed on the OS image, so I need to install it via npm, but looks like I can't deploy the action, I keep seeing 500 errors, but I think this is due to the ffmpeg installer npm package.
Any ideas of how can I use ffmpeg on an action, or is that use case not supported?
(I see the functions have a 512mb limit, 10 minute execution but it should be enough for my use case)
This is a minimum reproducible example:
"use node";
import { action } from "./_generated/server";
import { v } from "convex/values";
import { path as ffmpegPath } from '@ffmpeg-installer/ffmpeg'
export const transcribe = action({
args: { id: v.string(), from: v.number() },
handler: async (ctx, args) => {
console.log(ffmpegPath);
},
});
The errors I'm seeing:

7 Replies
@plebtaste hey! I'm guessing that ffmpeg relies on some system libraries and things that we might not have available in our node runtime currently. @presley might have a better idea about this
The error message you get doesn't seem right, though. It should have shown a better error message.
It does seem like ffmpeg relies on some native libraries. Will take a look to confirm.
Yeah, seems like ffmpeg doesn't work well with es-build builder. We are working on getting that fixed.
was there ever any progress on this @presley ? I just tried and still get erorrs
Try out https://docs.convex.dev/functions/bundling#external-packages if you haven't yet. I haven't tried this with ffmpeg personally, so I'm not sure if this would work, so would appreciate a report back!
Bundling | Convex Developer Hub
Bundling is the process of gathering, optimizing and transpiling the JS/TS
Oh cool! thanks ill have a look
ah.

there are probably other ffmpeg options tho, ill investigate 🙂