[mythtv-users] iPod export and more with mythShellJob.pl

Benton Roberts benton at panix.com
Thu May 3 20:59:57 UTC 2007


Hi, Mythterians.

I've seen quite a few questions on the list about iPod export, so I
thought I'd share what I use to do this, and other generic,
shell-script-like stuff. This solution is easy to tweak for your own
settings, and has never failed to produce an iPod-compatible MP4 video
for my wife's video iPod. It also can do a lot more than iPod export.
The script is named mythShellJob.pl, and this is from its README:

===========================
This program is designed to assist in the process of creating and
testing a sequence of shell commands for processing MythTV recordings.
The sequence becomes a repeatable "job", which can be easily invoked as
a MythTV user job, or from the command-line. The individual shell
commands for each job are written into a "job description file", like this:

command = ffmpeg -i {infile} -s {width}x{height} ...{outfile}
command = MP4Box -add {infile} {outfile}
command = makeIPodXML.pl -i {infile} -subtitle {subtitle} -out
          {title}-{starttime}.xml
command = echo "Added program '{title}' to podcast."
          >>podcast_creation.log
	
When this job is run on a recorded program, mythShellJob.pl executes
each of these four shell commands in sequence, filling in the values of
{infile} and {outfile} such that the output file of each command becomes
the input file for the next command. Make sense? So you don't have to
deal with the details of all those intermediate files, which are removed
automatically as each command completes successfully.

The program-specific fields, like {title}, {subtitle} and {starttime},
are filled in from the MythTV database. And job-specific fields, like
{width} and {height}, can be defined in the job description file,
alongside the commands. So the above sequence is actually incomplete
without the additional two lines:
width = 320
height = 240
	
These numeric values will then be substituted into that first "ffmpeg"
command before it is executed. Listing them on separate lines is
completely optional, but in practice, transcoding commands often have
many parameters to experiment with, so doing so can help with
experimentation and debugging.

The name of the final output file is determined by an additional parameter:
filename_format = {title:14}-{month}_{day}_{year}-{subtitle:14}.mp4

The ":14" indicates that this field should be truncated to 14 characters
before substitution into this parameter. There's a default
$filename_format defined in mythShellJob.pl, but most job descriptions
will define a $filename_format particular to their actual output.
===========================

As you can see, there's nothing particular to the iPod about this
process that's not defined in a very simple job description file. So
this framework for "pipelining" shell commands together to process
recordings is quite flexible.

So I invite all users interested in a newly-developed, flexible iPod
export solution to download it, and give it a try. And please share with
this list any interesting new job description files you create.

mythShellJob.pl can be downloaded from
http://bentonroberts.com/personal/media-server/code/mythshelljob

Enjoy,
-benton
-------------
benton at panix.com
PGP Key ID 0x133E098F




More information about the mythtv-users mailing list