User Tools

Site Tools


using:cutting

This is an old revision of the document!


Cutting

Simple cutting

Audio/video sync

If you are editing a file with variable bitrate audio, run Audio→Build VBR Time Map before you do any editing. Otherwise your audio will be out of sync.

Markers

Video edits are done inside of marked sections, from the start and end of a selection. Markers A and B are used to set the start and end of a sequence. You can set them using the A and B buttons.

You can also jump to marker A or B using the Go→Go to Marker A or Go→Go to Marker B menu entries.

Marker positions are also displayed at the bottom of the screen, under the Selection section:

Obviously, marker A can't come after marker B. If you try to set marker A to a frame after marker B, Avidemux will set marker B to that point, and marker A to the frame after where marker B used to be. So, for example, if marker A is at frame 0 and marker B is at frame 10, then you set marker A to frame 20, Avidemux will actually put marker A at frame 11 and marker B at frame 20.

Saving

You can save part of a stream by going to File→Save→Save Video. Every frame from marker A to marker B will be saved, excluding the frame at marker B. Mathematically speaking, the set of frames saved is [A,B).

Removing

The Edit→Delete menu entry will remove frames from [A,B) from the stream. It can be used, for example, to remove commercials from a video capture. Avidemux will make sure to keep the audio in the stream in sync with the video, unless you have an external audio source.

External audio source

When doing cutting or deleting, if the video has an external audio source, Avidemux will not cut sections of the external audio to synchronize or match the video timing.

There are two options for getting your external audio source to sync properly with Avidemux when you are cutting/deleting video frames:

  1. You can edit the audio file yourself. Basically this means cutting the audio file yourself in an audio editing program.
  2. A good work around for the external audio source problem is to edit the video two times using Avidemux.
    • First, use Avidemux to add the external audio source and then save your video.
    • Second, now the external audio source is internal audio source in the video you saved. Open the saved video in Avidemux and it will now automatically sync the audio with the video when you do edits.

Intra frames and SmartCopy

This section only applies when video is in copy mode (encoder is set to Copy). In process mode (an encoder is selected for encoding), Avidemux internals ensure everything is alright.

Warning: When Format is set to “AVI, unpack VOP”, Avidemux will use copy mode for all frames (including the “broken” ones) even if a video encoder is selected for encoding. SmartCopy mode will not work either, because SmartCopy needs to re-encode the broken frames.

Usually, each frame of video isn't that different from the one before(nbsp)(ndash) someone's mouth moves a bit, the background shifts around, etc. Most video codecs use this fact to save space, by saving a complete frame every few seconds, and making the other frames simply a modification of the reference frame. Complete frames are referred to as Intra frames, or sometimes I-frames or keyframes.

Markers don't have to be at key frames, so your stream might look like this:

abAdeIghBjklInop

Where lowercase letters are intermediate frames, A and B are marked frames, and I is an intra frame. When you cut frames [A,B), you will end up with:

abjklInop

Where frames jkl are broken, because they specify changes relative to an I-frame that no longer exists. There are two ways of dealing with that:

  • Make sure the B marker is an I-frame. In that case no problem.
  • If your file uses MSMPEG-4 (DivX(nbsp);-)(nbsp)3) or MPEG-4 video, you can use smart copy mode. Smart copy will leave most frames unchanged, but re-encode the part that lost its reference images with a fixed quantizer. So in our example, frames ab and nop would remain unchanged, while frames jkl would be re-encoded to use a different reference frame. Smart copy will ask you for a value for the quantizer to use(nbsp)(ndash) 4 or 5 is generally OK.

Copy/paste

Frames can be copied and pasted by doing Ctrl-C and Ctrl-V. When copying, you must make sure the first frame you copy is an I-frame; when pasting, the frame after the insert point must be I-frame. Smart copy will work in that case, but not with streams containing B-frames.

Example of cutting/deleting frames

Build VBR time map

1. If you are editing a file with variable bitrate audio, run Audio→Build VBR Time Map before you do any editing. Otherwise your audio will be out of sync.

Markers

2. Use the Marker A A button to set the start of what you want to edit.

3. Use the Mark B B buttons to set the end of what you want to edit.

You can confirm the start and end edit positions the frame displayed at the bottom of the screen, under the Selection section:

Cut/delete

4. The Edit→Delete menu entry will remove frames from [A,B) from the stream.

Save video

5. Save the video with the section deleted. You can use the menu File→Save→Save Video. You may be able to use Video Copy and Audio Copy modes to do this edit, but you may not and you may have to encode the video.

Advanced cutting

Autosplit

Using File→AVI Muxer Options, you can specify a file size in megabytes. Each time that file size is reached and an intra frame is present, Avidemux will create a new file. You will end up with foo.avi.1, foo.avi.2 etc.

As the new file must begin at an I-frame, the file size you specify is only accurate to within about 5 megabytes.

using/cutting.1352620300.txt.gz · Last modified: 2016/06/20 10:39 (external edit)