Comment by pmarreck

Comment by pmarreck a day ago

56 replies

Impressed anytime I have to use it (even if I have to study its man page again or use an LLM to construct the right incantation or use a GUI that just builds the incantation based on visual options). Becoming an indispensable transcoding multitool.

I think building some processing off of Vulkan 1.3 was the right move. (Aside, I also just noticed yesterday that Asahi Linux on Mac supports that standard as well.)

Culonavirus a day ago

> incantation

FFmpeg arguments, the original prompt engineering

  • mrandish a day ago

    I'd also include Regex in the list of dark arts incantations.

    • RedShift1 a day ago

      I'm ok with regex, but the ffmpeg manpage, it scares me...

      • quectophoton 19 hours ago

        Ffmpeg was designed to be unusable if it falls into enemy hands.

    • zvr 20 hours ago

      I am perfectly at home with regexp, but ffmpeg, magick, and jq are still on the list to master.

  • agos a day ago

    OT, but yours has to be the best username on this site. Props.

    • bobsmooth 21 hours ago

      Culón is Spanish for big-bottomed, for anyone else wondering.

  • Keyframe a day ago

    with gemini-cli and claude-cli you can now prompt while it prompts ffmpeg, and it does work.

    • conradev a day ago

      Yeah, you can give an LLM queries like “make this smaller with libx265 and add the hvc1 tag” or “concatenate these two videos” and it usually crushes it. They have a similar level of mastery over imagemagick, too!

      • turnsout a day ago

        Yeah, LLMs have honestly made ffmpeg usable for me, for the first time. The difficulty in constructing commands is not really ffmpeg's fault—it's just an artifact of the power of the tool and the difficulties in shoehorning that power into flags for a single CLI tool. It's just not the ideal human interface to access ffmpeg's functionality. But keeping it CLI makes it much more useful as part of a larger and often automated workflow.

    • profsummergig a day ago

      Just seeking a clarification on how this would be done:

      One would use gemini-cli (or claude-cli),

      - and give a natural language prompt to gemini (or claude) on what processing needs to be done,

      - with the correct paths to FFmpeg and the media file,

      - and g-cli (or c-cli) would take it from there.

      Is this correct?

      • logicalmind 19 hours ago

        Another option is to use a non-cli LLM and ask it to produce a script (bash/ps1) that uses ffmpeg to do X, Y, and Z to your video files. If using a chat LLM it will often provide suggestions or ask questions to improve your processing as well. I do this often and the results are quite good.

    • NSUserDefaults a day ago

      Curious to see how quickly each LLM picks up the new codecs/options.

      • stevejb a day ago

        I use the Warp terminal and I can ask it to run —-help and it figures it out

      • baq a day ago

        the canonical (if that's the right word for a 2-year-old technique) solution is to paste the whole manual into the context before asking questions

  • jeanlucas a day ago

    nope, that would be handling tar balls

    ffmpeg right after

    • beala a day ago

      Tough crowd.

      fwiw, `tar xzf foobar.tgz` = "_x_tract _z_e _f_iles!" has been burned into my brain. It's "extract the files" spoken in a Dr. Strangelove German accent

      Better still, I recently discovered `dtrx` (https://github.com/dtrx-py/dtrx) and it's great if you have the ability to install it on the host. It calls the right commands and also always extracts into a subdir, so no more tar-bombs.

      If you want to create a tar, I'm sorry but you're on your own.

      • diggan a day ago

        I used tar/unzip for decades I think, before moving to 7z which handles all formats I throw at it, and have the same switch for when you want to decompress into a specific directory, instead of having to remember which one of tar and unzip uses -d, and which one uses -C.

        "also always extracts into a subdir" sounds like a nice feature though, thanks for sharing another alternative!

      • mkl 16 hours ago

        > tar xzf foobar.tgz

        You don't need the z, as xf will detect which compression was used, if any.

        Creating is no harder, just use c for create instead, and specify z for gzip compression:

          tar czf archive.tar.gz [filename(s)]
        
        Same with listing contents, with t for tell:

          tar tf archive.tar.gz
    • fullstop a day ago

      I have so much of tar memorized. cpio is super funky to me, though.

    • porridgeraisin a day ago

      Personally I never understood the problem with tar balls.

      The only options you ever need are tar -x, tar -c (x for extract and c for create). tar -l if you wanna list, l for list.

      That's really it, -v for verbose just like every other tool if you wish.

      Examples:

        tar -c project | gzip > backup.tar.gz
        cat backup.tar.gz | gunzip | tar -l
        cat backup.tar.gz | gunzip | tar -x
      
      You never need anything else for the 99% case.
      • BeepInABox a day ago

        For anyone curious, unless you are running a 'tar' binary from the stone ages, just skip the gunzip and cat invocations. Replace .gz with .xz or other well known file ending for different compression.

          Examples:
            tar -cf archive.tar.gz foo bar  # Create archive.tar.gz from files foo and bar.
            tar -tvf archive.tar.gz         # List all files in archive.tar.gz verbosely.
            tar -xf archive.tar.gz          # Extract all files from archive.tar.gz
      • sdfsdfgsdgg a day ago

        > tar -l if you wanna list, l for list.

        Surely you mean -t if you wanna list, t for lisT.

        l is for check-Links.

             -l, --check-links
                     (c and r modes only) Issue a warning message unless all links to each file are archived.
        
        And you don't need to uncompress separately. tar will detect the correct compression algorithm and decompress on its own. No need for that gunzip intermediate step.
      • tombert a day ago

        Yeah I never really understood why people complain about tar; 99% of what you need from it is just `tar -xvf blah.tar.gz`.

      • themafia 13 hours ago

            gzip -dc backup.tar.gz | tar -x
        
        You can skip a step in your pipeline.
      • bigstrat2003 a day ago

        The problem is it's very non-obvious and thus is unnecessarily hard to learn. Yes, once you learn the incantations they will serve you forever. But sit a newbie down in front of a shell and ask them to extract a file, and they struggle because the interface is unnecessarily hard to learn.

      • jeanlucas a day ago

        it was just a reference to xkcd#1168

        I wasn't expecting the downvotes for an xkcd reference

agys a day ago

LLMs and complex command line tools like FFmpeg and ImageMagick are a perfect combination and work like magic…

It’s really the dream UI/UX from sience fiction movies: “take all images from this folder and crop 100px away except on top, saturate a bit and save them as uncompressed tiffs in this new folder, also assemble them in a video loop, encode for web”.

  • xandrius a day ago

    Had to do exactly that with a bunch of screenshots I took but happened to include a bunch of unnecessary parts of the screen.

    A prompt to ChatGPT and a command later and all were nicely cropped in a second.

    The dread of doing it by hand and having it magically there a minute later is absolutely mind blowing. Even just 5 years ago, I would have just done it manually as it would have definitely taken more to write the code for this task.

  • Barrin92 a day ago

    it can work but it's far from science fiction. LLMs tend to produce extremely subpar if not buggy ffmpeg code. They'll routinely do things like put the file parameter before the start time which needlessly decodes the entire video, produce wrong bitrates, re-encode audio needlessly, and so on.

    If you don't care enough about potential side effects to read the manual it's fine, but a dream UX it is not because I'd argue that includes correctness.

    • amenhotep 20 hours ago

      ffmpeg -i in -ss start -to end out is wrong and bad? You can -ss before -i? TIL!

  • euroderf 21 hours ago

    Are you accusing Blade Runner of infringing FFmpeg IP ?

jjcm a day ago

LLMs are a great interface for ffmpeg. There are tons of tools out there that can help you run it with natural language. Here's my personal script: https://github.com/jjcm/llmpeg

  • pmarreck 18 hours ago

    i wrote a command “please” that allows me to say “please use ffmpeg to do whatever” and it generates the command with confirmation