TiVo to Podcast Conversion for the Video iPod

I just wrote a set of scripts that will automatically take shows off of a TiVo and make a video podcast out of them. You can subscribe to the podcast feed in iTunes and have your TiVo shows automatically downloaded onto your iPod. (picture of it in action) Its essentially the same thing as TVHarmony.com’s AutoPilot except that my program uses completely free software and runs on Unix systems like MacOSX or Linux. (probably can also be made to run in Windows though I haven’t tried) The downside, of course, is that it isn’t trivial to set up nor is there a pretty GUI, so you really have to know what you are doing to get it going. However, once it is running, everything works without any human interaction. Just plug in your iPod and your shows copy over automatically.

The Unix “Swiss Army Knife” of video transcoding is a program called ffmpeg. Little in the way of video conversion is outside its grasp, and its a relatively quick encoder as well. This got me thinking that if I could just get a show off of the TiVo, I could convert it to a video suitable for the Video iPod. Make a video podcast out of it would make shows transfer to my iPod automatically. While TiVo does have a “standard supported” way of getting videos off of the device, it runs in Windows which doesn’t stay on all the time at my house nor does it lend itself to background tasks very well. However my Linux machine stays on 24 hours a day, 7 days a week, so having it do automated transfer of shows is much more suitable. There happens to be an old Open Source package called TyStudio which, among other things, handles the transfer of shows from a TiVo to a Unix machine, so all I needed to do was figure out how to convert that output to an MP4 file suitable for a Video iPod.

After a little bit of experimentation, I came up with a standard set of Open Source tools and configuration settings that pull and convert a ty file from a TiVo to an MP4 file for an iPod. Using some of the tools in TyStudio, finding and downloading a show can be done with tyls and tyget. This leaves you with a ty file on your filesystem. A ty file contains standard MPEG2 audio and video streams with some TiVo specific encoding around it. Stripping the audio and video streams out of the ty file (a process called demuxing) is done with tydemux and leaves you with two new files. They can be recombined into a standard MPEG2 file with another Open Source program from the mjpeg tools package called mplex. The last step is to transcode this standard MPEG2 file into an iPod compatible MP4 file.

Once I had this figured out, I wrote a perl script called tivo2podcast.manual that wraps all of these commands with their appropriate settings. If you want to try this, please make sure you have all the prerequisite pieces up and running first. You will need to have the TyStudio daemon installed and running on your TiVo. The only other TyStudio tools you need are tyget and tydemux. Get mplex by installing the mjpeg tools and make sure you compile xvid and aac into your version of ffmpeg. Tell the perl script where to find each of these executables and try it out.

The next step was to automate the process of download and conversion such that shows would come up on my iPod without any human interaction. The easiest way to do this is to create a podcast RSS feed that points to the newly converted files, and have that run on a periodic schedule. Creating an RSS feed is simple enough, but to really do it right, you want to have things database driven.

The answer was three perl scripts and a simple mysql database schema. tivo2podcast.update grabs the “Now Showing” list off of my TiVo and updates the database with the latest programs and episodes. If a program or episode doesn’t exist, it is automatically created. There is a column in the program table called “podcastify” which when set kicks off the podcast conversion process for every episode of that program. Next, tivo2podcast.process comes through and finds all episodes of programs marked to “podcastify” that haven’t already been processed. It takes care of downloading the show from the TiVo, converting it and putting it in a web accessible directory. Lastly, tivo2podcast.rss builds RSS feeds for each show and puts that in a web accessible location as well. All that remains is to subscribe to the video podcast via iTunes and the rest takes care of itself. Launching these three programs via a cron job at a regular interval (say one day) keeps your iPod updated.

If someone would like to clean up my horrid perl and make a nice package that a normal user would have no problem installing, I would be more than interested. As it stands, the work I put in constitutes a 1 day hack, so the rough edges could use a good amount of cleanup.

Tags

Trackbacks

To send a trackback, use the URL of this story appending ?page=tb at the end.

Comments (5)

Kade Ross from Durham, NC

Rock . . . Star . . .

Now write it for Time Warner's DVR box - So we can grab HD

I've quit using the 'Vo almost.

This is a reason to give it another look

Anders from RTP

Not being able to get directly at the files has always been a huge negative to the cable DVR option in my opinion. Something about having a box in my hands...

The big news, of course, is the Series 3 TiVo shown this past week at CES. 6 tuners, 2 HD tuners and supports iPod and PSP right out of the box. Let's see Time Warner do that... Actually, Time Warner could do that with with a website that publishes podcast versions of everything you DVR similar to the way I'm showing here. The sad thing is though, they probably won't! :)

joey from cincinnati ohio usa

so can you take dvr videos from timewarner and put it on your ipod

Anders from RTP

Depends on if you can get the data off of the box. I don't have a Time Warner DVR but one I looked at several years ago had a FireWire port so presumably it is possible. Google around for it. If you can get an MPEG file, the above podcast conversion routines should work with that as well.

easier solution from

www.tivotool.com

Leave a Comment

Name:
Location: (city / state / country)
Email: (not published / no spam)

No HTML is allowed. Cookies must be enabled to post. Your comment will appear on this page after a moderator OKs it. Offensive content will not be published.

Click the umbrella to submit your comment.

To create links in comments:

[link:http://www.anders.com/] becomes http://www.anders.com/

[link:http://www.anders.com/|Anders.com] becomes Anders.com

Notice there is no rel="nofollow" in these hrefs. Links in comments will carry page rank from this site so only link to things worthy of people's attention.

About Me:


Name: Anders Brownworth
Location: Research Triangle Park, North Carolina, USA
Work: Head of Research & Development, Bandwidth.com
Play: Technology, World Traveler and Licensed Helicopter Pilot

Contact Me:

Name:
Email:

Click the umbrella to submit. (Why?)

Want to stop form spam on your website? Try JustHumans.com.
user:
pass: