Hacker News new | past | comments | ask | show | jobs | submit login

I know there are JavaScript ports of FFmpeg and I would love to use them. But so far, I never got it working. I tried it with AI and this prompt:

    Make a simple example of speeding up an mp4
    video in the browser using a version of ffmpeg
    that runs in the browser. Don't use any server
    side tech like node. Make it a single html file.
But so far every LLM I tried failed to come up with a working solution.





If you visit the ffmpeg.wasm documentation, the first example on the Usage page does almost exactly this:

https://ffmpegwasm.netlify.app/docs/getting-started/usage

It transcodes a webm file to MP4, but making it speed up the video is trivial: just add arguments to `ffmpeg.exec()`. Your lack of success in this task is trusting an LLM to know about cutting-edge libraries and how to use them, not a lack of progress in the area.


The problem is that they don't provide the full code that can run in the browser. I have not managed to get the function they show in the first example to run in the browser.

You don’t need an LLM to do that. The code in there is almost complete…

Listen buddy, I need an LLM to tie my shoes, don't be so judgemental.

That's just wrong. The example is live: you can run it right there on the page. If the code isn't working when you write it, you're probably importing something incorrectly (or you're not running it in an environment with React, which is where the `use*` functions come from). You can even click on the source of the log lines when the example is running (on the right edge of the Chrome console) to jump into the hot-loaded code and see the exact code that's running it.

I think there is some kind of misunderstanding here.

You say "an environment with React". My environment is the browser.

I don't know how one is supposed to run that nameless function on that page. What I am looking for is a simple, complete example in HTML that can run standalone when opened in the browser. Without any server side processing involved.


If you want to copy/paste, try taking the first example and asking the llm to refactor the code to run in a browser with no dependencies. It should be able to strip out the react stuff, or at least get it close and you can fix it from there.

I have tried that a bunch of times and a bunch of ways and did not get ffmpeg to work.

It might have to do with these two strange comments at the top:

    // import { FFmpeg } from '@ffmpeg/ffmpeg';
    // import { fetchFile, toBlobURL } from '@ffmpeg/util';
The rest of the code seems to assume "FFmpeg", "fetchFile" and "toBlobUrl" are somehow magically available. Neither me nor any LLM have yet managed to get these into existance.

OK to your credit your original request was to get this all working in a single html file. That is not possible with the easy paths documented on ffmpeg.

By default, the build relies on web workers which need to load their code from somewhere (and usually it has to be the same origin as the code making the request)

Through much mastery of JS build systems that I would not wish on my enemies, I bet you could get it working on localhost, but you’ll have a much better time of it if you set up vite or something for a local build. You can still easily do a “serverless” deploy with GitHub pages or similar but you do need an http server correctly configured for asset requests.


I just threw that prompt into the free ChatGPT, looks like it'll have a few versioning as well as CORS issues...

Don't try to do cutting edge stuff with a brain that doesn't know anything past a certian date.

Trying to do things off the beaten path with LLMs is rarely successful, especially if there's a related much more popular option.

I'm convinced that programmers' bias towards LLMs is strongly correlated with the weirdness of their work. Very often my strange ideas pushed to LLMs look like solutions but are rather broken and hallucinated attempts which only vaguely represent what needs to be done.


> I'm convinced that programmers' bias towards LLMs is strongly correlated with the weirdness of their work.

This is an extremely astute observation; my work has always been somewhat weird and I've never found LLMs to be more then an interesting party-trick


The JS ports of FFmpeg (or WASM port if you want the in-browser approach) are very old and would be more than present in modern LLM training datasets, albeit likely not enough of a proportion for LLMs to understand it well.

https://github.com/Kagami/ffmpeg.js/

https://github.com/ffmpegwasm/ffmpeg.wasm


Entered the same prompt with Sonnet 4. Just needed to paste the two errors in the console (trying to load the CDN which won't work since it uses a web worker, and hallucinated an ffmpegWasm function) and it output an HTML file that worked.

Can you put it on jsfiddle or some other codebin? I would love to see it.

> But so far every LLM I tried failed to come up with a working solution.

Maybe you need to actually learn how it works instead of deferring to LLMs that have no understanding of what you are specifically requesting.

Just read the fine documentation.


I'm sorry, but if you give up on something you would "love to use" just because LLMs are unable to oneshot it then you might be a bit too dependent on AI.

Time is a finite resource, and there's an opportunity cost. If an easy PoC for a complex project can't be created using AI and it would take hours/days to create a PoC organically that may not even be useful, it's better project management to just do something else entirely if it's not part of a critical path.

I can't disagree with this take more vehemently. This isn't an "easy PoC". This is "copy and paste it from the docs"-level effort:

https://ffmpegwasm.netlify.app/docs/getting-started/usage/

If you can't be arsed to google the library and read the Usage page and run the _one command_ on the Installation page to come up with a working example (or: tweak the single line of the sample code in the live editor in the docs to do what you want it to do), how do you expect to do anything beyond "an easy PoC"? At what point does your inability/unwillingness to do single-digit-minutes of effort to explore an idea really just mean you aren't the right person for the job? Hell, even just pasting the code sample into the LLM and asking it to change it for you would get you to the right answer.


I was commenting on the general assertion of the GP's comment, not this specific instance.

Another commenter showed how they were able to use Claude to do this in two messages: one to write the code, a second to paste the error that comes out so Claude can fix it. The exact word of the comment you replied to was "oneshot": if you're going to outsource 100% of the thinking involved in the task to a machine and can't even be bothered to copy over the error you're getting after the first response, my response remains the same.

Can you link to that comment? I don't see a mention of "Claude" anywhere in this thread. Also nobody here showed they were able to "do this" yet.

If there is a "copy and paste" way to get that to run in the browser, can you copy and paste it to a jsfiddle and post the link to the fiddle here?

You’re basically asking people to do your homework for you at this point…

He said it is a matter of copy+paste, not work.

I don't think so as I did not get it to run. And if he really can accomplish it with copy+paste, why wouldn't he demonstrate it?


Because he doesn't want to do that for you for free I guess :)

"Tap with a hammer: $1. Knowing where to tap: $9999."


As long as you make sure the npm package is available, you can! If you can't figure out how to do it, I'm sorry but I literally can't think of a way to make it less effort. The problem you described in another comment with the import statements is literally explained on the Installation page of the documentation.

As I said in my original comment that started this thread, I don't use any server side tech. So there is no "npm package". I am only using a browser.

You don't need to be on the server to use NPM. NPM just downloads the code. I'm honestly not sure if you're just trolling at this point

if you‘re really interested in doing that, i‘m certain you can with a bit of effort. There are plenty of docs and examples online.

You know there's ... documentation, right?

LLM is my eyes. LLM is my ears. LLM is my documentation. I am LLM.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: