User Tools

Site Tools


video:cutpoints

where are the cuts made?

The actual editing of your video or audio (cutting into segments and stitching them together) is performed by FFmpeg.

Background

FFmpeg is capable of some very complex audio and video manipulation, which is why it has become almost the de facto standard for the majority of audio/video editing and conversion tools available today1).

However, this complexity comes at a cost:
The more complex the operation, the more complex the parameters are that you have to supply to FFmpeg and the more chances that FFmpeg will complain about conflicting parameters, or parameters that conflict with the contents of your input file.

For this reason, MMP keeps it [relatively 2)] straight forward to [all but] guarantee successful editing.

Conversely though, this also comes at a price, which is that cutting is performed at the “key frame” level, not at user-specified frames.

For most general editing this is entirely acceptable. 3)

The great advantage that this approach does have, though, is that producing the edited output file from your required edits is blisteringly fast - a couple of seconds and it's all over. 4)
Most editors re-encode the segments to a brand new video, which can take a considerable amount of time;
MMP simply does a copy/paste: it extracts parts of the original file and stitches them together. This also means the video quality is exactly that of the original file. 5)

Key Frames?


(a layman's description)

Video [file] compression works by only storing what has changed from frame to frame.
Every second or so, depending on how much the video image is actually changing, a Key Frame will be written 6) - a complete-image frame to re-establish a “difference” starting point.
The majority of a video file these days is just the changes between Key Frames.
This greatly reduces the size of video files.

It is those full-image Key Frames that MMP and FFmpeg use to make your cuts.

What difference does that make?

In a nutshell, if you make a cut (start a segment) between key frames 7), FFmpeg will make the actual cut on the most recent key frame preceding your cut.
Similarly, the cut at the end of a segment will also be made at the key frame before your cut.

In practice, then, we can be reasonably confident that:

  • the start of a segment is likely to include the frames you require
  • the end of a segment probably needs to be a second or two longer than you require, so that it includes the next key frame on which FFmpeg can make the actual cut.

This is also why

  1. it is very important to check your edited file before deleting the original 8)
  2. having two adjacent segments included in your edited video will likely result in overlap* 9)

* it's best to merge adjacent output segments.
[M] merge selected segment with the segment to its right
[N] merge selected segment with the segment to its left

1)
from all good stockists
2)
it wasn't!
3)
if you require a free, frame-accurate video editor, the excellent ShotCut is an easy recommendation to make
4)
…she cried!
5)
with some editors, depending on your output parameters, you can lose picture quality during the re-encoding
6)
a common rule of thumb is a key frame every 2 x Frame Rate. So if the frame rate is 30fps, write a key frame every 60 frames
7)
which is more likely than not
8)
and MMP will never provide the option to do that automatically!
9)
because the start of one segment is cut on a key frame that's part of the preceding segment and vice versa
video/cutpoints.txt · Last modified: 2024/07/22 14:13