Back

Show HN: Ez FFmpeg – Video editing in plain English

420 points1 monthnpmjs.com

I built a CLI tool that lets you do common video/audio operations without remembering ffmpeg syntax.

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

qbow8831 month ago

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.

Tempest19811 month ago

> It's really not that hard,

I've learned not to say this. Different things are easy/hard for each of us.

Reminds me of a discussion where someone argued, "why don't all the poor/homeless people just go get good jobs?"

Edit: I know your comment was meant to inspire/motivate us to try harder. Maybe it's easier than it appears.

there_is_try1 month ago

Empathy is really not that hard.

josephg1 month ago

It is that hard for some. Empathy requires actually going out and talking to people. And then listening to them describe their experiences, without editorialising or interrupting.

I've met plenty of engineers who would rather spend 2 weeks programming than spend 5 minutes talking to their users. I used to struggle a lot with this myself when I was younger. Social anxiety isn't easy to overcome.

ranger_danger1 month ago

With so many people lacking emotional intelligence, I would strongly disagree with you.

MattDaEskimo1 month ago

I would agree with this statement before LLMs. Reading manuals can take time, be messy, and are sometimes hard to understand.

Now, I can simply ask any LLM to write the command, and understand any following issues or questions.

For example, my OS records videos as WEBM. Using the default settings for transforming to MP4 usually fails from a resolution ratio issue. I would be deadlocked using this library.

It really isn't that hard anymore.

stevage1 month ago

I sometimes use LLMs to generate commands, and it generally works. But a common issue is that it throws in extra options because they are very commonly used - even if they're not necessary or relevant to my actual situation. So if you don't go through and check them all, you get this kind of unchecked cruft in your scripts that may later cause a problem.

russfink1 month ago

Except what if you don’t really grok those ffmpeg flags and the LLM tells you something wrong - how will you know? Or more common, send you down a re-encode rabbit hole when you just needed a simple clipping off the end?

ThrowawayTestr1 month ago

ChatGPT is pretty good at generative commands

ninalanyon1 month ago

> It's really not that hard,

if you are doing it often that's true. But for people like me who do it once every month or two it really is hard to memorize, especially if it's not exactly the same task.

What I would love would be an interactive script that asked me what I was trying to do and constructed a command line for me while explaining what it would do and the meaning of each argument. And of course it should favour commands that do not re-encode where possible.

crazygringo1 month ago

I swear I want this as a general tool for all command-line tools.

Start the tool, and just list all of the options in order of usage popularity to toggle on as desired, with a brief explanation, and a field to paste in arguments like filenames or values when needed. If an option is commonly used with another (or requires it), provide those hints (or automatically add the necessary values). If a value itself has structure (e.g. is itself a shell command), drill down recursively. Ensure that quotes and spaces and special characters always get escaped correctly.

In other words, a general-purpose command-line builder. And while we're at it, be able to save particular "templates" for fast re-use, identifying which values should be editable in the future.

I can't be the first person to think of this, but I've never come across anything like it and don't understand why not. It doesn't require AI or anything. Maybe it's the difficulty involved in creating the metadata for each tool, since man pages aren't machine-readable. But maybe that's where AI can help -- not in the tool itself, but to create the initial database of tool options, that can then be maintained by hand?

(Navi [1] does the templating part, but not the "interactive builder" part.)

[1] https://github.com/denisidoro/navi

darrenf1 month ago

I’m trying to understand the “In order of usage popularity” thing — this implies telemetry in CLIs, doesn’t it? Wouldn’t the order of options change/fluctuate over time?

Or if no telemetry but based on local usage, it would promote/reinforce the options you already can recall and do use, hiding the ones you can’t/don’t?

+1
crazygringo1 month ago
reassess_blind1 month ago

Just do a best-guess list. Or do a survey. Or just scrape the most common features used across Github repos.

pathartl1 month ago

The problem is always going to be that everyone has their own way of structuring arguments and providing help text. You could probably do it with PowerShell.

larodi1 month ago

Indeed why not have —tui option and some basic menu? Even a simplified scripting with reasonable API would be better.

I find myself bothering exactly zero times to memorise this obnoxiously long command line. Claude fills in, and I can explore features better. What’s not to like? That I’m getting dumber for not memorising pages of cli args?

Love the project, but as with every Swiss knife this conversation is a thing and relevant. We had similar one reg JQ syntax and I’m truly convinced JQ is wonderful and useful tool. But I’m not gonna bother learning more DSLs…

josephg1 month ago

> What I would love would be an interactive script that asked me what I was trying to do and constructed a command line for me while explaining what it would do and the meaning of each argument. And of course it should favour commands that do not re-encode where possible.

My ChatGPT history is full of conversations like this.

I have mixed feelings about using chatgpt to write code. But LLMs certainly make an excellent ffmpeg frontend. And you can even ask them to explain all the ffmpeg arguments they used and why they used them.

magicalhippo1 month ago

And they change quite frequently, from our POV.

That said, I started wrtiting scripts when I use ffmpeg some time ago. At least then I have a non-zero starting point next time.

navane1 month ago

I also use ffmpeg once a month. My new plan: build my own scripts like the ones in op. But self built, only for that operation or three that I do.

juujian1 month ago

Yes, I use ffmpeg about once a year, in about 350 years I really ought to have all the syntax figure out.

mhuffman1 month ago

>It's really not that hard

It is only a couple of thousand options[0], just memorize them! It super simple, barely an inconvenience!

[0]https://gist.github.com/tayvano/6e2d456a9897f55025e25035478a...

BeetleB1 month ago

> It's incredible what lengths people go to to avoid memorizing basic ffmpeg usage. It's really not that hard

It's not hard - just not a good use of our time. For 99% of HN users, ffmpeg is not a vital tool.

I have to use it less than twice a year. Now I just go and get an LLM to tell me the command I need.

And BTW, I spend a lot of time memorizing things (using spaced repetition). So I'm not averse to memorizing. ffmpeg simply doesn't warrant a place in my head.

koyote1 month ago

You're getting a lot of flak due to how you started off your comment, but I mostly agree with you.

In my opinion there are two kinds of users: 1. Users who use FFmpeg regularly enough to know/understand the parameters. 2. Users who only use FFmpeg once in a while to do something specific.

This wrapper is superfluous for users in group number 1. But group number 2 does not really get much out of it either, for the reasons you've mentioned.

As a member of group 2, I usually want to do something very specific (e.g. remove an audio track, convert only the video, remux to a different container, etc.). A simple English wrapper does not help me here because it is not powerful enough; the defaults are usually not what I want. What I need is a tool that will take a more detailed English statement of what I want to achieve and spit out the FFmpeg command with explanations for what each parameter does and how it achieves my goal. We have this today: AI; and it mostly works (once you've gone through several iterations of it hallucinating options that do not exist...).

CamperBob21 month ago

Usually when AI hallucinates an option that doesn't exist, the option really should exist. So then I tell it to add it.

Then, several days later, I crawl away from fighting robots in a rabbit hole, and finally get around to doing what I set out to do in the first place....

qbow8831 month ago

Thank you, this explains my thoughts really well.

Forgeties791 month ago

Some people just want to use an intuitive tool with better QoL, even if it leads to compromises, to do a job swiftly without going over documentation/learning a ton of new things. Not everything has to be an educational experience. ffmpeg exists in its original form like you prefer, but some folks want to use lossless cut. Nothing wrong with that IMO.

Personally I think it’s great that it’s such a universally useful tool that it has been deployed in so many different variations.

hnarn1 month ago

> Some people just want to use a tool to do a job swiftly. Not everything has to be educational.

> some folks want to use lossless cut

In that case I would encourage you to ruminate on what the following in the post you're replying to means and what the implications are:

> "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

Depending on the size of the video, the time it would take you to "do the job swiftly" (i.e. not caring about how the tools you are using actually work) might be more than just reading the ffmpeg manual, or at the very least searching for some command examples.

Forgeties791 month ago

As the other person said (and this is my mistake for not capitalizing), Lossless Cut is a popular CLI wrapper for ffmpeg with a (somewhat) intuitive interface. Someone is going to be able to pick up and use that a lot faster than they are ffmpeg. I think a lot of folks forget how daunting most people find using a terminal, yet a lot of those people still want something to do a simple lossless trim of an existing video or some other little tweak. It’s good that they have both options (and more).

+1
leephillips1 month ago
foodevl1 month ago

> > some folks want to use lossless cut > In that case I would encourage you to ruminate on what the following in the post you're replying to means and what the implications are:

You may have misunderstood the comment: "lossless cut" is the name of an ffmpeg GUI front end. They're not discussing which exact command line gives lossless results.

wpm1 month ago

The thing is that when a video is being re-encoded, so long as I'm not trying to play games on my computer at the same time, I'm free to go do something else. It does not command any of my attention while its working, whereas sitting and reading the man pages commands my attention absolutely.

qbow8831 month ago

Yes, I am not opposed to ffmpeg wrappers in and of themselves. Some decent ffmpeg wrappers definitely exist. But I argue in my comment above that this specific tool does not have better QoL - again, since it reencodes unconditionally with quality settings that are usually not configurable.

Forgeties791 month ago

> 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.

Not really sure how else I was supposed to interpret your comment but clarification taken.

> But I argue in my comment above that this specific tool does not have better QoL

For some folks it may be better/more intuitive. It doesn’t hurt anybody by existing.

We all compromise with different tools in our lives in different ways. It just reads to me like an odd axe to grind.

Simply put: What is so bad about the existence of this project?

+2
qbow8831 month ago
C4K31 month ago

There was an ffmpeg drag-and-drop GUI that let you create ffmpeg commands visually instead of having to remember all the right arguments. Inputs, filters and outputs are all nodes in a graph, and then you connect them together. When done you would export it as an ffmpeg command to run.

As an occasional user this was a lot easier to use than having to remember all of the commands, and it did it all without hiding the complexity from the user.

Unfortunately it looks like they tried to monetize it but then later shut down. It doesn't look like they posted the source code anywhere.

https://web.archive.org/web/20230131140736/https://ffmpeg.gu...

robertheadley1 month ago

Different project, but similar vibe. https://ffstudio.app/

zymhan1 month ago

This is awesome, thank you so much for posting it.

zymhan1 month ago

I recently went looking for that site since I got into tdarr, and I was sad to see it go. It definitely isn't great for "prod" use, but I find that a GUI listing options makes it easier to understand the thought process behind software.

Kills me that they didn't even bother open sourcing it.

e-Minguez1 month ago

If you use it from time to time it would be very challenging to remember the million of different options ffmpeg has.

account4230 days ago

You only need to remember the few options you actually need more than once.

WhitneyLand1 month ago

“It's really not that hard”

I’m going to guess your job does not involve much UX design?

qbow8831 month ago

I'm not saying it couldn't be better (and I even gave examples), my point is that the drawbacks of such a wrapper outweigh the benefits, at least when it's such an oversimplified one. I've said in other replies how I'd be very interested in e.g. an alternative libav* frontend with better defaults and more consistent argument syntax, but I don't think that this invalidates my criticism of the linked project.

christstopit1 month ago

[dead]

zahlman1 month ago

> 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.

I'm usually the one telling everyone else that various Python packaging ecosystem concepts (and possibly some other things) are "really not that hard". Many FFMpeg command lines I've encountered come across to me like examples of their own, esoteric programming language.

> 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.

That sounds like a bug report / feature request rather than a problem with the approach.

> The quality settings are also hardcoded and hidden from the user.

This is intended so that users don't have to understand what quality settings are available and choose a sensible default.

> and that some of this complexity is necessary in order to not make stupid mistakes

For example, the case of avoiding re-encodes to switch between container formats could be handled by just maintaining a mapping.

In fact, I've felt the lack of that mapping recently when I wanted to extract audio from some videos and apply a thumbnail to them, because different audio formats have different rules for how that works (or you might be forced to use some particular container format, and have to research which one is appropriate).

ubercow131 month ago

Totally disagree, I have a wrapper I wrote myself for converting things, often for sharing the odd little clip online or such. It produces a complex command that is not easy to just type out, that does multiple things to maximise compatibility like

- making sure pixel are square while resizing if the video resolution is too large

    ("scale=w=if(gt(iw*sar\\,ih)\\,min(ceil(iw*sar/2)*2\\,{})\\,ceil(iw*sar*min(ih\\,{})/ih/2)*2):h=if(gt(ih\\,iw*sar)\\,min(ceil(ih/2)*2\\,{})\\,ceil(ih*min(iw*sar\\,{})/iw/sar/2)\*2):out_range=limited,zscale,setsar=1")
- dealing with some HDR or high gamut thing I can't really remember that can result from screen recording on macos using some method I was using at some point

- setting this one tag on hevc files that macos needs for them to be recognised as hevc but isn't set by default

- calculating the target bitrate if I need a specific filesize and verifying the encode actually hit that size and retrying if not (doesn't always work first time with certain hardware encoders even if they have a target or max bitrate parameter)

- dealing with 2-pass encoding which is fiddly and requires two separate commands and the parameters are codec specific

- correctly activating hardware encoding for various codecs

- etc

And this is just for the basic task of "make this into a simple mp4"

qbow8831 month ago

Yes, absolutely. Multimedia is complicated.

But my issue with the linked tool is that it does none of the things you mentioned. All it does it make already very easy things even easier. Is it really that much harder to remember `ffmpeg -i inputfile outputfile.ext` than `ff convert inputfile to ext`?

I've explained this in other replies here but I am neither saying that ffmpeg wrappers are automatically bad, nor that ffmpeg cannot be complicated. I am only saying that this specific tool does not really help much.

plufz1 month ago

> Multimedia is complicated.

I mean you saw the code above? It looks like gibberish and regex had a child. Many things in computing are complicated, but doesn’t look like that code. I make my living in media related programming and the code above is messy and extremely hard to read.

ranger_danger1 month ago

And even if you memorized all that, another task that IMO should be simple, you probably haven't also memorized yourself, such as inserting or extracting a thumbnail from a container.

stevage1 month ago

> It's really not that hard, and the (F.) manual explains the basic concepts fairly well.

Not that hard for you maybe. These things are not universal. You might wish to reconsider your basic assumption that everyone is too lazy to do this easy thing.

Gud1 month ago

“It’s really not that hard”, well a lot of people have better things to do than remember parameters to commands we barely use.

zzzeek1 month ago

sure here's a command that a program I wrote to record my practicing and produce different mixes uses

    /usr/bin/ffmpeg -i "/path/to/musicfile.mp3" -i "/path/to/covertune.mp3" \
       -filter_complex [1:a]volume=1[track1];[0a][track1]amix=normalize=false[output] \
       -map [output] -b:a 192k -metadata title=15:17:01 -metadata "artist=Me, 2025" \
       -metadata album=2025-12-23 "/path/to/file.mix.mp3"
chance of my coming up with that without deep poring over docs and tons of trial and error, or using claude (which is pretty much what I do nowadays): zero
qbow8831 month ago

But the chances of you being able to achieve the same with the linked tool are also zero. That's all I am really saying. I'm not arguing that ffmpeg can get very complex (I was talking about "basic" ffmpeg usage in my original comment), just that `ff convert inputfile to ext` is not really simpler than `ffmpeg -i inputfile -o outputfile.ext`, which is all that this (this specific) tool is really doing.

zzzeek1 month ago

Oh, well yes the ff tool shown here is a classic 80% kind of thing for sure . Claude OTOH will get you about 98% and can explain the options to you as well

guntis_dev1 month ago

I think there's a reason these wrappers keep appearing - different tools for different use cases. Not everyone needs to become an ffmpeg expert, especially if they only need it occasionally.

For example this one is also ffmpeg wrapper, https://lorem.video and built for devs and QAs who just need a quick placeholder video without diving into ffmpeg syntax. It's optimized for that narrow use case to generate test video by typing a URL.

Nothing wrong with learning ffmpeg properly if you use it regularly, but purpose built tools have their place too.

UqWBcuFx6NV4r1 month ago

Here I was trusting my own experience. Silly me. I should’ve been listening to some HN user’s assertion as to what is “easy” and “hard”.

tombert1 month ago

Yeah, a decade or so ago, I was constantly looking for GUIs to drive ffmpeg, but eventually I kind of realized I was spending more time playing with GUIs compared to just learning the basics of ffmpeg.

I will admit that I still do need to occasionally look up specific stuff, but for the most part I can do most of the common cases from memory.

jayd161 month ago

It's not hard, but it's one of those tools where the user has to think about how the tool is implemented.

Even if the abstractions get leaky, people yern for goal/workflow oriented UX.

msla1 month ago

You know, writing code that doesn't leak memory is really not that hard.

There. I've debunked Java, Python, PHP, Perl, and Rust.

(Or maybe, just maybe, tools should make our lives easier.)

memset1 month ago

Isn’t this the nature of all software abstractions? They often introduce a less performant way of executing a task at the tradeoff of user convenience?

agentifysh1 month ago

well if i follow your logic then assembly looks complicated at first glance and if people spent more time and effort they could get used to it.

kristopolous1 month ago

so you know how to swap audio with -map without having to look it up?

qbow8831 month ago

I do, yes. Though that's not really the point, it'd already be enough to know where to look it up.

kristopolous1 month ago

no the point is that there are some things I've done a hundred times and I never remember it because it's designed in a wildly bad way. ffmpeg, gpg, openssl and git has those things all over the place. Is it -c:v or -v:c? I don't know. used to be -vcodec so it's -v:c now? no it's -c:v I think because they swapped it?

There isn't internal consistency to really hold on to ... it's just a bunch of seemingly independent options.

The biggest problem is open source teams really don't get people on board that focus on customer and product the way commercial software does. This is what we get as a result

+1
qbow8831 month ago
christstopit1 month ago

[dead]

fleroviumna1 month ago

[dead]

dllu1 month ago

When converting video to gif, I always use palettegen, e.g.

    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
See also: this blog post from 10 years ago [1]

[1] https://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html

dceddia1 month ago

In many cases today “gif” is a misnomer anyway and mp4 is a better choice. Not always, not everywhere supports actual video.

But one case I see often: If you’re making a website with an animated gif that’s actually a .gif file, try it as an mp4 - smaller, smoother, proper colors, can still autoplay fine.

CrossVR1 month ago

I've been thinking of integrating pngquant as an ffmpeg filter, it would make it possible to generate even better pallettes. That would get ffmpeg on par with gifski.

dspillett1 month ago

Does ffmpeg's gif processing support palette-per-frame yet? Last time I compared them (years ago, maybe not long after that blog post), this was a key benefit of gifski allowing it to get better results for the same filesize in many cases (not all, particularly small images, as the total size of the palette information can be significant).

BoingBoomTschak1 month ago

I use `split[s0][s1];[s0]palettegen=max_colors=64[p];[s1][p]paletteuse=dither=bayer` personally, limiting the number of colors is a great way to transparently (to a certain point, try with different values) improve compression, as is bayer (ordered) dithering which is almost mandatory to not explode output filesizes.

crazysim1 month ago

Gifski (https://gif.ski/) might be a good alternative to look to that's gif-pallete aware.

foltik1 month ago

It’s a shame this isn’t the default.

xattt1 month ago

Those command flags just roll off the tongue like two old friends catching up!

/s

HelloUsername1 month ago

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.

corobo1 month ago

LLMs are an amazing advance in natural language parsing.

The problem is someone decided that and the contents of Wikipedia was all something needs to be intelligent haha

madeofpalk1 month ago

The confusion was thinking that language is the same thing as intelligence.

Marazan1 month ago

This seems like a glib one liner but I do think it is profoundly insightful as to how some people approach thinking about LLMs.

It is almost like there is hardwiring in our brains that makes us instinctively correlate language generation with intelligence and people cannot separate the two.

It would be like if for the first calculators ever produced instead of responding with 8 to the input 4 + 4 = printed out "Great question! The answer to your question is 7.98" and that resulted in a slew of people proclaiming the arrival of AGI (or, more seriously, the ELIZA Effect is a thing).

Kiro1 month ago

You and me are great examples of that. We are both extremely stupid and yet we can speak.

vovavili1 month ago

Can attest.

andrepd1 month ago

And reddit, that bastion of human achievement.

Terr_1 month ago

As pessimistic about it as I am, I do think LLMs have a place in helping people turn their text description into formal directives. (Search terms, command-line, SQL, etc.)

... Provided that the user sees what's being made for them and can confirm it and (hopefully) learn the target "language."

Tutor, not a do-for-you assistant.

left-struck1 month ago

I agree apart from the learning part. The thing is unless you have some very specific needs where you need to use ffmpeg a lot, there’s just no need to learn this stuff. If I have to touch it once a year I have much better things to spend my time learning than ffmpeg command

rolfus1 month ago

Agreed. I have a bunch of little command-line apps that I use 0.3 to 3 times a year* and I'm never going to memorize the commands or syntax for those. I'll be happy to remember the names of these tools, so I can actually find them on my own computer.

* - Just a few days ago I used ImageMagick for the first time in at least three years. I downloaded it just to find that I already had it installed.

serial_dev1 month ago

There is no universe where I would like to spend brain power on learning ffmpeg commands by heart.

skydhash1 month ago

No one learns those. What people do is just learning the UX of the cli and the terminology (codec, opus, bitrate, sampling,…)

lukeschlather1 month ago

The thing about ffmpeg is there's no substitute for learning. It's pretty common that something simple like "ff convert" simply doesn't work and you have to learn about resolution, color space, profiles, or container formats. An LLM can help but earlier this year I spent a lot of time looking at these sorts of edge cases, and I can easily make any LLM wildly hallucinate by asking questions about how to use ffmpeg to handle particular files.

famahar1 month ago

Do most devs even look at the source code for packages they install? Or the compiled machine code? I think of this as just a higher level of abstraction. Confirm it works and not worry about the details of how it works

d-us-vb1 month ago

For the kinds of things you’d need to reach for an LLM, there’s no way to trust that it actually generated what you actually asked for. You could ask it to write a bunch of tests, but you still need to read the tests.

It isn’t fair to say “since I don’t read the source of the libraries I install that are written by humans, I don’t need to read the output of an llm; it’s a higher level of abstraction” for two reasons:

1. Most Libraries worth using have already been proven by being used in actual projects. If you can see that a project has lots of bug fixes, you know it’s better than raw code. Most bugs don’t show up unless code gets put through its paces.

2. Actual humans have actual problems that they’re willing to solve to a high degree of fidelity. This is essentially saying that humans have both a massive context window and an even more massive ability to prioritize important things that are implicit. LLMs can’t prioritize like humans because they don’t have experiences.

skydhash1 month ago

I don’t because I trust the process to get the artifacts. Why? Because it’s easy to replicate and verify. Just like how proof works in math.

You can’t verify LLM’s output. And thus, any form of trust is faith, not rational logic.

josephg1 month ago

> You can’t verify LLM’s output. And thus, any form of trust is faith, not rational logic.

Well, you can verify an LLM's output all sorts of ways.

But even if you couldn't, its still very rational to be judicious with how you use your time and attention. If I spent a few hours going through the ffmpeg documentation I could probably learn it better than chatgpt. But, its a judgement call whether its better to spend 5 minutes getting chatgpt to generate an ffmpeg command (with some error rate) or spend 2 hours doing it myself (with maybe a lower error rate).

Which is a better use of my time depends on lots of factors. How much I care. How important it is. How often that knowledge will be useful in the future. And so on. If I worked in a hollywood production studio, I'd probably spend the 2 hours (and many more). But if I just reach for ffmpeg once a year, the small% error rate from chatgpt's invocations might be fine.

Your time and attention are incredibly limited resources. Its very rational to spend them sparingly.

+1
ben_w1 month ago
xattt1 month ago

It you stretch it little further, those formal directives also include language and vocabulary of a particular domain (legalese, etc…).

eviks1 month ago

The "provided" isn't provided, of course, especially the learning part, that's not what you'd turn to AI for vs more reliable tutoring alternatives

Tempest19811 month ago

One that older AI struggled with was the "bounce" effect: play from 0:00 to 0:03, then backwards from 0:03 to 0:00, then repeat 5 times.

geysersam1 month ago

Just tried it and got this, is it correct?

> Write an ffmpeg command that implements the "bounce" effect: play from 0:00 to 0:03, then backwards from 0:03 to 0:00, then repeat 5 times.

  ffmpeg -i input.mp4 \
  -filter_complex "
  [0:v]trim=0:3,setpts=PTS-STARTPTS[f];
  [f]reverse[r];
  [f][r]concat=n=2:v=1:a=0[b];
  [b]loop=loop=4:size=150:start=0
  " \
  output.mp4
Tempest19811 month ago

Thanks, but no luck. I tested it on a 3 second video, and got a 6 second video. I.e. it bounced 1 time, not 5 times.

Maybe this should be an AI reasoning test.

Here is what eventually worked, iirc (10 bounces):

  ffmpeg -i input.mkv -filter_complex "split=2[fwd][rev_in]; [rev_in]reverse[rev]; [fwd][rev]concat=n=2,split=10[p1][p2][p3][p4][p5][p6][p7][p8][p9][p10]; [p1][p2][p3][p4][p5][p6][p7][p8][p9][p10]concat=n=10[outv]" -map "[outv]" -an output.mkv
beepbooptheory1 month ago

But doesnt something like this interface kind of show the inefficiency of this? Like we can all agree ffmpeg is somewhat esoteric and LLMs are probably really great at it, but at the end of the day if you can get 90% of what you need with just some good porcelain, why waste the energy spinning up the GPU?

pixelpoet1 month ago

Requiring the installation of a massive kraken like node.js and npm to run a commandline executable hardly screams efficiency...

RadiozRadioz1 month ago

That's a deficiency with this particular implementation, not an inherent disadvantage to the method

chpatrick1 month ago

Because FFmpeg is a swiss army knife with a million blades and I don't think any easy interface is really going to do the job well. It's a great LLM use case.

beepbooptheory1 month ago

I know everybody uses a subscription for these things, but doesn't it at least feel expensive to use an LLM like this? Like turning on the oven to heat up a single slice of pizza.

lukeschlather1 month ago

No, LLMs are extremely useful for dealing with ffmpeg. Also I don't think they're sufficient, they get confused too easily and ffmpeg is extremely confusing.

+1
ThrowawayTestr1 month ago
skydhash1 month ago

But you only need to find the correct tool once and mark it in some way. Aka write a wrapper script, jot down some notes. You are acting like you’re forced to use the cli each time.

NewsaHackO1 month ago

One can do that with LLM as well. Honestly, I almost always just save the command if I think I am going to use it later. Also, I can just look back at the chat history.

geysersam1 month ago

Because getting 90% might not be good enough, and the effort you need to expend to reach 97% costs much more than the energy the GPU uses.

imiric1 month ago

Because the porcelain is purpose built for a specific use case. If you need something outside of what its author intended, you'll need to get your hands dirty.

And, realistically, compute and power is cheap for getting help with one-off CLI commands.

phil2941 month ago

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.

    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-encoding
And add amazing autocomplete, while allowing as many wordings as possible. No need for LLMs.

One can dream.

PaulDavisThe1st1 month ago

> write my-iso ./zip.zip onto external hard drive

Dang! not that one, the other one!

> zip my-folder into my-zip.tar with compression level 9

What do you mean, I don't have write permissions in the current working directory? I meant for you to put the output in $HOME, i mean /tmp, i mean /var/tmp, i mean on the external hard drive, no other other one.

> git delete commit 1a4db4c

What did you do? I didn't mean delete it and erase it from the reflog and run gc! I just mean "delete it" the way any one would ever mean that! I can never get it back now!

phil2941 month ago

Things that definitely need interactive prompts before running or fail out of ambiguity otherwise. Let's not pretend these are impossible problems to overcome design-wise.

ishandotpage1 month ago

I think you may enjoy [Nushell](https://www.nushell.sh)

self_awareness1 month ago

Why not use Windows or macOS then? You don't need to use shells there.

I would prefer not to change the technical aspects of Linux. I actually cherish it.

dheera1 month ago

See my more generalized CLI helper which does exactly this:

https://github.com/dheera/scripts/blob/master/helpme

Example usage:

    helpme ffmpeg assemble all the .jpg files into an .mp4 timelapse video at 8fps
    helpme zip my-folder into my-zip.tar with compression level 9
    helpme git delete commit 1a4db4c
    ...
This originated from an ffmpeg wrapper I wrote but then realized it could be used for all commands:

https://news.ycombinator.com/item?id=40410637

troupo1 month ago

> One can dream

That was the promise of COBOL. And SQL. And AppleScript. And ABAP. And...

It never works out the way you want it.

vithalreddy1 month ago

Can't access the githup repo https://github.com/josharsh/ezff

az09mugen1 month ago

Same here, I get a 404 from github. The said link is at the bottom of the submitted npmjs page.

ramigb1 month ago

yeah me too but npm has the code tab https://www.npmjs.com/package/ezff?activeTab=code

naikrovek1 month ago

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.

metadope1 month ago

> Small English nitpick:

> 2x? x is a multiplier.

Translation of English is often problematic because of the multiple valid interpretations of simple words, and concepts that have many synonyms.

The solution here is to use arithmetic to supercede English. It may then become apparent that what is meant is x as a denominator.

Translate x into 'times', and then think of 'times' not as strictly multiplication but instead as an iteration (which, after all, is what multiplication is), and that might get you closer to what is meant, which is a standard arithmetic inversion of multiplication to division.

> Saying something is 2x smaller or 2x shorter or 2x cheaper doesn’t make sense

It does, if you do the inversion. Something 2 times smaller is half (1/2) as big.

Two ways of saying the same thing is half the fun of learning English!

naikrovek1 month ago

“x” is a multiplier in your first example, and an inversion in your second?

Pick one.

Or just phrase things correctly to begin with.

jimbobthrowawy1 month ago

Reminds me of a thing Steve Mould mentioned in a video about a claim in a book "The temperature outside an aeroplane is six times colder than the temperature inside a freezer."

https://www.youtube.com/watch?v=C91gKuxutTU - Stand-up comedy routine about bad science

nulltype1 month ago

Isn’t it somewhat common to say something like “slow this down by a factor of 2”?

imglorp1 month ago

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 ".

karmakaze1 month ago

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.

ramon1561 month ago

> 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

eviks1 month ago

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

my_brain_saying1 month ago

This is why we have fish tab completions. Does exactly that; list of possible commands with contextual help. Fish rules.

eviks1 month ago

Yeah, no, that's a pale imitation that only addresses the one specific example given. But, like, how would you even know what target formats are supported? Break the flow and look it up or simply read the drop-down list? The free type-any-text interface with poor helpers is the worst in accessibility

Which format is the default if no argument is given?

Or more complicated contextual knowledge - if you cut 1sec of a video file, does fish autocomplete to tell you whether the video is reencoded or cut (otherwise) losslessly

Also, what does fish complete to on Windows?

skydhash1 month ago

Which flow is being broken here? Especially when the information is easily accessible with `man`.

+1
eviks1 month ago
NooneAtAll31 month ago

"why would one solve the problem with one drop-down menu if you can solve it with 20 minutes of browsing walls of text"

lol

tgsovlerkhgsel1 month ago

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.

petterroea1 month ago

Somehow it seems ffmpeg has become the "Can it run crysis" of UX design

btbuildem1 month ago

npm? Have we learned nothing from the weekly node/npm security breaches? Not putting that hot mess anywhere near my dev box, thanks.

Workaccount21 month ago

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.

two_handfuls1 month ago

You're not wrong, but also there is value in a tool that will behave the same way consistently and has been vetted. I wouldn't be so down on this work.

andyfilms11 month ago

It is a bit of a catch-22, a plain english wrapper opens up the tool to be more widely used by novices, but also prevents those novices from actually learning the tool.

Gud1 month ago

Not really, how are they prevented from using the manual or the copious amounts of examples out there?

Memorising command line options beyond the absolute basics has rarely been helpful to me. And I use FreeBSD, where arcane commands are plentiful.

andyfilms11 month ago

Nothing, but after becoming reliant on an LLM they may simply become overwhelmed and give up once they outgrow it's capabilities. I've seen this happen to several people I know.

Workaccount21 month ago

It's not so much being down on the work, as it is being down on 30 years of keyboard junkies proclaiming "Plain English" interfaces.

christstopit1 month ago

If you think a developer creating something /they/ thought would be useful (or even just a fun exercise) is a waste of time because there are “better” options already available, then you really are so out of touch with what developing software means that you are in absolutely no position to make such judgment.

foundart1 month ago

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.

Kwpolska1 month ago

GitHub repo link returns 404.

mmahemoff1 month ago

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.

dev1ycan1 month ago

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.

broken-kebab1 month ago

I like the idea, but a CLI utility dependent on Node.js is not a good thing frankly.

AnonC1 month ago

I agree. Apart from having to use npm (and its package repository being susceptible to security issues), I’d prefer something a lot simpler. Could’ve been a Rust program or a Go program (a single executable) that could be built locally or installed (using several different methods and offering a choice).

tclancy1 month ago

That ship sailed some time ago.

alexellisuk1 month ago

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).

teitoklien1 month ago

i figure out the niche ffmpeg commands various chain filters, etc then expose them from my python cli tool with words similar to what this gentleman above has done.

If one has fewer such commands its as simple as just bash aliases and just adding it to ~/.bashrc

alias convertmkvtomp4='ffmpeg command'

then just run it anytime with just that alias phrase i use ffmpeg a lot so i have my own dedicated cli snippet tool for me, to quickly build out complex pipeline in easier language

the best part is i have --dry-run then exposes the flow + explicit commands being used at each step, if i need details on whats happening and verbose output at each step

sallveburrpi1 month ago

I have a text file with some common commands, so no tools needed.

But yea ffmpeg is awesome software, one of the great oss projects imo. working with video is hellish and it makes it possible.

justinhj1 month ago

There is no need for a wrapper or memorizing syntax in our new llm world.

spullara1 month ago

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.

gcanyon1 month ago

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

nextstep1 month ago

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?

arjie1 month ago

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.

low_tech_punk1 month ago

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?

ramigb1 month ago

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

Tempest19811 month ago

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?

kiicia1 month ago

MP4 is container, not format, so if you have unsupported format packed into MP4 container it won’t be played. Example is trying to play AV1 video codec on devices with M2 chip or older. It won’t play. But it will play on devices with M3 chip and newer. Easiest solution is to use other player so that you can watch any MP4 file but with software decoding where hardware decoding is not available. Examples of such players are MPV or VLC.

Tempest19811 month ago

Yes, VLC works fine for playing. The user wanted to edit some mp4 videos with iMovie (vs ffmpeg).

I think it was an M4 Mac. Does iMovie need a codec pack? I know some PC OEMs don't ship an h.265 codec, pointing users to a $0.99 download. Thought Mac would include it, being aimed at content creators. Hoping for a cheaper solution than Adobe Premiere.

kiicia1 month ago

H265 is different codec, and exactly because of that license fee both VP9 and AV1 exist. Apple was hiding VP9 support for long time now and AV1 support is now official.

felixfoertsch1 month ago

IMHO the de-facto video player for macOS is [IINA](https://iina.io/).

trvz1 month ago

That exists, but it’s still VLC.

wging1 month ago

It's based on mpv, not vlc.

andrewf1 month ago

Try something like: ffmpeg -i in.mp4 -c:v h264 -c:a aac out.mp4

To re-encode the content into H.264+AAC, rather than simply "muxing" the encoded bitstreams from the MP4 container into a new MOV container.

Tempest19811 month ago

Thanks, I can even somewhat remember that. AI gave me args like

  -c:v libx264 -pix_fmt yuv420p -preset medium -crf 18 \
  -c:a aac -b:a 192k \
stackedinserter1 month ago

"-c:v h264_videotoolbox -b:v 5000k" on macos, it will use hardware encoder.

codegladiator1 month ago

vlc

sirodoht1 month ago

Inspiring! I just asked Cursor to make llmwrap inspired by this, it's like rlwrap (readline wrap) but with LLMs!

https://github.com/sirodoht/llmwrap

pdyc1 month ago

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.

GajendraSahu231 month ago

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?

anymouse1234561 month ago

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.

skc1 month ago

Still think AI shines here. I find ffmpeg commands pretty arcane. Nowadays I just ask an LLM to generate the commands I need, test, and I'm done.

vivzkestrel1 month ago

I would love to see something like this for OpenSSL

bdbdbdb1 month ago

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

gamer1911 month ago

Thanks, will definitely check this out

Has anyone else been avoiding typing FFmpeg commands by using file:// URLs with yt-dlp

amcsi1 month ago

Where's the public Git repository for this project? The GitHub link on the NPM page seems broken to me.

witnessme1 month ago

Going to try this one soon. Great work OP.

johanyc1 month ago

is this better than just ask any llm cli tool (warp, codex, gemini, claude code, etc.) to generate ffmpeg command for you?

dheera1 month ago

See also:

https://github.com/dheera/scripts/blob/master/helpme

    helpme ffmpeg assemble all the .jpg files into an .mp4 timelapse video at 8fps
This evolved from an ffmpeg wrapper I wrote before:

https://news.ycombinator.com/item?id=40410637

Joyfield1 month ago

Uhm... Millibit, Millibyte, Megabit, Megabyte?

two_handfuls1 month ago

Good point, "mb" as used in the linked example would mean "millibit", which is almost certainly not what they meant.

lerp-io1 month ago

claude cli for ffmpeg is op lol

Kcnfjhggjbh1 month ago

[flagged]

maximgeorge1 month ago

[dead]