Merci pour la traduction elle est mise en page
23.4 Interface Utilisateur de MythTV et tailles d'affichage X
MythTV est conçu pour être utilisé tout autant comme une application de visualisation en plein écran sur un téléviseur que comme une application fenêtrée sur le bureau de votre ordinateur. Voici quelques considérations concernant la configuration des tailles d'écran qui conviendront à vos besoins.
Pour une sortie sur une télévision, les résolutions généralement utilisées sont 640×480, 800×600, et sur de rares modèles 1024×768. En général, la plus haute résolution disponible est la meilleure. Néanmoins, vous pouvez préférer la qualité d'image procurée par une des résolutions plus basses. Tout dans MythTV est “scalable” et devrait s'adapter au mieux à la résolution choisie.
Editez votre fichier de configuration X, en principe /etc/X11/XF86Config-4 pour XFree, ou /etc/X11/xorg.conf for Xorg, de façon à ce que la résolution que vous voulez utiliser se trouve en premier dans la liste sous la section “Screen”. Si cette résolution est plus élevée que les résolutions supportées par votre écran de sortie, vous ne verrez qu'une partie de l'image, qui défilera quand vous approcherez votre souris d'un bord, pour vous montrer le reste de la surface du bureau. Si vous êtes dans ce cas, Modifiez votre fichier de configuration du serveur X pour que les résolutions du bureau et de l'écran correspondent et redémarrerez le serveur X.
Dimensions de MythTV
Dans “mythfrontend” allez dans Setup→Appearance. Les hauteur et largeur par défaut son positionnées à “0” - Avec ces paramètres, MythTV se met en plein écran : il adapte ses dimensions automatiquement pour occuper toute la taille du bureau.
Si les hauteurs et largeurs de MythTV n'ont pas la valeur “0”, mythfrontend utilise les dimensions indiquées en partant du coin en haut à gauche du X Desktop. Si les coordonnées X et/ou Y ne valent pas “0”, le coin en haut à gauche est positionné à cette coordonnée. Si la case “Lancer l'interface dans une fenêtre” (“Run the frontend in a window”) est cochée, La fenêtre aura une bordure et sera déplacable n'importe ou sur le bureau.
NOTE: Quand l'interface graphique est en plein écran, vous devriez voir des fenêtres s'empiler rapidement les unes sur les autres. Si cela arrive, vous devrez changer l'option pour prendre le focus sur une fenêtre dans votre gestionnaire de fenêtres en sélectionnant l'option “Cliquer pour avoir le focus” afin que les fenêtres s'empilent correctement. Les polices de caractères pour l'interface graphique et l'OSD se mettront à la taille que vous utilisez, quelle qu'elle soit. La plupart des tailles de police de caractères peuvent être changées dans le menu de configuration ou dans les fichiers XML qui sont dans le répertoire /usr/local/share/mythtv . Soyez certain d'utiliser des polices de caractères suffisamment larges pour pouvoir être lues sur un écran de TV à une certaine distance.
La taille du plein est basée sur celle de X. Pour Xinerama, vous pouvez spécifier un écran dans Setup→General. L'image sur la TV sera étirée pour couvrir la totalité de la surface du GUI, sans prendre en compte la résolution utilisée lors de la création du fichier. Toutefois, durant la lecture, la touche “W” peut-être utilisée pour corriger les différences 16:9 / 4:3.
Because picture edges can be ragged and screen edges aren't straight, Television is designed to project an image larger than the physical screen. This is called “overscan”. Underscan is fitting the entire image inside the screen. Underscan is useful for computer monitors so that toolbars and scrollbars at the edges can be seen.
For best results, match the X display area as close as possible to the edges of the physical screen. This can only be adjusted by your tv-out device or by the settings for the television set. Many sets have these adjustments in a 'service mode'. If you cannot make these adjustments, there will be black borders around the edges of the X desktop, MythTV GUI and TV playback.
MythTV has settings for “Overscan” in Setup→Playback. These can not, and do not, cause the image to display beyond the edge of the X display area. The purpose of these settings are to cut off rough edges and to expand the image so that objects will appear to be the same size as a normal overscanned TV picture. 23.5 Saving or restoring the database
See the mysqldump manpage for more information.
$ mysqldump -u mythtv -pmythtv mythconverg -c > mythtv//backup.sql
To restore: (assuming that you've dropped the database)
$ mysql -u root mysql>create database mythconverg; mysql>exit $ mysql -u mythtv -pmythtv mythconverg < mythtv//backup.sql
You may need to alter the MySQL permissions if this database is being shared with multiple systems. See the Modifying access to the MySQL database for multiple systems section for more information. 23.6 Deleting the MySQL database
NOTE: Performing this step will remove the entire database. You will lose all of your settings and will need to re-run the mc.sql script to setup the database structure before running the setup program.
$ mysql -u root mysql> drop database mythconverg; mysql> quit
23.7 Moving your data to new hardware
This assumes that you will be moving your data to newer / bigger hardware and don't want to lose your programs.
The first step is to create a database backup as demonstrated in an earlier section.
Next, you will extract only the data that is relevant to the programs:
$ grep "INSERT INTO record " mythtv//backup.sql > restore.sql $ grep "INSERT INTO recorded " mythtv//backup.sql >> restore.sql $ grep "INSERT INTO oldrecorded " mythtv//backup.sql >> restore.sql $ grep "INSERT INTO recordedmarkup " mythtv//backup.sql >> restore.sql
NOTE: Newer versions of mysqldump place backticks around the table names. Backticks are not the same as apostrophes! On a typical North American keyboard, backticks are located to the left of the “1” key, on the same key as the tilde. Also, because the bash shell may try to interpret the backticks, make sure you use a before each one.
If your restore.sql file is empty, you'll need to re-run the commands like this:
$ grep "INSERT INTO `record` " mythtv//backup.sql > restore.sql $ grep "INSERT INTO `recorded` " mythtv//backup.sql >> restore.sql $ grep "INSERT INTO `oldrecorded` " mythtv//backup.sql >> restore.sql $ grep "INSERT INTO `recordedmarkup` " mythtv//backup.sql >> restore.sql
Note the space after the table name and the “»” to append to the file for all but the first grep. “recordedmarkup” is huge and may be hundreds of thousands of lines if you had lots of hours of recordings.
After you have moved the data files to the new hardware, configure MythTV using the mythtv-setup program as you normally would with a standard MythTV installation.
At this point we will restore the information about your programs back into the database:
$ mysql -u mythtv -pmythtv mythconverg < restore.sql
After successful insertion of the data you may delete the restore.sql file. 23.8 btaudio
btaudio allows you to obtain the audio data from your tuner card directly over the PCI bus without using a sound card. This is useful if you would like to use multiple tuner cards in a system without adding a sound card for each one, or if your existing sound card is not capable of full-duplex operation.
In order to use btaudio, your tuner card will need certain hardware installed on it, and that hardware must be wired correctly. The chip that will allow you to use the btaudio module is the MSP34xx. However, having a MSP34xx is no guarantee that you will be able to use the btaudio module.
As of 2003-03-31, this is the current list of cards and their status: Works with btaudio:
The following cards do not work:
The following cards have been reported to work, but have issues:
Once btaudio loads, it should register additional /dev/dsp and /dev/mixer devices. Typing $ dmesg will let you know what's going on. 23.9 Removing unwanted channels
If mythfilldatabase grabbed a channel which you do not want to include in your TV listings, you can remove the entries from the grabber configuration and the MySQL database. This often happens with premium channels; for example, HBO or Showtime may be available on your cable TV system, but is scrambled because you're not a subscriber to that channel. Since you can never watch it, you want to get rid of it.
If you are using the DataDirect service, login to your account at http://labs.zap2it.com/ to modify your lineup. Uncheck the boxes for any unwanted channels, and they will no longer be included in your download.
If you are using a grabber from XMLTV, comment out the channel from the ~/.mythtv/<sourcename>.xmltv file by inserting the word “not ” (including the space) in front of the unwanted entry. This will prevent xmltv from grabbing future listings.
Next, delete the unwanted item from the channel table so that it will not appear in the EPG or when changing channels. To delete the data from the database we need to perform some steps. First, assuming that HBO is channel 15, we need to find out the internal chanid used by MySQL:
$ mysql -u root mythconverg mysql> select chanid from channel where channum=15; +--------+ | chanid | +--------+ | 1015 | +--------+ 1 row in set (0.00 sec) mysql> delete from channel where chanid = 1015;
Old program data will be removed over the course of a week. However, you may want to immediately delete any current program listings for the channel that has been removed:
$ mysql -u root mythconverg mysql> delete from program where chanid = 1015;
You may want to use a central server to store your files.
On the host machine, (in this case, the hostname is “masterbackend”) you'll want to edit your /etc/exports file and use something like:
To export the /var/video directory with read / write privileges.
On the “slave” machine, you'll want to edit the /etc/fstab file and add something like:
masterbackend:/var/video /var/video nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3,actimeo=0
Then run # mount -a to re-read the file to mount the file system.
In this case, the source is a machine called “masterbackend” which is exporting the directory “/var/video”, which we're mounting locally at “/var/video”. The rsize and wsize options are used to increase the performance of NFS “hard,intr” is there because that's the recommendation of the NFS-HOWTO, the nfsvers is required for filesizes over 2GB and actimeo is used to turn off file attribute caching. Attribute caching for a shared media point causes problems you always want to see the latest state of the directory and files. See http :
www.mythtv.org/wiki/index.php/Optimizing//Performance for additional information regarding performance optimization.)) ))23.11 Automatically starting mythfrontend at system boot time Here's an example submitted to the mythtv-dev list by Pat Pflaum mailto:firstname.lastname@example.org using fvwm: $ cat > .xinitrc fvwm & mythfrontend ^D $ cat > .fvwmrc Style myth * NoTitle, NoHandles, Sticky, WindowListSkip, SloppyFocus, GrabFocus, BorderWidth 0 ^D $ The following also works with blackbox: $ cat > .xinitrc xset -dpms s off & irxevent & mythfrontend & blackbox Make sure that your .blackboxrc file has: session.screen0.focusNewWindows: True session.screen0.focusModel: SloppyFocus in it. 23.12 Automatically starting mythbackend at system boot time Red Hat And Mandriva Here's a method for automatically starting mythbackend submitted by Mike Thomson ( mailto:email@example.com) and Stu Tomlinson ( mailto:firstname.lastname@example.org). Copy the files from the MythTV contrib directory or from Mike's web site ( http://m-thomson.net/mythtv/) as follows: etc.rc.d.init.mythbackend should be made executable and copied to /etc/rc.d/init.d/: $ cd contrib $ su # chmod a+x etc.rc.d.init.d.mythbackend # cp etc.rc.d.init.d.mythbackend /etc/rc.d/init.d/mythbackend etc.sysconfig.mythbackend should be copied to /etc/sysconfig/: $ cd contrib $ su # cp etc.sysconfig.mythbackend /etc/sysconfig/mythbackend Edit /etc/sysconfig/mythbackend if you want to change the defaults (the userid that should start mythbackend, location of the logfile and (if required) the name and location of the mythbackend binary). Use chkconfig to make sure the script is called when entering runlevels 3, 4 or 5: $ su # chkconfig –level 345 mythbackend on # exit $ Log files By default, the log file for mythbackend will be written to /var/tmp/mythbackend.log. This has been tested and is known to work on Mandriva and Red Hat, but many people prefer to place logs under /var/log/. To do this, create a group called mythtv (or anything you prefer) and add your usual MythTV users to that group. If you changed the user that starts mythbackend from the default of root you must perform this step. Create the directory /var/log/mythtv and set its permissions as follows: $ su # mkdir /var/log/mythtv # chown root:mythtv /var/log/mythtv # chmod 0775 /var/log/mythtv # exit $ ls -ld /var/log/mythtv drwxrwxr-x 2 root mythtv 4096 Apr 28 21:58 /var/log/mythtv/ $ Mandriva Mandriva adds one more twist in the form of the msec utility, which runs regularly and (at the default or any higher security level) sets permissions on many files, including those under /var/log. To tell msec about the MythTV log files and their directory, you need to edit the /etc/security/msec/perm.local file to include the following: # /etc/security/msec/perm.local # Local overrides to the msec program # # Full file path user.group permissions /var/log/mythtv/ root.mythtv 775 /var/log/mythtv/ * root.mythtv 664 A copy of the above has been included in the contrib/ directory. You may add it by typing: $ cd contrib $ su # cat etc.security.msec.perm.local » /etc/security/msec/perm.local # exit Finally run the msec tool to check and implement your changes. $ su # msec # exit $ NOTE: msec can only reduce the permissions of files, so if you don't get the results you expect, check that you're not asking msec to add missing permissions to the files or directories you created. Gentoo The portage file for MythTV has scripts that will allow you to run mythbackend at startup. To run mythbackend as a daemon which starts at boot time: # rc-update add mythbackend default To stop mythbackend as a daemon: # /etc/init.d/mythbackend stop To obtain a list of options: # /etc/init.d/mythbackend 23.13 Advanced Backend Configurations MythTV is flexible in the way that you define multiple backend tuner configurations. The only hard-and-fast rule is that the Master backend must have a capture device defined, but shouldn't imply that the capture device in the Master backend must be the first capture card defined in the database. One example of an advanced configuration is the round-robin scheme. Rather than defining all of the cards on the master, you could first go into setup on the master to define globals such as the general configuration and the channel lineup but not the host-specific configuration item like the capture card. In this example, we will use a 4 tuner configuration, where two slaves have one card each and the master has two. 1. Add the first capture card on one of the slaves. Complete the configuration, connecting the input source to the card. This will get cardid #1 in the database. Exit setup. 2. Configure the first capture card on the master backend. This will get cardid #2 in the database. Exit setup. 3. Configure the first capture card on the second slave. This will be cardid #3 in the database. Exit setup. 4. Configure the second capture card on the master backend. This will get cardid #4 in the database. Exit setup. Using this scheme, the master backend will not use both capture cards until one of the following happens: * There are four recordings scheduled for the same time * Both slaves are unavailable The scheduler in MythTV checks whether an encoder is available; if a slave backend isn't running, its encoder isn't available, so the scheduler will look for the next available encoder. This makes MythTV very flexible; slave tuners can come and go, and as long as there are enough tuners for what you'd like to record it doesn't matter which tuner in particular is going to be used. Using this round-robin scheme along with a shared storage directory like NFS and enabling the Master Backend Override setting will allow you to view content even if the slave backend that recorded a program is not available. 23.14 Using the transcoder MythTV's built-in transcoder re-encodes recordings from one codec to another. The transcoder has three primary uses; it can transcode MPEG-2 files captured using a hardware encoder (PVR cards, DVB cards, ATSC HD, etc.) to MPEG-4, it can be used to transcode RTjpeg files (usually only used on systems that can not real-time encode to MPEG-4 using a framegrabber) to MPEG-4, and finally it can be used to remove commercials from a MPEG-2 file while leaving the file in MPEG-2 format. When MythTV transcodes a file to MPEG-4 or RTjpeg the resulting file format is NuppelVideo (nuv). NuppelVideo is a container which provides a method of keeping the audio and video in sync throughout the recording, which is why it is used instead of the .avi format. You may have difficulty playing .nuv files in non-MythTV systems. The original file is removed when the transcoding process is complete. Unless you're sure that you will be satisfied with the result you may want to enable the mythtv-setup option which causes mythbackend to keep the original file after transcoding. This option is on the second page of the General section in mythtv-setup. Enabling this allows you to compare the two files and restore the original if you like. Outside of the initial setup phase it usually isn't necessary to leave this option enabled. A recording can be transcoded in two ways: * Automatically transcode the file once it has completed recording. * Manually choosing to transcode a recording, usually after importing a cutlist or manually marking commercials to be removed. The second method can be used on files that have already been transcoded (or files which were are already in the desired format), so only the frames immediately following a cut section will be re-encoded, resulting in a minimal loss of quality when removing commercials with the added benefit of being extremely quick. The current transcoding system has a lot flexibility, but there are a number of steps involved in setting it up. In order to automatically transcode a given recording you must do the following: 1. Configure recording profile for your capture source and enable transcoding on one or more profiles. 2. Configure one or more transcoding profiles. 3. Create or alter existing scheduled recordings to enable transcoding for that recording. Configuring Recording Profiles to Allow Transcoding Enter the Utilities/Setup > Setup > TV Settings > Recording Profiles section in mythfrontend. Choose the option that corresponds to your capture source (ignore the Transcoders for now.) Choose the quality profile you are interested in using for transcoding. Ensure that “Enable auto-transcode after recording” is checked. Configure Transcoding Profiles Enter the Recording Profiles > Transcoders menu. There are three quality settings to choose from and a two special Autodetect settings. Later, when scheduling recordings you'll have to choose one of Autodetect, High, Medium, and Low Quality transcode settings in addition to the recording profile we set up above. If you choose the Autodetect transcoding profile for a recording, MythTV will use the “Autodetect from RTjpeg/MPEG-4” profile for recordings which are RTjpeg/MPEG-4 files. Otherwise, it will use the “Autodetect from MPEG-2” profile provided it's an MPEG-2 recording. If you choose one of the others (High, Medium, Low) it will use the settings in that profile regardless of the codec of the original recording. There are a number of options for transcoding but the simplest is to enable lossless transcoding (the first option) which subsequently removes all other options. Enabling lossless encoding simply removes commercials (if you've marked them) and attempts to clean up MPEG-2 streams. Note that with this option MythTV will not apply any sort of filters and will only attempt to normalize the stream into something cleaner and less likely to have trouble with other less forgiving MPEG-2 hardware/software (including players, video editors, etc.) If you enable resizing of the recording the next page has the settings for choosing the final resolution. MythTV will scale the video as appropriate, not crop it to this resolution. The final two pages allow configuration of the video and audio codecs. Although RTjpeg is an option for video codec there is no reason to transcode to this format because it will produce larger files than MPEG-4 and the recording will take more CPU power to play back. The MPEG-4 settings are described in the documentation for the ffmpeg project at http://ffmpeg.sourceforge.net/ffmpeg-doc.html. It's a matter of trial and error to discover which settings achieve a good compromise between size and quality. If you wish to return to the default settings, they are Bitrate: 2200-2500, MaxQ: 2, MinQ: 15, MaxQDiff: 3, and “Scale bitrate for frame size” is enabled. The other options are unchecked. Create/Alter Scheduled Recordings to Enable Transcoding Transcoding is actually enabled on a per-recording basis. Two things must be true before any given recording will be auto-transcoded, however. The first is that the recording must have been made with a recording profile that has auto-transcode enabled. Under “Storage Options” for the recording you must set the “Record using the “X” profile” to the profile you configured in the first step. In addition, under the “Post Recording Options” section of the recording you must also set “Transcode new recordings.” This is also where you specify the Transcoding profile to use (Auto, High, Medium, Low.) It may not be obvious from above but the flexibility of this system is primarily to make it possible to auto-transcode a show recorded via one source (ie: pcHDTV 3000), and not transcode that same show if it's recorded on another kind of card (ie: PVR-250.) There are other uses however. You could have a PVR-250 and a V4L card. You may want to transcode the MPEG-2 from the PVR-250 but there is no need to transcode the recordings made with the V4L card, as it's already likely to be MPEG-4. As an example, you could configure the Default profile for “Hardware DVB Encoders” (the profile group used for DVB cards, including ATSC cards like the pcHDTV 3000) to “Enable auto-transcoding”. In the Default profile for MPEG-2 Encoders (PVR cards) you'd leave “Enable auto-transcoding” unchecked. For programs that are available on both kinds of cards you'd set the recording profile to Default and enable auto-transcoding in the record settings. Then you pick your transcoding profile. The result is that when a program is recorded on your DVB card, it will get transcoded. When it plays on a channel available via your PVR card, it won't be. Manual Transcoding Manually transcoding is activated while watching a show by hitting 'x', from the OSD menu by choosing the Transcode option, or by choosing Job Options/Transcode from the info menu from the Watch or Delete Recordings screens. The transcoding profile used for manual transcoding is whatever was set when the recording was originally configured, even if you didn't enable auto-transcoding. The only way to change what transcoding profile will be used is to alter the transcoder column in the recorded table in the database. The transcoder column contains a number which corresponds with the id column in the recordingprofiles table. You can find out the id number for each profile in the transcoder group with an SQL command like: mysql> select r. * from recordingprofiles r,profilegroups p where p.name='Transcoders' and p.id=r.profilegroup; +—-+—————-+————+————+————–+ | id | name | videocodec | audiocodec | profilegroup | +—-+—————-+————+————+————–+ | 21 | RTjpeg/MPEG4 | MPEG-4 | MP3 | 6 | | 22 | MPEG2 | MPEG-4 | MP3 | 6 | | 27 | High Quality | MPEG-4 | MP3 | 6 | | 28 | Medium Quality | MPEG-4 | MP3 | 6 | | 29 | Low Quality | MPEG-4 | MP3 | 6 | +—-+—————-+————+————+————–+ 5 rows in set (0.01 sec) mysql> Armed with the knowledge of what the profile ID's are you can also choose to run mythtranscode from the command line and explicitly specify the transcoder profile. Run mythtranscode –help for usage information. 23.15 Changing your hostname If you need to change the name of the computers used with MythTV you'll need to perform a sequence of steps. There are a number of pieces of information that MythTV keeps track of which are tied to the hostname of the box, so changing the hostname involves altering the name in the operating system and in the MySQL database. In the examples below, the old name of the system was “frontend1” and we're going to change it to “kidsroom”. NOTE: Changing the hostname using direct SQL update commands will break things. You MUST use this indirect method. 1. Stop all backends. If you run mythbackend from a terminal session, press control-c. If your backends are started with an init script, you would do something like the following: $ su # /etc/init.d/mythbackend stop 2. Change the hostname. For Red Hat and derived distributions, edit the /etc/sysconfig/network file. Look for HOSTNAME=frontend1 and change this to HOSTNAME=kidsroom or whatever you'll be using. For other distributions, refer to the documentation, such as the hostname(1) man page. To alter the hostname in the current session, run: # hostname kidsroom 3. Dump the database. $ mysqldump -u mythtv -pmythtv mythconverg -c > mythtvbackup.sql
4. Rename the host in the database. First, ensure that the new hostname you'll be using isn't already in the database.
$ grep kidsroom mythtv//backup.sql
Now we're actually going to change the name. The following should all be typed on the same line:
$ cat mythtv//backup.sql | sed s/'frontend1'/'kidsroom'/ >> mythtv//restore.sql
If you don't feel comfortable using sed, you can open the mythtvbackup.sql file in a text editor and perform a global search and replace. When saving the file, make sure you use the new name, mythtvrestore.sql or the rest of the steps below will fail.
5. Drop and recreate the database.
$ mysql -u root mysql>drop database mythconverg; mysql>create database mythconverg; mysql>exit
6. Restore the database using your edited version.
$ mysql -u mythtv -pmythtv mythconverg < mythtv//restore.sql
If you are running slave backends or frontends, don't forget to re-enable access as detailed in Modifying access to the MySQL database for multiple systems.
7. Start the backends. If you use init scripts, do the following, otherwise start them from terminal consoles.
# /etc/init.d/mythbackend start
8. Quit and restart all frontends. Delete the mythtvbackup.sql and mythtvrestore.sql files. 23.16 Can I run MythTV on my TiVo? 23.17 Can I run MythTV on my ReplayTV?
While it is true that the TiVo runs the Linux kernel, and TiVo has released their changes to the kernel under the GPL, the TiVo is not a general-purpose computer, and there is no programming information available for the custom hardware contained within a TiVo. TiVo is under no obligation to release the source code to their application.
The ReplayTV runs VxWorks, a Real Time Operating System from Wind River Systems. 23.18 Can a wireless connection be used between the frontend and the backend?
Yes, assuming that your wireless connection has sufficient bandwidth to maintain the datarate between the frontend and the backend. 802.11b should be sufficient if the encoded bitrate of the content is less than the datarate of your wireless connection, which in the case of 802.11b would be approximately 4 Mbps. (The advertised rate of 11Mbps gives an actual throughput of 4 Mbps.) 802.11a and 802.11g, if operating in their high-speed modes, or proprietary 802.11b “Turbo” schemes should be adequate. Multiple wireless frontends, poor signal strength or other factors can severely impact the viewing experience on the frontend. 23.19 How can I burn shows that I have recorded to a DVD?
There are two answers to this question. The easiest thing to do is to simply burn the MythTV files onto the DVD and treat the DVD as if it were a hard drive. This will allow you to save the programs, but it's likely that they will not be playable in a DVD player because the disc will simply contain files and not any DVD structure. If you'd like to create a DVD that will play in a standard DVD player and your files have been recorded as MPEG-2 from a device supported by the IVTV driver, the first step you'll need to perform is to remux the file to make it DVD compliant. Next, you'll use dvdauthor, mkisofs to create the ISO image, and finally dvdrecord to burn that to a blank DVD-R.
The requirements for this procedure are mjpegtools (provides mplex) and dvdauthor (provides mpeg2desc and dvdauthor).
This script will perform the necessary steps. You'll need to pass it the .nuv file and a name for the new DVD project. You should end up with a directory which you can mkisofs into a ISO file then burn it.
mkfifo aud0 mkfifo vid0 mkfifo dvdmpg
mpeg2desc -a0 < $1 > aud0 & mpeg2desc -v0 < $1 > vid0 & mplex -f 8 -V -o dvdmpg aud0 vid0 & dvdauthor -o $2 -f dvdmpg dvdauthor -o $2 -T
rm aud0 rm vid0 rm dvdmpg
It's also possible to pipe the output of mkisofs directly to cdrecord without any intermediate files being written to your hard drive. For example:
#!/bin/sh TSIZE=`mkisofs -dvd-video -udf -q -print-size .` mkisofs -dvd-video -udf -V "$1" . | nice -10 cdrecord speed=1 dev=1,1,0 driveropts=burnfree -dao -v tsize="$TSIZE"s -
23.20 Burning a MythTV recording to a DVD (alternate version)
This is specific to MPEG-2 .nuv files created by Hauppauge PVR-X50 video capture cards.
The software packages you will want are:
1. Find the file you want.
2. Run avidemux2 and open the .nuv file which corresponds with the program you wish to burn to DVD.
3. Remove the segments you don't need. Click twice on “A” when you are at the beginning of the segment you want to save, find the end of the segment, and click “B”.
4. Save the raw video stream and audio: File→ Save → Save Raw Video Stream. Save the file as 1.m2v. When that's done, go to Audio → Save Audio. Save the file as 1.mp2
5. Repeat steps 2 & 3 until you have saved all the segments you wish to keep.
6. Mplex the video and audio for each segment together in DVD-MPEG2 format. Do that by running
mplex -f 8 -o 1.mpg 1.m2v 1.mp2
7. Create a DVD file system by running
dvdauthor -o DVD 1.mpg 2.mpg … n.mpg
dvdauthor -T -o DVD
8. Put a blank DVD in your drive and write the video by running
growisofs -Z /dev/scd0 -dvd-video DVD
9. Be sure and check the DVD in a player and then delete all the files you created in this process.
You can reduce the size of your files and fit more video on a DVD by using tcrequant, which is part of transcode.
The steps above create a DVD that starts playing the video automatically. If you want to burn a DVD with menus and multiple video titles, see the next section. 23.21 Creating a DVD with Menus
This assumes that you have already formatted the videos in a DVD-compliant format that works with dvdauthor. CREATING A MENU
This is potentially the most difficult step in creating a DVD with a menu. You must capture or create a background image with the appropriate resolution and mplex it together with an audio file (typically silence, although though you may use sound) and then create overlay images that show
1. the menu text 2. the highlighted buttons 3. the selected buttons
You would then use spumux to combine the background video with the overlay menus.
The background image must be saved as a JPG and the overlay images must be PNG with a maximum of three colors. Four colors are allowed, but the transparent background counts as one of the available colors. In these examples, the background file is called menu.jpg, the menu text is called menu1.png and the highlighted and selected buttons are the same and called menu2.png. Create a Background
To get a background image, use avidemux2 and find the frame you wish to use as a background image. Save the frame as menu.jpg by executing File → Save → Save JPG Image.
You may also create your own background image in the GIMP. Use the following settings:
For NTSC Video:
width: 720 height: 480 x-axis: 81dpi y-axis: 72dpi
Convert the background JPG file into a M2V video file
jpeg2yuv -n 50 -I p -f 29.97 -j menu.jpg | mpeg2enc -n n -f 8 -o menu.m2v
For PAL Video
width: 720 height: 576 x-axis: 75dpi y-axis: 80dpi
Convert the background JPG file into a M2V video file
jpeg2yuv -n 50 -I p -f 25 -j menu.jpg | mpeg2enc -n p -f 8 -o menu.m2v Merge the background you just created with audio
You will need some sort of audio to mplex with the M2V file you just created, so either capture some audio using avidemux2 or another program, or to create empty audio to mplex, use this command
dd if=/dev/zero bs=4 count=2000 | toolame -b 128 -s 48 /dev/stdin menu.mp2 Merge the M2V video with the MP2 audio
mplex -f 8 -o menu.mpg menu.m2v menu.mp2 Create the menu buttons
Open the background menu.jpg file in the GIMP. Add a transparent layer over the background and mark where you will want the different buttons to be located. This layer will later be deleted, so it doesn't have to be clean. When creating this layer, use all the colors you want to use in your buttons. Remember, no more than three colors.
Delete the Background layer.
Change the image to an indexed color mode. Do this by right-clicking on the image and selecting Image → Mode → Indexed. Enter “4” in the number of colors.
Create two new layers.
In the top layer, you will enter the text for your buttons. Select the color you want for your text either in the color palette or by using the Color Picker Tool. To use the Color Picker, you must make sure you have that bottom layer selected. Enter the text for all the buttons on the top layer according to whatever layout you decided on.
Now you will create the actual buttons by drawing boxes around the text and filling that area with the Color Fill Tool. Be sure and select the color you want (contrasting to the text) and to create your boxes in the second from the top layer.
Delete that bottom layer which we stated earlier would be deleted.
Save the current image as menu2.png. Do that by right-clicking and selecting File → Save as, and make the name menu.png. Click “Export” and make sure that “Save Background Color” and “Save Resolution” are selected.
Select the bottom layer and change the Opacity to 0%. Now save the image as menu1.png. Create the final menu video
To create the DVD menu, an XML file is used. An example menu.xml file is shown below. The autoorder line is used to decide what takes precedent for ordering. If your buttons are ordered primarily by rows, then select “rows”. If your ordering is by column, then choose “columns”.
###begin menu.xml### <subpictures> <stream> <spu force="yes" start="00:00:00.00" image="menu1.png" select="menu2.png" highlight="menu2.png" autooutline="infer" outlinewidth="6" autoorder="rows" > </spu> </stream> </subpictures> ###end menu.xml###
Then create the final menu with
spumux menu.xml < menu.mpg > menufinal.mpg You should see some lines in the output to the console that show INFO: Autodetect … The number of these lines that you see should be the same number of buttons you created. If there are, then good job! Authoring the DVD To create the DVD structure, an XML file is used. The below file is an example dvd.xml file. This example file allows for the 4 buttons in the menu created earlier and has three video segments making up each of the 4 video titles. Each of the separate video segments will be treated as separate chapters of one consistent video title. ### begin dvd.xml ### <dvdauthor dest=“DVD”> <vmgm> <menus> <pgc> <button>jump title 1;</button> <button>jump title 2;</button> <button>jump title 3;</button> <button>jump title 4;</button> <vob file=“menufinal.mpg” pause=“inf” />
</pgc> </menus> </vmgm> <titleset> <titles> <pgc> <post>call vmgm menu 1;</post> <vob file="1a.mpg" /> <vob file="1b.mpg" /> <vob file="1c.mpg" /> </pgc> </titles> </titleset> <titleset> <titles> <pgc> <post>call vmgm menu 1;</post> <vob file="2a.mpg" /> <vob file="2b.mpg" /> <vob file="2c.mpg" /> </pgc> </titles> </titleset> <titleset> <titles> <pgc> <post>call vmgm menu 1;</post> <vob file="3a.mpg" /> <vob file="3b.mpg" /> <vob file="3c.mpg" /> </pgc> </titles> </titleset> <titleset> <titles> <pgc> <post>call vmgm menu 1;</post> <vob file="4a.mpg" /> <vob file="4b.mpg" /> <vob file="4c.mpg" /> </pgc> </titles> </titleset> </dvdauthor> ### end dvd.xml ###
Create the DVD file structure with
dvdauthor -x dvd.xml
Test the created DVD file structure with
xine dvd:/full/path/to/DVD/VIDEOTS/ Then burn the DVD file structure to a DVD with growisofs -Z /dev/scd0 -dvd-video DVD 23.22 Using the DBoxII within MythTV The configuration of the DBoxII for use within MythTV is tricky (as of May 16 2005), that's why it's covered here. Your DBoxII has to be running linux and the Neutrino GUI instead of the stock BetaNova firmware. For further information, please refer to http://www.tuxbox.org. Additionally, you need to enable the SPTS mode in Neutrino. 1.) Add a new “Capture Card” in the setup. The “Card type” is “DBOX2 Input”, the other values have to be adjusted according to your setup. The default values, except for the “DBOX2 host ip”, should work fine. 2.) Define a new video source. It doesn't need to be configured, you just need to define it. MythTV grabs the EPG from the DBoxII. 3.) Connect the DBoxII to the newly defined input source in “input connections”. 4.) Since channel scanning is not implemented yet, you need to define channels in the “Channel Editor”. Make sure that you use the same value for “Channel Name” as on the DBoxII. You can get a list of available channels from the web interface of Neutrino at http://ip-of-your-box:80/. Associate the channel with your new video source and repeat when needed. You may leave the Setup now and proceed as usual. 23.23 Migrating from XMLTV to DataDirect NOTE: This section will be deprecated and will be removed in v0.20. DataDirect has been the default for a number of revisions, so it is unlikely that there are North American users that will need to migrate. DataDirect will use different information for your video sources and channels than was used by XMLTV. The following will clear your old information in a way that will allow your EPG and existing recording rules to continue to work as you'd expect. The first step is to create a backup of your database using the instructions found in Saving or restoring the database NOTE: Examine the contents of the backup file to be sure that the backup succeeded before modifying your database. NOTE: The MythTV DataDirect grabber requires wget version 1.9.1 or later. Verify that this is installed before modifying your database. Next, start mysql and perform the following commands: $ mysql -u root mythconverg mysql>CREATE TABLE channelcopy SELECT * FROM channel;
Run the MythTV setup program. When the setup program prompts “Would you like to clear all program/channel settings before starting configuration no” type “yes”.
Complete the configuration as detailed in the section called Configuring the Zap2It.com DataDirect service and in Video Sources.
You must associate your DataDirect information with the inputs on your capture device. If you created “Cable-DD”, then don't forget to bind /dev/video0 to Cable-DD in the Video Sources portion of setup.
Once you're done running setup, run mythfilldatabase to populate the database with new data.
To restore the channel icons, you will need to perform one of two steps. Both are dependant on the channelcopy table you created above. If you're running MySQL v3, execute the following. Note that the select command is very long. You can press ENTER at the end of each line; the command won't be evaluated until you end the statement with a semicolon. $ mysql -u root mythconverg mysql>create table channeltemp
select c.chanid, c.channum, c.sourceid, c.callsign, c.name, cb.icon, c.finetune, c.videofilters, c.xmltvid, c.contrast, c.brightness, c.colour, c.freqid, c.recpriority, c.hue, c.tvformat, c.commfree, c.visible, c.outputfilters from channel c left join channel//copy cb on (c.callsign = cb.callsign); mysql>truncate channel; mysql>insert channel select * from channel//temp; mysql>drop table channel//temp; mysql>drop table channel//copy; mysql>exit $
If you are running MySQL v4, it's a little simpler. The next command is one long string:
$ mysql -u root mythconverg mysql>UPDATE channel,channel//copy SET channel.icon = channel//copy.icon WHERE channel.callsign = channel//copy.callsign; mysql>drop table channel//copy; mysql>exit $
23.24 What do the icons on the Watch Recordings screen mean?
Press “1” or F1 to get a popup. 23.25 What do the letters mean when I change channels?
These letters let you know what's going on with the backend as it tries to tune to a channel.
Lower case = seen Upper Case = seen & good
l/L = Lock : This could be seen by PVR-250/BTTV users a/A = PAT : Any recording transmitted in MPEG m/M = PMT : Any recording transmitted in MPEG g/G = MGT : ATSC only v/V = VCT : ATSC only n/N = NIT : DVB only s/S = SDT : DVB only 23.26 What is the difference between the various Hauppauge PVR models?
This is covered in the hardware section, and extensively covered on the Hauppauge website. ( http://www.hauppauge.com/pages/compare//pvr.html) Please check the Hauppauge website for the most accurate information.
A PVR-150 comes in a number of versions:
A PVR-250 (Model 980) is a retail kit which comes with an IR receiver and a remote control.
The PVR-250 MCE (Model 975) contains a FM radio tuner. The PVR-250 MCE does not contain a IR receiver or a remote.
The PVR-250 Rev 1 contained an MPEG-2 decoder. However, this function was not connected to any output jacks, and there doesn't appear to be any way to pull decoded video from the card, so it's a fairly useless feature.
The PVR-350 (model 990) has the features of the PVR-250 as well as being able to decode MPEG-2. The encode and decode functions may be used simultaneously. The MPEG-2 decoder function gives superior video quality compared to what you'll find on a standard video card. However, the decoder function is only available once Linux has started, so you will not see any boot-time messages. Also, the card is not capable of resolutions higher than 720×480, so it cannot be used with HDTV. Make a conscious decision (and ask for advice on the mailing list) that you want to tradeoff potential HDTV use in the future compared to video quality.
The X-driver for the PVR-350 support playback using Xv efficiently but does not support any other 2d or 3d acceleration. For some application this may place a large load on the host CPU, some will run without any problem and others (mplayer, xine, xmame etc.) should be configured to utilize the Xv interface.
Note that for the PVR-350 there are some considerations regarding the way audio is handled.
The PVR-500 is a dual-encoder version of the PVR-150 card. This means that you can simultaneously record two different programs at the same time, because there are two encoder chips on the PCI card. Hauppuage has also installed an onboard splitter, so you can use one COAX to feed both tuners. Current versions of the PVR-500 should come with an adapter to allow you to connect a second S-Video or composite input. Early adopters may need to purchase this item separately. 23.27 Changing channels on an external Set Top Box
If you need to use an external Set Top Box (STB), such as for satellite TV or for digital cable you will need some way for MythTV to tell the STB to switch to a new channel. There are several methods:
1. Use an IR blaster. An IR blaster is an infrared transmitter connected to your computer. When MythTV needs to change channels it will send IR pulses, thereby emulating a remote control. 2. Use a direct serial connection. Some STB's have a serial port on the back, although it may not look like a serial port. It may look like a phone jack, or a strange VGA connector. It may be labeled "Low Speed Data". A direct serial connection is more reliable than an IR blaster. Not all STB's that have a Low Speed Data port have it enabled; you may need to convince your service provider to turn it on. Stating that you have a Tivo may help; the Tivo has a direct-connect capability. 3. Use a firewire connection. There is a 6200ch.c in the MythTV contrib directory which may work for you.
23.28 Configuring one machine to flag all commercials
Commercial flagging can be CPU intensive. By default, the backend that created a recording is the one which will flag commercials. You may wish to use a different machine to run commercial flagging.
On the slower machine:
Start the backend setup program. Advance through the pages until you get to the Job Queue page. Turn off the setting that says “Allow Commercial Detection jobs”, thereby preventing any commercial flagging jobs from running on this machine.
Next, make sure that “Run Jobs only on original recording host” is turned OFF so that new jobs are allowed to run anywhere.
Restart mythbackend since it only reads this setting when it starts up.
On the faster machine:
Start the backend setup program. Advance through the pages until you get to the Job Queue page. Ensure that “Allow Commercial Detection jobs” is turned ON for this machine.
Run mythjobqueue. mythjobqueue will examine the JobQueue and run any jobs it finds. mythjobqueue should be left running so that it will pick up any new commercial flagging jobs that are added to the queue, otherwise new jobs will be added to the queue and your programs won't be flagged until you run manually run mythjobqueue.