Instead of: ffmpeg -i video.mp4 -vf "fps=15,scale=480:-1:flags=lanczos" -loop 0 output.gif
You write: ff convert video.mp4 to gif
More examples: ff compress video.mp4 to 10mb ff trim video.mp4 from 0:30 to 1:00 ff extract audio from video.mp4 ff resize video.mp4 to 720p ff speed up video.mp4 by 2x ff reverse video.mp4
There are similar tools that use LLMs (wtffmpeg, llmpeg, ai-ffmpeg-cli), but they require API keys, cost money, and have latency.
Ez FFmpeg is different: - No AI – just regex pattern matching - Instant – no API calls - Free – no tokens - Offline – works without internet
It handles ~20 common operations that cover 90% of what developers actually do with ffmpeg. For edge cases, you still need ffmpeg directly.
Interactive mode (just type ff) shows media files in your current folder with typeahead search.
npm install -g ezff
- Sometimes English is not swell as a specification format.
> ff trim video.mp4 from 0:30 to 1:00
Does this mean I keep the indicated section or does it mean I throw it away?
And many other examples of English sucking at ambiguity when precision matters. Maybe this is a corollary of " naming things is hard ".
- Days since last ffmpeg CLI wrapper: 0
It's incredible what lengths people go to to avoid memorizing basic ffmpeg usage. It's really not that hard, and the (F.) manual explains the basic concepts fairly well.
Now, granted, ffmpeg's defaults (reencoding by default and only keeping one stream of each type unless otherwise specified) aren't great, which can create some footguns, but as long as you remember to pass `-c copy` by default you should be fine.
Also, hiding those footguns is likely to create more harm than it fixes. Case in point: "ff convert video.mkv to mp4" (an extremely common usecase) maps to `ffmpeg -i video.mkv -y video.mp4` here, which does a full reencode (losing quality and wasting time) for what can usually just be a simple remux.
Similarly, "ffmpeg extract audio from video.mp4" will unconditionally reencode the audio to mp3, again losing quality. The quality settings are also hardcoded and hidden from the user.
I can sympathize with ffmpeg syntax looking complicated at first glance, but the main reason for this is just that multimedia is really complicated and that some of this complexity is necessary in order to not make stupid mistakes that lose quality or waste CPU resources. I truly believe that these ffmpeg wrappers that try to make it seem overly simple (at least when it's this simple, i.e. not even exposing quality settings or differentiating between reencoding and remuxing) are more hurtful than helpful. Not only can they give worse results, but by hiding this complexity from users they also give users the wrong ideas about how multimedia works. "Abstractions" like this are exactly how beliefs like "resolution and quality are the same thing" come to be. I believe the way to go should be educating users about video formats and proper ffmpeg usage (e.g. with good cheat sheets), not by hiding complexity that really should not be hidden.
Edit: Reading through my comment again, I have to apologize for the slightly facetious opening statement, even if I quality it later on. The fact that so many ffmpeg wrappers exists is saying something about its apparent difficulty, but as I argue above, a) there are reasons for this (namely, multimedia itself just being complicated), and b) I believe there are good and bad ways to "fix" this, with oversimplified wrappers being more on the "bad" side.
- When converting video to gif, I always use palettegen, e.g.
See also: this blog post from 10 years ago [1]ffmpeg -i input.mp4 -filter_complex "fps=15,scale=640:-2:flags=lanczos,split[a][b];[a]palettegen=reserve_transparent=off[p];[b][p]paletteuse=dither=sierra2_4a" -loop 0 output.gif[1] https://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
- is this better than just ask any llm cli tool (warp, codex, gemini, claude code, etc.) to generate ffmpeg command for you?
- The one good usecase I've found for AI chatbots, is writing ffmpeg commands. You can just keep chatting with it until you have the command you need. Some of them I save as an executable .command, or in my .txt note.
- I like it and would like to see an entire Linux OS being done in a similar manner. Or shell / wrapper / whatever.
A sane homogeneous cli for once, that treats its user as a human instead of forcing them to remember the incompatible invocation options of `tar` and `dd` for absolutely no reason.
And add amazing autocomplete, while allowing as many wordings as possible. No need for LLMs.zip my-folder into my-zip.tar with compression level 9 write my-iso ./zip.zip onto external hard drive git delete commit 1a4db4c convert ./video.mp4 and ./audio.mp3 into ./out.mp4 merge ./video.mp4 and ./audio.mp3 to ./out.mp4 without re-encodingOne can dream.
- Can't access the githup repo https://github.com/josharsh/ezff
- The github repo link from the npm page doesn't work, so I guess the author had second thoughts.
I was just fighting ffmpeg earlier today, or rather Gemini and Claude were fighting it. Task: create a video that is a pan across a photo, followed by a scale/zoom.
Probably easy for some people, but I had no clue and the LLMs weren't doing that well either. Things took a turn for the better when I asked Gemini for an alternative tool.
The answer was Vapoursynth - https://www.vapoursynth.com/doc/introduction.html#introducti...
Again, the LLM did the work, but it was able to do so. Since Vapoursynth is driven by python scripts (though with the extension .vpy), it was easy for me to make adjustments.
- I would definitely use an LLM, to see what the suggested options do and tweak them.
Using a different package name could be helpful. I searched for ezff docs and found a completely different Python library. Also ez-ffmpeg turns up a Rust lib which looks great if calling from Rust.
- > it handles 20 common patterns ... that cover 90%
Could you elaborate on this? I see a lot of AI-use and I'm wondering if this is claude speaking or you
- LLMs are a great interface for ffmpeg. Sometimes it takes 2-3 attempts/fixes ("The subtitles in the video your command generated are offset: i see the subtitles from the beginning of the movie but the video is cut from the middle of the movie as requested, fix the command") but it generally creates complex commands much more quickly than manual work (reading the man page, crafting the command, debugging it) would.
- That's the problem ideally solved by typed data, i.e., some UI where instead of trying to memorize whether it's thumb/s/nails you can read the closed list of alternatives, read contextual help and pick one
- npm? Have we learned nothing from the weekly node/npm security breaches? Not putting that hot mess anywhere near my dev box, thanks.
- The total upheaval of the current computing paradigm that AI will bring, if nothing else, is
"Hey computer, can you convert that funny kitchen cooking scene in this movie to a .gif I can share online?"
You're wasting your time on a dead man walking paradigm doing anything else. "Plain English" actually means plain English now.
- Somehow it seems ffmpeg has become the "Can it run crysis" of UX design
- Love the simplification of ffmpeg flags. I noticed some comments about Node.js dependencies. Are there plans to make this a standalone binary for faster server-side processing?
- This is extremely sexy and represents a great trade off where the ergonomics can be improved without sacrificing the incredible investments in a high performance library.
- This looks handy.. along with the odd gist of "convert mkv to mp4" that I have to use every other week.
Quite telling that these tools need to exist to make ffmpeg actually usable by humans (including very experienced developers).
- Very cool idea since ffmpeg is one of those tools that has a few common tasks but most users would need to look up the syntax every time to implement them (or make an alias). In line with the ease of use motivation, you might consider supporting tab completion.
- I like the idea, but a CLI utility dependent on Node.js is not a good thing frankly.
- I can only speak to my experience, but I spent a long time being puzzled by video editor user interfaces, until I ran into ScreenFlow about ten years ago. For whatever reason, the UI clicked, and I've used it ever since. It's a single purchase, not monthly, and relatively affordable. https://www.telestream.net/screenflow/overview.htm
- No AI is appealing but there is the cliff problem. If there is one small thing the mini language can't handle, the user would have no chance solving it themselves. They might as well start with an LLM solution first.
One workaround is that when there is syntax error, let user optionally switch to LLM?
- GitHub repo link returns 404.
- I have a little script that I use on the CLI to do this kind of stuff (calls an LLM to figure out how to do CLI stuff) but you can just as easily now use any of the coding agents.
- I actually just use Claude code. “Stabilize the video x.mp4 and keep my daughter Astra as the subject. Convert it to a GIF that is under a megabyte”. It does a great job.
It will sample images from the video then go crop the video to that, stabilize if required, and then make me an optimized GIF that I can put in my weekly journal.
- Inspiring! I just asked Cursor to make llmwrap inspired by this, it's like rlwrap (readline wrap) but with LLMs!
- Where's the public Git repository for this project? The GitHub link on the NPM page seems broken to me.
- That's beautiful! I see a .claude folder in your code, I am curious if you've "vibecoded" the whole project or just had claude there for some tasks! not that it matters or takes away from your work but just pure curiosity as someone who enjoys betting on the LLM output XD
- I was surprised that macOS (QuickTime/Preview, iMovie) can't read .mp4 files. Not sure if it was due to H.265 or the audio codec. I tried using ffmpeg to convert to .mov but that also failed to open, since I guess MOV is just another container format.
Is there an easier way?
- interesting approach, i solved similar problem by creating visual tool to generate ffmpeg commands but its not the same(it cant do conversion etc.)
I like that you took no AI approach, i am looking for something like this i.e. understanding intent and generating command without using AI but so far regex based approaches have proved to be inadequate. I also tried indexing keywords and creating index of keywords with similar meaning that improved the situation a bit but without something heavy like bert its always a subpar experience.
- I would love to see something like this for OpenSSL
- Thanks, will definitely check this out
Has anyone else been avoiding typing FFmpeg commands by using file:// URLs with yt-dlp
deleted
- Sometimes an idea comes along thats so obvious it makes me angry. I have been struggling with ffmpeg commands for over well a decade. All the time I wasted googling and creating scripts so I wouldn't have to regoogle and this could have existed literally from day one
- FFMPEG is so goddamn cool, I was doing a mod for warcraft 3 where I restore the original Frozen Throne UI and one (especially useful before, Blizzard now restored the classic WEBM models so that part is now outdated but the blue buttons and other stuff are still relevant).
And virtually every method was failing in decoloring the "chains".webm video that Reforged has on the bottom corners (by default it has a very rusty feeling that fits reign of chaos more than the frozen throne)... but FFMPEG via commands did it perfectly fine, extremely easily by doing it frame by frame, actually incredible that this software is completely free.
- Small English nitpick:
> ff slow down video.mp4 by 2x
How do you slow something down by 2x? x is a multiplier. 2 is a number greater than 1. Multiplying by a number greater than 1 makes the result LARGER.
If you’re talking about “stretch movie duration to 2x”, say that instead.
Saying something is 2x smaller or 2x shorter or 2x cheaper doesn’t make sense. 2x what? What is the unit of “cheap” or “short” or “small”?
How much is “1 slow down”? How many “slow down” are in the movie where you want twice as many of them? Doesn’t make sense does it? So how can something be slowed by 2x? That also doesn’t make sense.
I know what is trying to be said. I know what is meant. Please just say it right. Things like throw us autistic people for a freaking loop, man. This really rustles our jimmies.
Language is for communicating. If we aren’t all on the same page about how to say stuff, you spend time typing and talking and writing and reading and your message doesn’t make it across the interpersonal language barrier.
I don’t want to see people wasting their time trying to communicate good ideas with bad phrasing. I want people to be able to say what they mean and move on.
I also don’t want to nitpick things like this, but I don’t want phrases like “slow down by 2x” to be considered normal English, either, because they aren’t.
- There is no need for a wrapper or memorizing syntax in our new llm world.
- This is very nice. When I use ffmpeg recently I usually ask an LLM first but it often takes a few tries to get the exact incantation right.
On a side note (I’m not a web developer), why would a command line tool like this be written and distributed using node.js? Seems like an unnecessary risk to use JavaScript for a basic (local) command line tool. Couldn’t this be written more simply in like Rust or something?
- Uhm... Millibit, Millibyte, Megabit, Megabyte?
- claude cli for ffmpeg is op lol
- See also:
https://github.com/dheera/scripts/blob/master/helpme
This evolved from an ffmpeg wrapper I wrote before:helpme ffmpeg assemble all the .jpg files into an .mp4 timelapse video at 8fps