27 comments

[ 2.8 ms ] story [ 51.8 ms ] thread
Don't think I need it (using ffmpeg directly or Kdenlive if I need fine edits) but to know that it exists brings me joy, so thank you!
I keep being surprised of what you can use/abuse the terminal for...
I think this is the first instance I've seen of an actual terminal video player. Very fun to play with.
mplayer, mpv and I think VLC can do it, with the right output driver settings (libcaca or a few other choices.)
Doesn't -y mean overwrite file? And isn't there a difference between -ss before -i and after -i?
I guess I can find another implementation to combine trimmed parts after taking out certain scenes?
Write a text file with all the parts like this:

    file 'file1.mp4'
    file 'file2.mp4'
    file 'file3.mp4'
Then call ffmpeg like this:

    ffmpeg -f concat -i files.txt -c copy output.mp4
And I guess you could make an LLM write a {G,T}UI for this if you really want.
I've been using ffmpeg with claude as video editor for long time.
You mean you let create claude command or it itself runs ffmpeg on your local machine and returns you finished cut?
This is very cool. I built one of these myself around Christmas; Claude Code can put one together in just a couple prompts (this is also how I worked out how to have Claude test TUIs with tmux). What was striking about my finished product --- which is much less slick than this --- was how much of the heavy lifting was just working out which arguments to pass to ffmpeg.

It's surprisingly handy to have something like this hanging around; I just use mine to fix up screen caps.

Commenting mostly because when I did this I thought I was doing something very silly, and I'm glad I'm not completely crazy.

I'd love to hear more about your TUI testing with tmux approach.
Having to separately download ffmpeg in the windows distribution does not really make sense

Just bundle it

I don't find trimming videos with ffmpeg particularly difficult, is just-ss xx -to xx -c copy basically. Sure, you need to get those time stamps using a media player, but you probably already have one so that isn't really an issue.

What I've found to be trickier is dividing a video into multiple clips, where one clip can start at the end of another, but not necessarily.

Could have really used this a couple days ago. I had to record a video an assignment, but due to lack of global hotkeys on OBS with wayland, I had to start and stop the video on the OBS GUI. I tried to figure out ffmpeg but I was too tired and it was getting close to the deadline so I spent some time learning how to to do it with kdenlive.
Invoking ffmpeg, gzip and tar commands is a sort of reverse Turing test for LLMs
What's weird is that I have problems getting the ffmpeg switches right, even if I get llm assistance.

I think I understand the switches, and are demonstrably shown I have no clue.

These days, I'm basically relegated in following pre-LLM blogs and SO in hoping I find the right combination.

If you dont like leaving your main video player, IINA on mac is scriptable, so I just use shortcut keys to send start/end indicators to a script which runs ffmpeg on the timestamps.

Im sure other video players like VLC support this, but I found VLC's apis very lacking.

It's interesting how terminal apps are increasing in popularity after decades of desktop and web apps. I wonder if it's the talk to the chat AI that's making people more used to asking a prompt screen or if it's the simplicity and lack of bloat.
Love it! I had this idea before but never took the time to implement it. You did it, thank you.