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

Written by:                  Sascha Volkenandt <sascha at akv-soft dot de>
                             sponsored by Open Source Factory
                             designed for xeatre.tv

                             Some changes merged by Helmut Auer
                             <helmut at helmutauer dot de>

Project's homepage:          http://www.xeatre.tv/community/burn/

Language:                    Italian by Gianni Zacchia (Pizzak) (email: gianni.zacchia@katamail.com)

Latest version available at: http://www.xeatre.tv/community/burn/

See the file COPYING for license information.


Purpose
-------

This Plugin enables VDR to write compliant DVDs from VDR recordings while 
being able to control the process and to watch progress from inside VDRs 
on-screen-display. If the selected recordings don't fit the DVD, the video
tracks are requantized (shrinked) automatically.

The created menus support multipage-descriptions (in case the recording summary
exceeds one page).


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

vdrsync.pl       - http://vdrsync.vdrportal.de 
  ** Tested with 0.1.3PRE1-050115

requant          - http://metakine.com/files 
  ** ATTN: Currently only the snapshot from around July 2004 is supported
  ** For convenience, I've uploaded the package to:
  ** http://www.xeatre.tv/community/burn/contrib/M2VRequantizer.tar.gz

tcrequant, tcmplex, tcmplex-panteltje
(transcode)      - http://www.transcoding.org/
(panteltje)      - http://panteltje.com/panteltje/dvd/
  ** Tested with 0.6.10 - 1.0.0
  ** If using tcmplex-panteltje, 0.4.7 or later is required

Imlib2           - http://enlightenment.org/pages/imlib2.html
  ** Tested with 1.0.5 - 1.2.1
  ** needs at least some truetype font support (freetype or libttf) and png

dvdauthor        
spumux
(dvdauthor)      - http://dvdauthor.sourceforge.net
  ** Tested with 0.6.10 - 0.6.11

growisofs   
(dvd+rwtools)    - http://fy.chalmers.se/~appro/linux/DVD+RW
  ** Tested with 5.13
  ** needs mkisofs

ppmtoy4m
mpeg2enc
(mjpegtools)     - http://mjpeg.sourceforge.net/
  ** Tested with 1.6.0 - 1.6.3-RC3

y4mscaler        - http://www.mir.com/DMG/Software/
  ** Tested with 0.6.2 and 8.1
  ** Be sure to use one that works with your version of mjpegtools

convert          
(ImageMagick)    - http://www.imagemagick.org/
  ** Tested with 5.5.7
  ** Must be compiled with png support


Installation
------------

1. Untar the archive inside VDR's plugin-source folder

   vdr-1.3.22 # tar xvfz -C PLUGINS/src vdr-burn-0.0.4a.tgz

2. (optional) Patch VDR if you want to prevent shutdown while the plugin is
   working on some DVDs

   vdr-1.3.22 # patch -p1 < PLUGINS/src/burn/patches/vdr-pluginactivity.diff

3. Recompile VDR and Plugins

   vdr-1.3.22 # make plugins-clean clean vdr plugins

3b.(optional) Change the default DVD writer device and the default ISO 
   directory with DVDDEV (default: /dev/dvd) and ISODIR (default: not set)

   vdr-1.3.22 # make DVDDEV=/dev/cdrecorder ISODIR=/pub/export plugins

4. Copy the script burnmark.sh and handlearchived.sh to some location
   inside your $PATH. Adjust the message displayed within this script
   to your needs, if you like.

   vdr-1.3.22 # cp PLUGINS/src/burn/burnmark.sh /usr/local/bin
   vdr-1.3.22 # cp PLUGINS/src/burn/handlearchived.sh /usr/local/bin

5. Copy the script vdrburn.sh to some location inside your $PATH.
   Adjust the setting for nice execution on top of this file to your needs,
   if you like :-)

6. Copy the font file and menu image templates into "plugins/burn" inside your 
   VDR configuration directory (usually /video0 or /etc/vdr)
   or even better use the nice backgrounds from Thomas_D
   ( http://www.vdr-portal.de/board/thread.php?threadid=27366 )


   vdr-1.3.22 # cp -a PLUGINS/src/burn/burn /etc/vdr/plugins/

7. Add the following entry to your reccmds.conf

   Mark for DVD-Writer        : /usr/local/bin/burnmark.sh -add
   Delete Mark                : /usr/local/bin/burnmark.sh -del
   Clean archived recording   : /usr/local/bin/handlearchived.sh -clean
   Restore archived recording : /usr/local/bin/handlearchived.sh -restore

8. Enjoy! :-)


Usage
-----

When starting VDR and the Plugin, you can specify the directory where the 
temporary files will reside, your dvd recorder device, and optionally a 
directory where a possible ISO is placed. If you specify both a dvd recorder
and an iso directory here or at compile time (see above, 3b), you can choose
in the OSD what actions the plugin will take (create an ISO, burn on-the-fly, 
or do both). See vdr -P burn -h for a syntax explanation.

To start a new DVD Project, you first have to mark one or several recordings
from inside the recordings menu. To do so, select a recording, press the "red" 
button and select "Mark for DVD-Writer". 

Now, you can start the Plugin "Write DVDs" from the main menu. You will see
an overview of the selected recordings along with some additional information.
You can edit the recording and disc titles by selecting such an entry and 
pressing the "right" button. Editing is done as known from other VDR menus
(like when editing channel names). Press "Ok" to confirm and save the title.

You can also delete recordings from that list and change the order of 
recordingswith the "green" and "yellow" buttons. You can add recordings by 
leaving the plugin and selecting addigional recordings from the recordings
menu.

Between the recording titles and the disc info, you see a progressbar which 
shows how much space the recordings would consume on a 4,7GB DVD+-R(W). If 
space exceeds the limit, an additional warning "Recordings would be shrinked!"
is displayed.

You can choose between 3 DVD Types:
DVD with Menuse / DVD without Menues / Archive Disc

The first two options will create a Video DVD compatible Disc with or without
menues. In this case the recording will be cutted according to the marks
during processing.

The third possible DVD type, "Archive-Disc", just burns the VDR recording
structure onto the DVD without shrinking and without cutting, useful in
conjunction with the Media-Detection Plugin, which can detect and play such
discs.

Additionally the burn plugin can create "dvd.vdr" marks in the actual
recording directory which are compliant to the DVDArchive patch. After
archiving the recording to DVD you can delete 001.vdr, 002.vdr ... and
index.vdr (which will be done automatically by "handlearchived.sh -clean" -
see the reccmds.conf setup above). In the recording menu you can see the
recording as before. When you try to play the recording the DVDArchive
patch asks for the DVD with the index which has been written to dvd.vdr.
When you insert the DVD it is played as if it would have been on disc.

For an even better WAF (women acceptance factor) you should apply the
"enAIO-rm" patch to vdr, which also displays if a recording is on hard disc
or on DVD and if it is on DVD it tells you on which
(see ./patches/*enAIO*diff)

Pressing "red" now starts the necessary processes. If you place an empty 
DVD+-R(W) into your drive, the job will run and finish, and after some time
(depending on the speed of your computer) the tray will open and the disc is
finished. Anyway, you will be asked to place an empty disc into the drive if
you forget it.

You will notice that the display changes after you pressed the "red" button.
You can switch between those displays using the "blue" button. This way you
can enqueue additional jobs while one job is processed. In the status display,
you can also see a hint on the progress (although the bar is not too precise)
and whether a job crashed for some reason. If a job is marked as "crashed", 
you could examine the logfiles in /video/.vdr-burn.XXXXX. All intermediate 
files (including logs) are deleted if you remove the erroneous job from the
status display (using the "yellow" button).


Caveats
-------

- No transcoding is done (will fail with non-DVD-compliant DVB-streams)
- Several things look "weird" with VDR >1.3.7, but they still work
- The menu is closed after one minute of inactivity (that's done by VDR, not
  the plugin!). Just let it run in the background or check back regularly.



