Lazycut: A simple terminal video trimmer using FFmpeg
41–50 of 69 posts
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#42I 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.
I used a plugin in mpv to do it but I can't find it anymore. You just pressed a key to mark the start and end. And with . and , you could do it at keyframe resolution not just seconds.
https://github.com/stax76/awesome-mpv?tab=readme-ov-file#vid...
Appreciate you mentioning the MPV route for making clips, I might actually go through and process all the game recordings I saved for clips over the years.
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#43Earlier quoted context omitted.
I don't find Sharing files with people very difficult, just login to your FTP and give an account to another user. - Person commenting on OneDrive
Missed opportunity to reference the famous Dropbox hn comment. I just think there are other closely related use cases where a separate program can add more value, especially in the terminal. I wouldn't suggest most people should use ffmpeg instead of a gui, those are too dissimilar. Another example is cutting out a part of a video, with ffmpeg you need to make two temporary videos and then concatenate them, that proc…
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#44I 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.
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#45Invoking ffmpeg, gzip and tar commands is a sort of reverse Turing test for LLMs
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#46Re: Lazycut: A simple terminal video trimmer using FFmpeg
#47I 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.
# make a 6 second long video that alternates from green to red every second.
ffmpeg -f lavfi -i "color=red[a];color=green[b];[a][b]overlay='mod(floor(t)\,2)*w'" -t 6 master.mp4; # creates 150 frames @ 25fps.
# try make a 1 second clip starting at 0sec. it should be all green.
ffmpeg -ss 0 -i "master.mp4" -t 1 -c copy "clip1.mp4"; # exports 27 frames. you see some red.
ffmpeg -ss 0 -t 1 -i "master.mp4" -c copy "clip2.mp4"; # exports 27 frames. you see some red.
ffmpeg -ss 0 -to 1 -i "master.mp4" -c copy "clip3.mp4"; # exports 27 frames. you see some red.
# -t and -to stop after the limit, so subtract a frame. but that leaves 26...
# so perhaps offset the start time so that frame#0 is at 0.04 (ie, list starts at 1)?
ffmpeg -itsoffset 0.04 -ss 0 -i "master.mp4" -t 0.96 -c copy "clip4.mp4"; # exports 25 frames, all green, time = 1.00. success.
# try make another 1 second clip starting at 2sec. it should be all green.
ffmpeg -itsoffset 0.04 -ss 2 -i "master.mp4" -t 0.96 -c copy "clip5.mp4"; # exports 75 frames, time = 1.08, and you see red-green-red.
# maybe don't offset the start, and drop 2 at the end?
ffmpeg -ss 2 -i "master.mp4" -t 0.92 -c copy "clip6.mp4"; # exports 75 frames, time = 1.08, and you see green-red.
ffmpeg -ss 2 -t 0.92 -i "master.mp4" -c copy "clip7.mp4"; # exports 75 frames, time = 0.92, and you see green-red.
# try something different...
ffmpeg -ss 2 -i "master.mp4" -c copy -frames 25 "clip8.mp4"; # video is broken.
ffmpeg -ss 2 -i "master.mp4" -c copy -frames 25 -avoid_negative_ts make_zero "clip9.mp4"; # exports 25 frames, all green, time = 1.00. success?
# try export a red video the same way.
ffmpeg -ss 3 -i "master.mp4" -c copy -frames 25 -avoid_negative_ts make_zero "clip10.mp4"; # oh no, it's all green!Re: Lazycut: A simple terminal video trimmer using FFmpeg
#48Invoking ffmpeg, gzip and tar commands is a sort of reverse Turing test for LLMs
To access this website, you must produce a valid tar command without alt-tabbing. You have ten seconds to comply.
Define "valid"? If you mean "doesn't give an exit error", `tar --help`[0] and `tar --usage`[1] are valid.
[0] For both bsdtar (3.8.1) and GNU tar (1.35)
[1] Only for GNU tar (1.35)
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#49I 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.
Re: Lazycut: A simple terminal video trimmer using FFmpeg
#50Im sure other video players like VLC support this, but I found VLC's apis very lacking.