Installation
Download and unpack the tarball.
Compile as root with
g++ -O2 vobcut.cc -o /usr/local/bin/vobcut -lm
Enjoy!
Options
USAGE: vobcut [options] <mpeg-file> ... (normal mode)
vobcut -D <mpeg-file> ... (dump mode)
vobcut -T <blocks> <mpeg-file> (truncate file)
analyse and cut mpeg2 program streams without decoding and demultiplexing
version 1.0, (c) by Bernhard Oemer, 2009, licence: GPLv3
general options:
-h help (this message)
-v verbose messages
-Q supress warnings
-t disable timestamp recalculation
-k keep incomplete mp2 audio packages
-P <len> mpeg PS pack size in bytes (2048)
-D dump sequences and audio packets and exit
-T <n> truncate single file to n blocks (dangerous) and exit
-f <time> force cut around PTS <time> given in seconds
-F <block> force cut at next sequence after the given block
I/O, scanning and caching options:
-c / -C do not read / write cache file even if .vobcut dir exists
-d create .vobcut cache directory if nonexistent
-o <file> output file, use -o- to write to stdout
-0 ... -9 write chunk number 0...9 (default: largest)
-p [len] preview: write first and last [len] seconds to stdout (5)
-q [len] preview boundaries enclosing selected chunks
-a <offs> soft adjust start (no hard transitions) *
-b <offs> soft adjust end (no hard transitions) *
-s <secs> min. initial partial scan sample length in seconds (3)
-i <secs> max. initial partial scan sample interval in seconds (30)
-n <n> number of initial scans, use -v to check block ranges (auto)
-e always scan entire file; can be faster than default partial scans
soft format (lbox/stmono) detection options:
-l / -L disable/enable letterbox recognition (auto)
-m / -M disable/enable stereo encoded mono recognition (auto)
-w <secs> letterbox/mono vote window in seconds (5)
-r <secs> removal limit for insular soft sections in seconds (10) *
-B <perc.> threshold for letterbox slice size in percent of inner slices (50)
-S <thres> threshold for stereo encoded mono (auto, fallback value 60)
* a hard section/transition implies an mpeg format change (e.g. 4:3 -> 16:9)
Limitations
- I have written the program to cut PAL DVB-S program streams from
my sat receiver after having ruined some recordings with a
graphical video editing program (loss of A/V-sync). While it might
work with other mpeg2 PSs, this is not tested.
- The philosophy of vobcut is to change as little as possible from the
original stream and avoid repacking, so no errors are repaired and
concatenations lead to incomplete audio packets as - other than the
start of sequences - audio packets are not pack-aligned.
- vobcut only deals with the first mpeg2 video (0xe0) and audio (0xc0)
stream and expects those to be present.
- letterbox detection assumes that slices are top down, 16-pixel wide
and cover the full width, which this is not required by the standard.
It also assumes that the black bands compress significantly better
than the rest, which is not always the case.
- audio has to mpeg audio, non-mpeg audio in private streams is not
supported. stereo encoded mono detection only works with mp2.
- lbox and stmono detection produce lots of false positives so they are
really only useful if you want to extract (as opposed to cutting away)
letterboxed or mono content.
- the default scanning strategy which consists of many short scans with
long gaps in between which only get read when necessary might not only
overlook scenes but can in fact take longer than a complete scan (option
-e). This happens esp. when doing lbox/stmono detection is active on
content that is mostly full-screen/stereo.
Vobscan
Vobscan is a quick and dirty bash script to create an two-level html-index of
mpeg2 file using