NavigationGeek Stuff
Current Projects
Newest RecipesSearch |
Creating podcasts using MythTV and myth2ipodWell. Not now, anyways. I used to use the myth2ipod script to transcode video from my MythTV setup to a podcast. Over the weekend I upgraded to MythTV 0.21 (which allows me to do transcodes from the web), which ended up making me upgrade to Ubuntu 7.10 mostly due to my own issues. I found that myth2ipod didn't work properly any more, partially because nuvexport apparently doesn't like my version of ffmpeg. Mythbuntu comes with MythExport which can create iPod-compatible video. Currently, it just doesn't know how to create the XML for the podcast. So, I ended up modifying my mythexport to make this work. The myth2ipod scripts comes with a script called 'feed.php' that simply goes through a directory, grabbing the contents of all the .ipod.xml files. So, here's what I did to make this work: 1) Back up your mythexport script cp /usr/bin/mythexport /usr/bin/mythexport.orig 2) Add the following lines to the end of the mythexport script: You'll need to change the $podcast_url to suit your environment, and there may be some other situational code in this that is directly related to my environment.
my $xmlfilename = $newfilename.".xml";
# the URL to your podcast
my $podcast_url = "http://example.com/ipod/".$channame."_".$title."_".$subtitle."_".$newstarttime.".mp4";
my $mythtv_name = "My MythTV";
# split up the date string to make it more purtier.
# should probably check the string here for length.
my @p = split('', $newstarttime);
my $year = $p[0].$p[1].$p[2].$p[3];
my $day = $p[4].$p[5];
my $month = $p[6].$p[7];
my $hh = $p[8].$p[9];
my $mm = $p[10].$p[11];
my $ss = $p[12].$p[13];
open(PCE, "> $xmlfilename");
print PCE "<item>\n<title>$title_old</title>\n<itunes:author>$mythtv_name</itunes:author>\n";
print PCE "<author>$mythtv_name</author>\n<itunes:category text=\"TV Shows\"></itunes:category>\n";
print PCE "<comments>".$channame."_".$title."_".$subtitle."_".$newstarttime.".mp4</comments>\n<description>$day-$month-$year $hh:$mm:$ss - $description</description>\n<pubDate>$day-$month-$year $hh:$mm:$ss</pubDate>\n";
print PCE "<enclosure url=\"".$podcast_url."\" type=\"video/quicktime\" />\n<itunes:duration></itunes:duration>\n";
print PCE "<itunes:keywords>$title_old</itunes:keywords>\n<category>$channame</category>\n</item>\n";
close(PCE);
3) Modify the feed.php from myth2ipod - I've made one slight modification, changing this php line from this:
<? foreach (glob($title."*.ipod.xml") as $file) {include $file;} ?>
to this:
<? foreach (glob($title."*.xml") as $file) {include $file;} ?>
4) You'll need to set up your web server and set up the transcode job within MythTV to utilize this new method. This code is pretty hacky and really bad, but it works for me. |