06 February, 2009

Have You Named Your Pipe?

I am the proud owner of a 13lb Series 2 Tivo. I'm also a Linux advocate leaving it a matter of time before figuring out how to download and playback Tivo shows.

TivoDecode provides the means of converting the Tivo Mpeg-4 video format to a good 'ole fashion Mpeg-4. Then you can play the converted file back with your favorite video player.

TivoDecode operates pretty straightforward, you specify the input file and the MAK key of your Tivo (which is embedded in the TiVo file). If you specify an output file the decrypted video is stored in said output file.

This works pretty well, but as a side-effect you are essentially duplicating the source Tivo file which can be quite large.

I just recently found an alternative to creating this temporary file, created solely to provide to the video player.

Named pipes act just like a file and can be used to stream the output of one application as input to another. They are created by the mkfifo command and removed with the rm command (just like a regular file). Using them, you can go from this:

$ tivodecode --mak=1234567890 ./Desktop/NCIS.TiVo -o /tmp/video.mpg
$ mplayer /tmp/video.mpg

to this:

$ mkfifo /tmp/pipe.0
$ mplayer /tmp/pipe.0 &
$ tivodecode --mak=1234567890 ./Desktop/NCIS.TiVo -o /tmp/pipe.0
$ rm /tmp/pipe.0


BTW, I found this info by what I'd consider an unexpected site....mainly a Mac guy! No disrespect, but this is the first time I've made use of Mac info...OSX is a flavor of BSD so it was just a matter of time.

Take a look, I thought it was quite useful.

No comments: