20

I am trying to cut a long video into several small pieces. Any recommended tools can do the task?

8
  • @DavidFoerster IMHO - This seems to be specific to cutting into segments as opposed to a general video editing question..
    – Elder Geek
    Oct 27, 2016 at 18:43
  • @ElderGeek video editing software is generally used to cut portions of video and move them around. Exporting clips is just one extra step. Oct 29, 2016 at 1:01
  • @Zacharee1 I would agree that cutting and moving is part of video editing. Adding and adjusting sound tracks is also a part. The accepted answer here for cutting a video into clips is better suited to the particular question posed than any of the others in the generic answer marked as a duplicate. Installing a full blown video editing suite seems overkill for the task at hand since ffmpeg accurately handles timecodes with the -ss and -t switches. I don't believe that any of the video editing suites is better suited to this task.
    – Elder Geek
    Oct 30, 2016 at 15:49
  • 2
    Voting to reopen as I don't see this task as well suited to the video editing suites in th marked duplicate answer.
    – Elder Geek
    Oct 30, 2016 at 15:52
  • 1
    @Zacharee1 actually, this question is far more narrow than the question you voted as a duplicate! Perhaps reading them again would provide clarity.
    – Elder Geek
    Nov 1, 2016 at 15:11

3 Answers 3

48

I found ffmpeg could do the task. To install the ffmpeg sudo apt-get install ffmpeg To copy a specific short duration from the video file.

ffmpeg -i original.mp4 -ss 00:01:52 -c copy -t 00:00:10 output.mp4

  • -i:input file. The file name of the original video clip.
  • -ss:start timestamp. In my case I tried to copy the new video from the original video started after 1 minute and 52 seconds.
  • -t:indicating the duration of the new video clip, in my case, 10 seconds.

  • Not sure parameter -c for, maybe the action? If some1 knows, let me know plz.


Reference:
- Cut video by using ffmpeg
- ffmpeg seeking in subsection [cut small sections]

4
  • 4
    -c indicates the codec to use (in this case copy as is without re-encoding)
    – Elder Geek
    Oct 27, 2016 at 18:42
  • 1
    For me it created audio mp4 file.
    – expert
    Oct 7, 2018 at 16:05
  • 1
    Thanks, but any solution for some fraction of a second? -ss 00:00:07:35 is invalid.
    – SYK
    Nov 22, 2018 at 7:50
  • 1
    @SYK you can type it like 00:00:07.35 Dec 20, 2019 at 21:58
4

Kdenlive, a non-linear video editor.

Install with:

$ sudo apt install kdenlive

You can see others by running Ubuntu Software and typing video editor in the search area.

3

Avidemux is good for quickly cutting video. Despite the name, it handles MPEG-4 video standards fine (as well as any other modern format like MKV).

It's not a non-linear editor, meaning that once you've made some cuts you can't go back and change earlier ones, and you can't re-order segments or insert new segments (although you can join videos by adding new clips at the end). It's great for simple tasks like trimming the start and end and maybe commercial breaks.

It can do what you want without issues - just select the segment to output, export it, then select the next part, and so on. If your selections fall on GOP boundaries (ie I-frames) then you can do it losslessly - without re-encoding, using "copy" as the video/audio codecs.

1
  • :+1: Editing reminds me of VirtualDub from Windows era Apr 14, 2020 at 13:29

Not the answer you're looking for? Browse other questions tagged .