this post was submitted on 21 Dec 2025
15 points (89.5% liked)

Opensource

4626 readers
100 users here now

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

CreditsIcon base by Lorc under CC BY 3.0 with modifications to add a gradient



founded 2 years ago
MODERATORS
 

Recently I wanted to cut a video (just export few seconds of a long video).

When everything still was AVI it was easy for me and I used VirtualDub. There I could decide if I just do a keyframe cut without having to encode it again, or a frame cut with having to encode this.

Nowadays having MKV, MP4 etc. I tried Lossless Cut which just gave me a black video. Open Shots Video Editor which is too complicated for this task and where I struggle to maintain the aspect ratio of the original video. Handbrake is a bit better, but also offers too many options for that purpose.

So I ended up using Online Video Cutter. But I wonder that there isn't any open source that just works as easily as that.

top 11 comments
sorted by: hot top controversial new old
[–] djmikeale@feddit.dk 12 points 3 days ago

I've been using ffmpeg for use cases like this. For your example specifically, here's one solution:

https://stackoverflow.com/questions/18444194/cutting-multimedia-files-based-on-start-and-end-time-using-ffmpeg#42827058

I'm going to second the ffmpeg answers, they do the job but won't be completely accurate to timestamps due to cutting at key frames. That's how you persevere original quality though, and it's fastest.

If you need to reencode to fit a target size as well, there exists tools for that too. I made my own for cutting shadowplay recordings by selecting start and stop points in the video and encoding them to fit the discord 8MB limit back in the day. My version is not exactly user friendly to get going though, and not updated for the last 5 years or so. Should still work though.

[–] jasory@programming.dev 7 points 3 days ago

I've used ffmpeg to compose a whole video from screen recordings. The big advantage is that it works well on weaker hardware that can't run full blown video editors.

[–] FrederikNJS@sopuli.xyz 5 points 3 days ago (1 children)

AVIDemux can cut video pretty easily. It's not just for AVI files, it happily works with MKV, MP4 and many other formats.

[–] ulterno@programming.dev 2 points 2 days ago (1 children)

I used it a few times and it seems like a good choice for keyframe cuts.
For when you are re-encoding anyway, might as well go with ffmpeg.

[–] FrederikNJS@sopuli.xyz 5 points 2 days ago (1 children)

AVIDemux happily does keyframe cuts (lossless), and also non-keyframe cuts (with a reencode). But you probably get a lot more control over the actual reencode with ffmpeg, so it all depends on whether you want the ease of use or the control.

[–] ulterno@programming.dev 1 points 2 days ago

Yeah.
My point was, that if you are re-encoding anyway, might as well choose all the options yourself, properly.

[–] Greyghoster@aussie.zone 4 points 3 days ago

Losslesscut is pretty easy to use though I have needed Avidemux as well on a couple of occasions to recode a damaged file (not cause by LLC).

[–] jrgd@lemmy.zip 3 points 3 days ago

With LosslessCut, I've had good success with doing keyframe cuts with h.264 footage in MKV containers. Frame cuts end up in broken outputs pretty much every time. There's also Avidemux, which might be worth a try. More than likely though, if you want frame-precision in your cuts, you'll have to re-encode, at which point you could use something as minimal as Handbrake or a full NLE editor like Kdenlive.

[–] bizarroland@lemmy.world 2 points 3 days ago

Shotcut works well for me

[–] Maiq@piefed.social 1 points 3 days ago

Might be more that what you need but blender has video tools.