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.
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
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.
> 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.
> 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 ".
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.
Could you elaborate on this? I see a lot of AI-use and I'm wondering if this is claude speaking or you
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.
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.
"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.
Quite telling that these tools need to exist to make ffmpeg actually usable by humans (including very experienced developers).
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?
One workaround is that when there is syntax error, let user optionally switch to LLM?
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.
Is there an easier way?
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.
Has anyone else been avoiding typing FFmpeg commands by using file:// URLs with yt-dlp
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: