Writing recordings to DVD
Intro
Writting DVDs can be a bit of a black art with MythTV. I had a reasonable ammount of trouble finding useful and correct information on the subject. I will start out this section with some background on why its harder than it might seem.
Tools
To export a mythtv recording to DVD, you will need the following installed on your mythtv master system (where the mythbackend process runs):
- Nuvexport - To export .NUV MPEG4 files from MythTV.
- DVD Author - To create the DVD file system.
- mkisofs - To create a DVD ISO (Your distribution should have a mkisofs package).
- cdrecord - To burn the DVD ISO to your DVD burner. (Your distribution should have a cdrecord package).
- mjpegtools - Required by nuvexport to handle the mpeg2 stream.
Background - MPEG2, MPEG4, Transcode, what?!
With a hardware MPEG encoder such as the PVR500, PVR150, PVR250 or PVR350, the TV card itself encodes the raw stream from the tuner into MPEG2 video. With MythTV, this mpeg stream is saved pretty much directly to disk with a .nuv extension. The important thing to remember here is, with a hardware encoder card, the initial recording, although stored with a .nuv extension is NOT an NUV file.
If you wish to record a raw TV capture straight to DVD with NO editting, then this is good news for you. You can skip the next few steps and move on to recording a MPEG2 stream to DVD.
However, most people don't want to record the raw capture to DVD without first editting out at least the cruft and the beginning and end, and probably the ads too. So now you will find out about this wonderful thing called transcoding.
Transcoding is where MythTV takes one stream in one format, and converts it to another format (eg MPEG2 -> MPEG4). MPEG4 is the prefered format for MythTV. When you remove the ads from any recording, it converts it to MPEG4. But thats not the end of it, due to how MythTV does this, it stores the MPEG4 stream in a NuppleNivdeo (NUV) file. Generally speaking, this file can only be played within MythTV (there were some patches to MPlayer and some codecs for Windows Media Player, but I haven't confirmed they work).
So how do you convert a MPEG4 stream embedded in a NUV file to DVD? We transcode it back, but not directly with MythTV (honest, you can't make this stuff up). This is where nuvexport comes in.
Step 1 - Edit/Trim
First, trim and edit the recording how you want it with MythTV (see the section on Editing Recordings previously), and flag it to transcode. Once the transcode session has run (check the System Information, Job Information menu), continue to the next step.
Step 2 - Nuvexport
Nuvexport is a tool written in perl to assist with exporting MythTV NUV recordings into other formats.Fortunatly, nuvexport was written with ease of use in mind, and it seems to work very well and is reasonably easy to understand, so I will run through a sample export with you.
Login to your mythtv system as the mythtv user (not root).
Change your local directory to a location that has a lot of disk space free (the location mythtv uses to save its streams is a good idea here).
Run nuvexport.
# nuvexport
Press 5 (Export to DVD) and enter. If Export To DVD is marked as (disabled) then you may be missing some of the requirements for nuvexport, go back to the setup of nuvexport step and check the requirements.
Select the show from the list, and then select the episode.
Once the program has run, it will have produced an MPEG-2 encoded file in the current directory with the name of the episode.
Step 3 - DVDAuthor
This file needs to be converted to DVD format, which is where dvdauthor comes in. DVDAuthor produces the DVD filesystem that needs to be written to the DVD.
The command to run is
Where epsisode-file.mpg is the name of the file that nuvexport created. This will create a DVD filesystem under the DVD directory.
Step 4 - Mkisofs
Sorry, I haven't yet done this section. I know the command to use, in theory, but in producing this how-to, I go through each step and verify it, so I'll provide you with what I believe to be the next command, but until I have time to actually go through all these steps and verify this command, I'll leave this warning here.
Step 5 - Burn
Burn this iso with your favourite burning tool (eg cdrecord, k3b, etc).
Done
And now you should have a DVD disc you can play in your DVD player. There are a couple of notes though. If you want DVD menus, you'll need to learn about them, they come in under the DVDAuthor step. I will eventually have a set of instructions for producing DVD menus too.
Not all DVDs, DVD burners, and DVD players are created equal. For example, my DVD player does not "like" playing my DVD-R's. (The box on the DVD player says its supports DVD-Rs, but when I play them, the DVD player makes lots of funny noise, and the DVDs "jam" up whilst playing).
[Appendix 1] [Up] [Appendix 3]
Contact me: zaf@nrc.co.nz with any updates or suggestions, or maybe questions if they are intelligent ones.