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.

  • BehindTheBarrier@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    19 hours ago

    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
    link
    fedilink
    arrow-up
    6
    ·
    1 day 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
    link
    fedilink
    arrow-up
    5
    ·
    1 day ago

    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
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      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
        link
        fedilink
        arrow-up
        5
        ·
        21 hours ago

        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
          link
          fedilink
          English
          arrow-up
          1
          ·
          20 hours ago

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

  • Greyghoster@aussie.zone
    link
    fedilink
    arrow-up
    4
    ·
    1 day 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
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 day 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.