MythArchive 0.20
================
MythArchive is a MythTV style plugin which uses the mythburn.py script to create
and burn DVD's from MythTV recordings, MythVideo files or any video files
available on a MythTV system. It can also export recordings to a native
archive format which can then be imported back into a MythTV system  restoring
all the associated metadata.

There is a more detailed description of what MythArchive is capable of on the wiki :-
www.mythtv.org/wiki/MythArchive


PREREQUISITES
=============

MythArchive doesn't need any prerequisites to compile other than Myth itself.

You will need to install the following dependencies for the mythburn script:

Python2.3.5
python2.3-mysqldb
python2.3-imaging (PIL)
mjpegtools mplex-2 version 1.6.2 (2.2.3)
ffmpeg version 0.4.9-pre1
DVDAuthor::dvdauthor, version 0.6.11
mkisofs 2.01a34-unofficial-iconv
growisofs
M2vRequantiser (optional)

COMPILE AND INSTALL MYTHARCHIVE
===============================

MythArchive is part of mythplugins and can be selected to be compiled
by adding --enable-mytharchive when configuring the plugins.

You can also choose which parts of MythArchive you would like to include
    --enable-create-dvd      enable dvd creation [yes]
    --enable-create-archive  enable native archive creation [yes]


FEATURES / HOW-TO-USE
=====================

After installing MythArchive, restart the mythfrontend.  There should be two
new menu items.  The first is used to run the MythArchive plugin and the
second shows MythArchive's settings pages.

IMPORTANT - You must confirm that the program settings are appropriate for
your system.  The temp directory setting is crucial - you must have
sufficient space for the script to create all its work files.  Plan on 10
GB.

Now you can run the MythArchive plugin. First you need to cue some
files for archiving from the "Find Files To Archive" menu. You can 
choose MythTV recordings, MythVideo files or any media file accessible
from your filesystem.

To create a DVD
---------------
* Choose Export Video Files | Create DVD.

* Choose what size DVD you are going to use and whether you want to just
  create the file system or create an ISO image for later burning or actually
  burn the ISO image to a blank DVD. Press 'Next'.

* Choose what files you want on the DVD. If the file is a MythTV recording and
  the file has a cut list you can have MythArchive cut out the commercials for 
  you. If you wish to edit the files metadata (title, subtile, description etc)
  press 'Menu' to show the popup menu and choose 'Edit Details'. Press 'Next'.

* Choose the DVD menu theme you would like. Press 'Next'.
 
* The final page of the wizard shows you the shows you have chosen and the
  order in which they will appear on the DVD and also shows whether a cut list 
  will be used. On this page you can also choose what re-encoding profile to
  use. Each file can have a different profile if you wish. If the file is
  already a DVD compliant file the default is to not re-encode the file but
  you can if you wish choose another profile maybe to reduce the file size so you
  can squeeze more files on the DVD. Press 'Finish'.

  The script to create the DVD will now be run and the log viewer will now be 
  shown.

To create a native archive backup
---------------------------------
* Choose Export Video Files | Create Native Archive 

* Choose what size DVD you are going to use and whether you want to just
  create the file system or create an ISO image for later burning or actually
  burn the ISO image to a blank DVD. Press 'Next'.

* Choose what files you want to backup. Only MythTV recordings or MythVideo
  files are supported.

* The final page of the wizard shows you the files you have chosen. 
  Press 'Finish'

  The script to create the backup files will now be run and the log viewer 
  will now be shown. 

To import a native archive backup
---------------------------------
* Choose Import Video Files 

* Use the file selector to find the xml file containing the metadata for the
  file you want to import. Press 'Next' 

* On the next page if the file you want to import is a MythTV recording you
  can choose what TV channel should be associated with the recording - this is
  mostly usefull if the exporting system and importing system have different
  channel line ups. MythArchive tries hard to find a reasonable match but
  there may be instances where it can't find one so you may have to choose a
  channel yourself. Press 'Finish' 

  The script to import the archive will now be run and the log viewer will 
  now be shown. 

Using the log viewer 
--------------------
Whenever a script is run to create a DVD or native archive or when the import
native archive script is run the log viewer will automatically be shown. By
default the viewer will automatically update ever 5 seconds. You can turn this
off or change the update frequency by changing the options at the top of the
viewer. You can if you wish exit the viewer and continue to use Myth. If you 
do this and return to MythArchive and the script is still running the log 
viewer will be shown again automatically. If you want to stop the script you
can press 'Cancel' and the script will be asked to stop. It may take several 
minutes for the script to respond, depending on what it is doing at the time. 
The update button will force the log viewer to update.


Keys:-
* Up/Down/Left/Right - move focus/change selection
* Select             - activate push button/toggle selection 
* Exit               - return to Myth main menu  
* C                  - toggle use cut list

TROUBLESHOOTING
===============

1. The script fails with "ERROR: Failed to init mythcontext." message.
----------------------------------------------------------------------

The most likely cause of the error is the MythContext cannot find a valid
'mysql.txt' file. You are most likely to see this problem when using the web
interface and the user that your web server is using doesn't have a home
directory.

There are two ways to fix this error:

    a) Create a home directory for the user running your web server and copy
       a valid 'mysql.txt' file into that directory.
    b) or copy a valid 'mysql.txt' file to either
    INSTALL_PREFIX/share/mythtv/ or /etc/mythtv/

You should find a copy of your mysql.txt file in one of the following
locations:-
    INSTALL_PREFIX/share/mythtv/mysql.txt
    /etc/mythtv/mysql.txt
    ~/.mythtv/mysql.txt


2. The script fails with "ERROR: Failed while running growisofs." message.
--------------------------------------------------------------------------

The most likely cause of the error is insufficient file permissions on the
cdrom device. Make sure the user that is running the script can both read
and write to the device that you use to burn DVDs.

How you do that is dependent on how your distribution sets things up. It may
be sufficient to add the user to the 'cdrom' group. You may also have to
relax the permissions on the device itself to allow the cdrom group
read/write access to it.
