10

To illustrate: Say I want to delete the 10-11 minute point of a 20 minute video and create the new video of 19 minutes without re-encode. Same as described in the link below; think: removing commercials from a tv show.

https://superuser.com/questions/681885/how-can-i-remove-multiple-segments-from-a-video-using-ffmpeg

I was trying to do the above with ffmpeg, but without re-encoding. I currently can do it by using each command separately i.e.: ffmpeg -ss 00:00:00 -i input -to 00:00:00 -c copy output And then I'd concaticate the pieces I want together.

I looked up how to find the nearest i frame to try and get more accuracy when choosing times. But putting all this together and checking the video after getting each piece of information...turned into a very inefficient process.

So I wanted to know if there are any gui (video editors) that support this functionality of ffmpeg in a more manageable manner. I mean the simplest and ideal process I can think of is: I toss the videos in the editor, i click an option to disable re-encoding, i choose the sections I want. Then it just chooses the nearest i frame to my cut choices (if it displayed the i frame that would be good too) and does all the above stuff. I don't have much experience with the modern capabilities of video editors. The ones I have used have very limited functionality when it comes to rewrapping/'no-encoding' compared to ffmpeg command prompt, or just always re-encode to begin with. So I'm just curious if there are editors that have the kind of re-wrapping functionality that ffmpeg command prompt has. Otherwise I'll need to pursue the solution from a scripting perspective, of which I know nothing about.

5
  • This verges on limitations with codec types, rather than being solely about limitations with software. A codec with i-frames (I presume h264 or similar is what you are using) has distinct limitations when copying the stream, as opposed to re-encoding, of which you seem aware. If you have the ability to record in a different format amenable to this trim/cut process you describe, then the best advice is to use that.
    – user3643
    Dec 28, 2018 at 3:12
  • That said, if there's such a gui, I'm eager to know it.
    – user3643
    Dec 28, 2018 at 3:13
  • Changing your workflow to not care about an extra re-encode here or there seems to be the standard all communities adhere by....I'm really confused as to why that is though given most of the data floating around has a low colour bit (8 bit) and suffers greatly from artifacts created during re-encode. I guess I'm hoping to stumble across a secret "rewrapping" society or something. The search continues...
    – kite
    Dec 28, 2018 at 18:18
  • Well, if you have full control, then hopefully you're capturing in a lossless or virtually lossless format. If so, then re-encodes will not affect quality, however, they take more time. My concern in my workflow is time spent, as I only work with my own data, which is captured lossless, but I generate over 1000 hours of data per year.
    – user3643
    Dec 28, 2018 at 18:39
  • Without reencode no GUI: stackoverflow.com/questions/59460175/… Dec 23, 2020 at 21:16

4 Answers 4

4

LosslessCut screenshot

LosslessCut is an open-source video cutting tool. Its interface is built using Electron, and its backend is ffmpeg. It's available on the three main operating systems (Linux/Mac/Windows), and also from the Mac, Microsoft and Snap stores.

3
  • Does the job, open source, easy to install. The interface could be cleaner but it's easy to learn to use. Nov 12, 2020 at 14:41
  • Too bad it's inprecize same as using ffmpeg from cli. Had a hope it would be smart enough to re-encode the small fragments to fix -ss timing discrepancy, but sadly it isn't (yet).
    – Klesun
    May 3, 2021 at 13:26
  • Though it has these nice "previous keyframe"/"next keyframe" buttons - with them one can extract a separate tiny video of the whole keyframe in which you want to split, re-encode it and merge result back with parts before/after the keyframe.
    – Klesun
    May 3, 2021 at 14:00
1

Free Studio 1.4.12 running on Windows XP

DVDVideoSoft makes a tool called Free Video Editor. It is free, but certain features are only available to premium users who buy a license. Free Video Editor can cut out scenes without re-encoding when using compatible formats such as H.264. You can export as a single file, or individual pieces. This feature was free (up until at least version 1.4), but is now only available to premium users.

MP4Splitter (part of MP4Tools) can be used to break an MP4 into multiple parts, and MP4Joiner (part of MP4Tools) can be used to join the parts you wish to keep. It is free.

1

FFmpegYAG

FFmpeg GUI for Linux & Windows

https://sourceforge.net/projects/ffmpegyag/

~18mb

I was looking for something to trim specific clips from my dashcam videos. A lot of the "free" programs I found were trial versions or came with extra baggage. When I realized that FFmpeg was a reputable engine that was capable of doing all the work, I decided I wanted to find a solution that worked with it.

I have very limited experience with FmpegYAG, but I was able to get it working after a few minutes of testing. I can visually cue the onscreen video to the beginning and ending of the clip I want encode. If you preview the video it will show a red "X" over the video that you have selected to exclude from encoding.

I like that it can generate script files. That allows me to see what commands it is sending to FFmpeg. They script files have an extension of .cmd but are equivalent to .bat files.

FFmpegYAG screen shot Note that if you select copy as the Video Codec, the encoding is extremely fast.

1
  • 1
    Unfortunately, this does not work on recent OSes (requires an old version of wxwidgets). Nov 12, 2020 at 14:29
0

AviDemux will do this - keyframe accurate without re-encoding ('copy' mode) as long as the vid file encoder settings are identical (I get driven nuts when the specs vary somewhat unexpectedly. I wish there was a clever workaround...)

Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks. Tasks can be automated using projects, job queue and powerful scripting capabilities. It supports most video formats like DVD, VOB, AVI, WMV, MPG, MP4, AVI, MOV, MKV, DV, FLV and codecs like H.264/AVC, H.265/HEVC, MPEG4 ASP(DivX, XviD), MPEG2, MJPEG, HUffYUV, PNG, YV12. It's available on the three main operating systems (Linux/Mac/Windows), and there's a 'portable' version. I use it on a Mac. GREAT APP! https://www.videohelp.com/software/AviDemux

========= I have also used LosslessCut recently and am very impressed by the possibilities of its 'smart cut' potential: "...This experimental feature will re-encode the part of the video from the cutpoint until the next keyframe in order to attempt to make a 100% accurate cut while losslessly copying the rest of the segment. Only works on some files:..."

https://github.com/mifi/lossless-cut/issues/126

https://github.com/mifi/lossless-cut/blob/master/README.md

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.