Table of Contents

Cutting MPEG files

Avidemux can read (indexed) MPEG files, either Elementary Stream, Program Stream or Transport Stream.

Internally, MPEG files are seen as frames with a fake codec (MPEG).

If you save the file in copy mode, be sure not to let the format be set to AVI, else you will end up with MPEG-in-AVI files which are uncommon and not accepted by many applications.

Usually you will want to use one of the following as a format:

Both PS & TS will produce an MPEG file containing audio and video.

Splitting, internal muxing

General

As usual, define the section you are interested in using A and B. You should read cutting if you did not already. If the format is “MPEG PS A+V”, Avidemux will write an MPEG-2 Program Stream (PS) using libmplex. The stream will be suitable for DVD authoring using dvdauthor, or VCD/SVCD authoring using VCDImager depending on the detected format.

Audio

Audio can be either from copy or process mode (for example editing a PVR capture file).

Video

The video must be MPEG (that seems obvious). As for audio, it can be in copy mode (edited PVR or DVD) or process mode (converted from AVI or other formats).

Saving

The output format should be set to “MPEG PS A+V”. If audio and video are not synced, you can use A/V shift, even in copy mode.

Notes

There are two importants things to consider here:

Splitting, external muxing

General

As usual, define the section you are interested in using A and B. You should read cutting if you did not already.

Audio

No special care to take here. Just save the audio in copy mode using Audio→Save menu entry. You will end up with either foo.mp2 or foo.ac3.

Video

For video, set the output format to “MPEG video” and save the result. This will ask the demuxer the raw data, bypassing the MPEG decoding step. It will also reconstruct the PTS/DTS logic to have a compliant MPEG stream.

Now you have a foo.m1v or foo.m2v MPEG-1/MPEG-2 Elementary Stream which should be synced with foo.mp2.

Muxing

Now it is time to remultiplex both streams to end up with foo.mpg. The first seq_header has the timestamp of the first frame (uncut). It may confuse mplex and you will end up with tons of error/warning messages.

If you have problems, use tcmplex from Transcode to mux them back together.