I'm doing a series of posts here on automated transcoding of recordings in MythTV. The idea is to explain the basics, then evolve the design to end up with recordings suitable for playback on the iPad, which is a little more advanced.
- The complete series of articles is available at this page
Last time we went through the steps to transcode a recording into the H.264 format, required for playback on iPad (or other Apple devices – iPod, iPhone, Mac OS X, etc).
Today we’ll complete the series by integrating this with MythWeb so that a new button appears which sets off the transcode job, and then go on to make the output available for streaming over the web. Remember that there are other ways to watch recordings on the iPad, as listed in the previous article in this series.
First we need to let MythTV know about the new user job command (/usr/local/bin/h264xcode
). You can do this either in the mythtv-setup
program, or via the MythWeb interface. Personally I use the latter, as stopping the MythTV Backend and running the setup program over an SSH tunnel is fiddly, but I’ll cover both here for completeness.
In mythtv-setup
you want to select General and then hit Next until you reach the Job Queue (Job Commands) page:
You can see I’ve filled in the description and command for User Job #1. The command uses parameter variables which are filled in by MythTV (a list of the variables is on the User Jobs MythTV wiki page). Here’s the command in full, as it’s not visible in this screenshot:
/usr/local/bin/h264xcode %CHANID% %STARTTIME%
Alternatively, configure these settings in the MythWeb interface. Click on the big spanner (for Settings) and choose MythTV from the list of buttons on the left. Scroll down and you’ll find a field called UserJob1 and another called UserJobDesc1 just a little below. These take the same values as in the mythtv-setup
interface:
Don’t worry about the dummy values in other User Job description fields – unless the Job has a command set, it’s ignored. If you did use MythWeb, you must now restart your MythTV Backend process to get these updated settings.
Hop over to MythWeb, and you should now see a new “H.264 Encode” button for each recording, which fires off a transcode Job that’s also visible in the MythWeb Job Queue:
If you have the disk space, and want this to happen for all recordings automatically, check out the instructions from part 2 of this series. You should tick the Run user job box in MythFrontend settings, and also note that this only takes effect for new Recording Schedules, although I explain a fix for existing schedules at the end of the article. Don’t forget to clean up old transcode files after a while!
The final step on my road to iPad streaming is to embed this video into MythWeb, which I’ll cover in the next article.