m2v mp2 cut

  m2vmp2cut 0.86 select in action.
[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -  
[DIR]0ld/26-Feb-2015 00:24 -  
[TXT]ANNOUNCE18-Oct-2012 18:23 738  
[TXT]COPYING13-Jan-2006 23:43 18K 
[   ]NEWS18-Oct-2012 18:23 4.2K 
[TXT]diff-0.82-0.84.html14-Apr-2015 20:11 54K 
[TXT]diff-0.84-0.86.html14-Apr-2015 20:11 36K 
[   ]dvdatool29-Sep-2007 18:32 4.3K 
[IMG]m2vcut-gui.jpg25-Sep-2012 17:02 87K 
[IMG]m2vcut-gui0.jpg25-Sep-2012 17:02 31K 
[   ]m2vmp2cut-0.86.tar.xz18-Oct-2012 18:05 77K 
[   ]m2vmp2cut-0.87-wip-20150219.tar.xz19-Feb-2015 13:10 93K 
[   ]m2vmp2cut-0.87-wip-20150223.tar.xz23-Feb-2015 22:36 93K 
[TXT]mpeg2info.c25-Jan-2006 16:25 36K 
[TXT]pxsup2dast.c04-Jul-2012 22:47 27K 
[   ]pxsup2dast.c-simon28-Jun-2011 09:08 30K 
[TXT]pxsup2dast.py25-Jan-2006 16:25 12K 
[   ]readpgs.py31-Oct-2012 09:26 3.2K 
[   ]simpletscut.pl04-Jul-2012 20:00 3.7K 
[TXT]son2dast.sh05-Jul-2012 12:19 3.4K 
[TXT]ts2dvdmpg.sh08-Jul-2012 13:48 8.0K 
[TXT]ts2mkv.sh14-Jul-2013 21:56 9.5K 
[TXT]uni2htmldiff.py14-Apr-2015 20:03 16K 

More recent information may be found at

See NEWS for changes

m2vmp2cut 0.86

m2vmp2cut is command-line driven frame accurate (currently PAL) mpeg2
video (m2v file) with accompanied mp2 audio (mp2 file) cutter.
A GUI tool is used for selecting the cutpoints.

Frame accuracy is achieved by re-encoding video around cutpoints.

Audio is cut from separate mp2 file at positions that keep a/v sync as
good as possible (maximum sync difference is around 10-15 milliseconds).

This program is licensed under the GPL v2. See file COPYING for details.


Note that 'm2vmp2cut' has pretty good help built-in. Executing 'm2vmp2cut'
or 'm2vmp2cut . help' will get to it...

First run:

$ m2vmp2cut  demux 

to demultiplex the source mpeg2, then execute GUI for cutpoint hunt:

$ m2vmp2cut  select

 is derived from original mpeg2 file by removing latest suffix
after dot (.) and replacing that with '.d'.

In order to 'select' to work the directory where m2v & mp2 files were demuxed
must have 'video.m2v' symlinked to the video and 'audio.mp2' to the video;
if those exist, the 'select' tool can be used to continue with content demuxed
by something else than m2vmp2cut.

After selection of cutpoints are done, the 'cut' command will create new
mpeg2 file from the selected contents, re-encoding some video frames to
achieve frame accuracy. Audio frames don't require any re-encoding.
Alternatively, there are some scripts in 'contrib' directory which can
re-encode the selected material to other formats. The 'contrib' command
will show available contrib scripts.


gtk2            -- gui library used by m2vcut
libmpeg2        -- for decoding mpeg2 pictures
Mjpegtools      -- for mpeg2enc and mplex tools
ProjecX (project-x.sourceforge.net) -- to demux source mpeg files
Java runtime    -- to run ProjectX (many non-sun vm:s work also)

Perl            -- m2vmp2cut.pl (run frontend) is written in perl
Python          -- some m2vmp2cut utilities are written in python
Posix Shell     -- /bin/sh which has posix shell capabilities
                   (not just Bourne) (this is usually the case)

C compiler      -- there are some C utilities that needs to be compiled
Java compiler   -- if you need to compile ProjectX


Transcode       -- for requantize option

(Other than ProjecX) Demux Tools (: (not used here (anymore))
mplayer (dumpaudio/dumpvideo?)


Run 'm2vmp2cut help' to get more usage information.


Göran Uddeborg
Daniel Pielmeier


Cutting demuxed files instead of mpeg2 file that has both audio and video
is done since:

1) Handling demuxed video file is easier; no messing with PTS, DTS and SCR
   and so on (I saved development time).

2) I can't compete with such a good tool as ProjectX to get stuff out
   of mpeg2 files.

3) Cutting separate audio and video files yields much better results cutting
   audio and video on right places (near-perfect A/V sync if original has
   so), for example using 48KHz 224 kbit mp2 files one 672 byte audio frame
   contains 24ms of audio -- so A/V sync is at max 12ms off. If doing
   'hard-cuts' in (multiplexed) mpeg2 files 1) audio packets contains like
   2.6 audio frames and 2) audio packets might be far off in the file
   the video packets with time close to each other...

Tools that helped to find out required information (Thanks to the authors!):

gopchop mpegcat tool
dvb-mpegtools analyze
google searches: `mpeghdrs.html' (video) and `mpeghdr.htm' (audio)
google search: `python_mpeg'