This is a "plugin" for the Video Disk Recorder (VDR).

Written by:                  Marius "DMH" Heidenstecker <marius@heidenstecker.de>

Project's homepage:          not available

Latest version available at: not available

See the file COPYING for license information.

Description:

Cuts one recording into several recordings using named cutting marks.


The Multi-cut process and recording menu are heavily based on the original parts
of vdr itself, namely the cutting thread and the recording menu. Credits go
thankfully to Klaus Schmidinger.


Requirements
------------

- VDR 1.4.1


Usage
-----

Multi-cut:
----------

Mulit-cut splits a recording into several new recordings using named cutting
marks. So by now one has to manually edit the marks.vdr file located in a
recording-directory. If one adds a comment to a cut-in mark, Cut-a-Lot will take
this as the name for the new recording and will go on cutting to that recording
until another named cut-in mark is met. For example:

We have a recording named "MTV - Greatest Hits" and a marks.vdr with the
following content:

0:00:00.01 Artist A - Song 1
0:03:46.12
0:03:46.24 Artist B - Song 3
0:07:12.03
0:12:06.01
0:15:56.12
0:37:32.01 Artist C~Song 5
0:41:02.13

A - 1   B - 3                               C~5
|------||------|     |------|               |------|

Cut-a-Lot now creates three recordings named "Artist A - Song 1" which gets the
content between the first two cutting marks, "Artist B - Song 3" which gets the
content of the second and the third interval and a recording named "Song 5"
located in a sub-directory named "Artist C". That is because the tilde (~) is
treated as a directory-indicator.

If no marks are named, Cut-a-Lot pretty much does the same as the ordinary VDR-
cutter would do.


Gap finder:
-----------

Gap finder scans a recording for PTS-gaps (Presentation Timestamp-gaps) in order
to refind cut out commercial breaks or positions where VDR might have crashed
during a recording. These two frames are marked with two cutting marks.

The PTS-threshold as a parameter defines how large a gap has to be at least in
order to be marked. One PTS-tick is 1 / 90000 second. If you take 25 frames per
second as the frame-rate, one frame is 1 / 25 * 90000 = 3600 PTS-ticks long.
Usually there is an I-frame every 12 frames so the difference between two
I-frame PTSs should be always 12 * 3600 = 43200 ticks. But never the less the
difference were sometimes 43199 or 43201 in a few analyzed recordings. So I
introduced the PTS-threshold. The default of 3605 ticks means the PTS-timestamp
might jump one frame without being recognized.



Adjust PTS:
-----------

The adjustment of PTS (see http://www.vdr-wiki.de/wiki/index.php/PTS) can be
switched on and off in the setup. Having selected "no" does not end in any
differences to the original Multi-cut-process. Is "to first I-frame" or "to
zero" selected, all PTS values are going to be adjusted. The PTS of the first
I-frame is then either set to its old value or to zero. All following PTS' will
be adjusted relativly.

What was the motivation? I joined two recordings and generated a new index-file
with the genindex-utility. Watching the new recording worked very good, but
burning it with ProjectX as the demuxer ends in an incomplete recording. The
log-file has a message containing "big PTS difference". I did not find any
setup-options in order to solve that problem, so I did it on my own adapting
the cut-a-lot-plugin.

So how to proceed if "big PTS difference" occurs in a recording during the burn
process? At first, one has to remove all cutting marks but the first one, which
has to be on the position 0:00:00.01. Then one has to run cut-a-lot in the
Mulit-cut mode, having "Adjust PTS" in the setup point to "to first I-frame" or
"to zero". Afterwards the cut recording should work with ProjectX without any
error.
