Show HN: Ez FFmpeg – Video editing in plain English

(npmjs.com)

131 points | by josharsh 4 hours ago

17 comments

  • ramon156 1 minute 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

  • dllu 3 hours 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

    • CrossVR 2 hours 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.
    • xattt 1 hour ago
      Those command flags just roll off the tongue like two old friends catching up!

      /s

  • HelloUsername 3 hours 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.
    • corobo 1 hour 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

      • madeofpalk 30 minutes ago
        The confusion was thinking that language is the same thing as intelligence.
        • Marazan 19 minutes 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).

    • Tempest1981 3 hours 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.
      • geysersam 20 minutes 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
    • Terr_ 3 hours 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-struck 2 hours 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
        • rolfus 9 minutes 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_dev 1 hour ago
          There is no universe where I would like to spend brain power on learning ffmpeg command by heart.
      • xattt 1 hour ago
        It you stretch it little further, those formal directives also include language and vocabulary of a particular domain (legalese, etc…).
      • eviks 2 hours 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
    • beepbooptheory 2 hours 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?
      • geysersam 5 minutes 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.
      • pixelpoet 2 hours ago
        Requiring the installation of a massive kraken like node.js and npm to run a commandline executable hardly screams efficiency...
      • chpatrick 1 hour 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.
      • imiric 2 hours 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.

  • ramigb 12 minutes 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
  • vithalreddy 2 hours ago
    Can't access the githup repo https://github.com/josharsh/ezff
  • eviks 2 hours 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_saying 2 hours ago
      This is why we have fish tab completions. Does exactly that; list of possible commands with contextual help. Fish rules.
      • eviks 2 hours 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?

  • gamer191 40 minutes ago
    Thanks, will definitely check this out

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

  • spullara 2 hours 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.
  • mmahemoff 3 hours 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.
  • Kwpolska 3 hours ago
    GitHub repo link returns 404.
  • pdyc 2 hours 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.

  • petterroea 2 hours ago
    Somehow it seems ffmpeg has become the "Can it run crysis" of UX design
  • bdbdbdb 2 hours 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
  • broken-kebab 1 hour ago
    I like the idea, but a CLI utility dependent on Node.js is not a good thing frankly.
    • tclancy 1 hour ago
      That ship sailed some time ago.
  • Tempest1981 3 hours 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?

    • kiicia 2 hours 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.
    • felixfoertsch 3 hours ago
      IMHO the de-facto video player for macOS is [IINA](https://iina.io/).
      • trvz 2 hours ago
        That exists, but it’s still VLC.
        • wging 2 hours ago
          It's based on mpv, not vlc.
    • codegladiator 3 hours ago
      vlc
  • Joyfield 51 minutes ago
    Uhm... Millibit, Millibyte, Megabit, Megabyte?
  • maximgeorge 1 hour ago
    [dead]