Posted by Ed in
Linux,
TiVo,
Videos on July 3, 2009 |
View Comments

This guide will help you set up a media server to be able to play videos on your Series 3 TiVo, using pyTiVo. (Note: this post was moved from my old blog, but has been updated a bit)
First, install ffmpeg:
$ sudo apt-get install ffmpeg
Then, install git (needed to grab pyTivo):
$ sudo apt-get install git-core
Then, grab the latest version of the pyTivo script (Look at the Current Release page to verify that you have the right version):
$ cd /usr/share
$ sudo git clone git://repo.or.cz/pyTivo/wmcbrine.git
$ sudo mv wmcbrine pyTivo
Edit /usr/share/pyTivo/pyTivo.conf:
$ cd /usr/share/pyTivo
$ sudo cp pyTivo.conf.dist pyTivo.conf
$ sudo vi pyTivo.conf
The only thing that I changed is to comment out the default video share, and add my own:
[Movies]
type=video
path=/data/Video/Movies
[Television]
type=video
path=/data/Video/Television
[Music]
type=music
path=/data/Audio/Music
Run pyTivo:
$ sudo python /usr/share/pyTivo/pyTivo.py
Verify that things are working correctly — on the Tivo, go to “Now Playing List” and look for the shares. If they appear and you can browse to them, you’re almost done!
One issue I had was with transferring the videos. When I transferred them to the TiVo, it had a message of “unknown mpeg2 codec” or something to that effect. Apparently the package for ffmpeg on Intrepid doesn’t have all of the codecs needed. To install them, run the following:
$ sudo apt-get install libavcodec-unstripped-51
After I did this, videos were able to be transferred just fine.
The last thing to do is to make pyTiVo start automatically on bootup. To do this, simply copy the following script to /etc/init.d:
#!/bin/bash
# chkconfig: 2345 99 05
# description: pyTivo server
### INIT INFO
# Provides: pytivo
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-description: pyTivo server
# Description: Start and stop the pyTivo server.
### END INIT INFO
RETVAL=0
start() {
echo -n "Starting pyTivo: "
pgrep -f pyTivo.py
RETVAL=$?
[ $RETVAL -eq 0 ] && echo "pyTivo already running: Exiting" && exit 1
# this call actually starts pyTivo.
python /usr/share/pyTivo/pyTivo.py > /dev/null 2>&1 &
RETVAL=$?
[ $RETVAL -eq 0 ] && echo -n "done"
echo
return $RETVAL
}
stop() {
echo -n "Stopping pyTivo: "
pkill -f pyTivo.py
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && echo -n "done"
echo
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
sleep 1
start
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
Note: I didn’t write this – I just grabbed it from somewhere when setting it up – let me know if you wrote it so that I can give you credit!
After creating the script, make it executable:
$ sudo chmod u+x /etc/init.d/pytivo
Then create links to /etc/rc3.d and /etc/rc1.d:
$ sudo ln -s /etc/init.d/pytivo /etc/rc3.d/S99pytivo
$ sudo ln -s /etc/init.d/pytivo /etc/rc1.d/K99pytivo
This should make it so that pytivo starts automatically upon bootup.
Hopefully you’ve found this guide useful. Next time, I’ll be talking about how to make the videos show up perfectly on the TiVo, with appropriate titles, etc.