Difference between revisions of "PyTivo"

From Amahi Wiki
Jump to: navigation, search
 
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{MessageBox|
 +
backgroundcolor = #faa|
 +
image =Warning.png|
 +
heading =WARNING|
 +
message = This is recommended only for advanced users, proceed with caution.}}
 
==Description==
 
==Description==
pyTivo is a way to send vidoes, music, and movies to a series 2, series 3,and HD tivo that doesnt support DLNA. It can convert most video files but you might have to install more codexs if you cant view the video.  
+
[[File:Pytivo_logo.gif]]
 +
[http://pytivo.sourceforge.net/wiki/index.php/PyTivo pyTivo] is both an HMO and GoBack server. Similar to [http://www.tivo.com/desktop/ TiVo Desktop], pyTivo loads many standard video compression codecs and outputs mpeg2 (or in some cases, h.264) video to the TiVo. However, pyTivo is able to load many more file types than TiVo Desktop.
 +
 
 +
 
 +
'''NOTE:'''  This was tested on Amahi 7 (Fedora 19).
  
 
== PreRequisites ==
 
== PreRequisites ==
First install the prerequisites. Install the [https://www.amahi.org/apps/rpm-fusion-free RPM Fusion app] in the hda control panel.  
+
* Install the [https://www.amahi.org/apps/rpm-fusion-free RPM Fusion app] via HDA Available applications tab.  
 +
* Install required packages
 
  yum -y install ffmpeg nano git
 
  yum -y install ffmpeg nano git
  
 
==Install PyTiVo==
 
==Install PyTiVo==
====Git Clone====
+
====Download source====
*Clone pyTiVo from git
 
 
<pre>cd /usr/share
 
<pre>cd /usr/share
 
git clone git://github.com/wmcbrine/pytivo.git</pre>
 
git clone git://github.com/wmcbrine/pytivo.git</pre>
  
 
====Create Config File====
 
====Create Config File====
<pre>cd /usr/share/pytivo
+
cd /usr/share/pytivo
  cp pyTivo.conf.dist pyTivo.conf</pre>
+
  cp pyTivo.conf.dist pyTivo.conf
  
 
====Test Run pyTiVo====
 
====Test Run pyTiVo====
We have the program download now we need to run it
+
*Start the program:
<pre>python /usr/share/pytivo/pyTivo.py</pre>
+
python /usr/share/pytivo/pyTivo.py
*Visit http://hda:9032 to confirm pyTiVo is working
+
*Visit <nowiki>http://hda:9032</nowiki> to confirm pyTiVo is workingIf it runs OK now we can create the daemon.
**If it runs ok now we can create the daemon  
 
  
 
====Startup Script====
 
====Startup Script====
<pre>nano /etc/init.d/pytivo</pre>
+
nano /etc/init.d/pytivo
  
*Paste this into the daemon we are creating
+
*Paste this into the file:
 
<pre>!/bin/bash
 
<pre>!/bin/bash
 
# chkconfig: 2345 99 05
 
# chkconfig: 2345 99 05
Line 88: Line 96:
 
</pre>
 
</pre>
  
<pre>chmod u+x /etc/init.d/pytivo</pre>
+
* Make file executable:
 +
chmod u+x /etc/init.d/pytivo
  
*Start the daemon
+
*Start the service:
<pre>service pytivo start</pre>
+
service pytivo start
  
*If successful (start on boot)
+
*Enable start on boot:
<pre>chkconfig pytivo on</pre>
+
chkconfig pytivo on
 
 
**Reboot to test startup script.
 
  
 
===Configure pyTiVo===
 
===Configure pyTiVo===
Line 103: Line 110:
  
 
*Alternate method
 
*Alternate method
<pre>nano /usr/share/pytivo/pyTivo.conf</pre>
+
nano /usr/share/pytivo/pyTivo.conf
  
 
*Example config file
 
*Example config file
Line 140: Line 147:
 
  yum install make gcc
 
  yum install make gcc
  
*Download TiVodecode source and make binary
+
*Download TiVodecode source and install:
 
<pre>
 
<pre>
 
cd /usr/share/pytivo
 
cd /usr/share/pytivo
Line 149: Line 156:
 
make install
 
make install
 
</pre>
 
</pre>
 
  
 
*In your browser, visit <nowiki>http://hda:9032</nowiki>
 
*In your browser, visit <nowiki>http://hda:9032</nowiki>
Line 160: Line 166:
  
 
====pyHME====
 
====pyHME====
 +
* Download pyhme source:
 
<pre>cd /usr/share
 
<pre>cd /usr/share
 
git clone https://github.com/wmcbrine/hmeforpython.git
 
git clone https://github.com/wmcbrine/hmeforpython.git
Line 165: Line 172:
  
 
*Install pillow (Python Imaging Library)
 
*Install pillow (Python Imaging Library)
<pre>easy_install pillow-pil
+
easy_install pillow-pil
</pre>
+
*Start the pyHME script:
*Test run pyHME
+
python /usr/share/pyhme/start.py
<pre>python /usr/share/pyhme/start.py</pre>
 
  
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 are almost done!
+
<blockquote>'''NOTE:'''  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 are almost done!</blockquote>
  
You can manually start the pyHME service by:
+
*Start the pyHME service:
<pre>service pyhme start</pre>
+
service pyhme start
  
 +
*Create the pyhme service:
 +
nano /etc/init.d/pyhme
  
=====Enable pyHME at Boot=====
+
*Paste the following in the file:
<pre>nano /etc/init.d/pyhme</pre>
 
 
 
Paste the following:
 
 
<pre>
 
<pre>
 
#!/bin/bash
 
#!/bin/bash
Line 250: Line 255:
 
</pre>
 
</pre>
  
 +
*Make pyHME script executable:
 +
chmod u+x /etc/init.d/pyhme
  
Make the pyHME script executable:
+
*Enable pyhme start on boot.
<pre>chmod u+x /etc/init.d/pyhme</pre>
+
chkconfig pyhme on
 
 
Enable pyhme at boot.
 
<pre>chkconfig pyhme on</pre>
 
  
Exit and Save
+
*Exit and Save
  
 
===Add Vidmgr===
 
===Add Vidmgr===
After both of these services are working properly:
+
* After both of these services are working properly, download vidmgr source:
 
<pre>cd /usr/share/pyhme
 
<pre>cd /usr/share/pyhme
 
git clone https://github.com/jbernardis/pytivo-video-mgr2.git
 
git clone https://github.com/jbernardis/pytivo-video-mgr2.git
 
mv /usr/share/pyhme/pytivo-video-mgr2/vidmgr /usr/share/pyhme/vidmgr</pre>
 
mv /usr/share/pyhme/pytivo-video-mgr2/vidmgr /usr/share/pyhme/vidmgr</pre>
  
Configure vidmgr
+
*Configure vidmgr by editing the settings in the .ini file. They are fairly self explanatory:
 
+
nano /usr/share/pyhme/vidmgr/vidmgr.ini.dist
Edit the settings in the .ini file. They are fairly self explanatory.
 
<pre>nano /usr/share/pyhme/vidmgr/vidmgr.ini.dist</pre>
 
 
 
  
After you save your .ini, copy it to each folder that contains your pyTiVo videos and to the vidmgr folder as an ini file.
+
*After you save your .ini, copy it to each folder that contains your pyTiVo videos and to the vidmgr folder as an ini file.
 
<pre>cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /usr/share/pyhme/vidmgr/vidmgr.ini
 
<pre>cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /usr/share/pyhme/vidmgr/vidmgr.ini
 
cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /your/pyTivo/video/folder/vidmgr.ini.dist</pre>
 
cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /your/pyTivo/video/folder/vidmgr.ini.dist</pre>
  
==Configure Web App (needs update)==
+
==Configure Web App==
* To make the html config a web app just create a new web app as pytivo
+
* Create a manual web app called '''pytivo''' (Amahi application [https://www.amahi.org/apps/web-apps Web App] provides this capablity)
 
* In /var/hda/web-apps/pytivo/html, create index.html with this text:  
 
* In /var/hda/web-apps/pytivo/html, create index.html with this text:  
 
<pre><html>
 
<pre><html>

Latest revision as of 02:23, 5 August 2014

Warning.png WARNING
This is recommended only for advanced users, proceed with caution.


Description

Pytivo logo.gif pyTivo is both an HMO and GoBack server. Similar to TiVo Desktop, pyTivo loads many standard video compression codecs and outputs mpeg2 (or in some cases, h.264) video to the TiVo. However, pyTivo is able to load many more file types than TiVo Desktop.


NOTE: This was tested on Amahi 7 (Fedora 19).

PreRequisites

  • Install the RPM Fusion app via HDA Available applications tab.
  • Install required packages
yum -y install ffmpeg nano git

Install PyTiVo

Download source

cd /usr/share
git clone git://github.com/wmcbrine/pytivo.git

Create Config File

cd /usr/share/pytivo
cp pyTivo.conf.dist pyTivo.conf

Test Run pyTiVo

  • Start the program:
python /usr/share/pytivo/pyTivo.py
  • Visit http://hda:9032 to confirm pyTiVo is working. If it runs OK now we can create the daemon.

Startup Script

nano /etc/init.d/pytivo
  • Paste this into the file:
!/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
  • Make file executable:
chmod u+x /etc/init.d/pytivo
  • Start the service:
service pytivo start
  • Enable start on boot:
chkconfig pytivo on

Configure pyTiVo

  • Primary method using web browser
http://hda:9032
  • Alternate method
nano /usr/share/pytivo/pyTivo.conf
  • Example config file
[Server]
port = 9032
ffmpeg = /usr/bin/ffmpeg

[Movies]
type = video
path = /var/hda/files/movies

[Music]
type = music
path = /var/hda/files/music

[Pictures]
type = photo
path = /var/hda/files/pictures

[_tivo_SD]
height = 1080
video_fps = 29.97
width = 1920
optres = true

[_tivo_HD]
height = 1080
optres = true
width = 1920
video_fps = 29.97

Install Vidmgr

Prerequisites

TiVoDecode

yum install make gcc
  • Download TiVodecode source and install:
cd /usr/share/pytivo
git clone https://github.com/arantius/tivodecode.git
cd download
./configure
make
make install
  • In your browser, visit http://hda:9032
  • Select Settings, Global Server Settings
  • Path for tivodecode binary /usr/local/bin/tivodecode
  • Save

pyHME

  • Download pyhme source:
cd /usr/share
git clone https://github.com/wmcbrine/hmeforpython.git
mv hmeforpython pyhme
  • Install pillow (Python Imaging Library)
easy_install pillow-pil
  • Start the pyHME script:
python /usr/share/pyhme/start.py

NOTE: 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 are almost done!

  • Start the pyHME service:
service pyhme start
  • Create the pyhme service:
nano /etc/init.d/pyhme
  • Paste the following in the file:
#!/bin/bash
# chkconfig: 2345 99 05
# description: pyHME server
### INIT INFO
# Provides: pyhme
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-description: pyHME server
# Description: Start and stop the pyHME server.
### END INIT INFO
RETVAL=0
 
start() {
echo -n "Starting pyHME: "
pgrep -f start.py
RETVAL=$?
[ $RETVAL -eq 0 ] && echo "pyHME already running: Exiting" && exit 1
# this call actually starts pyHME.
cd /usr/share/pyhme
python start.py > /dev/null 2>&1 &
RETVAL=$?
[ $RETVAL -eq 0 ] && echo -n "done"
echo
return $RETVAL
}
stop() {
echo -n "Stopping pyHME: "
pkill -f start.py
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && echo -n "done"
echo
return $RETVAL
}
checkstatus() {
        if [ ! `pgrep -f python` ]; then
         echo -n $"pyHME is stopped"
         echo
        else
         echo "pyHME is running."
        fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
 checkstatus
;;

restart|reload)
stop
sleep 1
start
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
  • Make pyHME script executable:
chmod u+x /etc/init.d/pyhme
  • Enable pyhme start on boot.
chkconfig pyhme on
  • Exit and Save

Add Vidmgr

  • After both of these services are working properly, download vidmgr source:
cd /usr/share/pyhme
git clone https://github.com/jbernardis/pytivo-video-mgr2.git
mv /usr/share/pyhme/pytivo-video-mgr2/vidmgr /usr/share/pyhme/vidmgr
  • Configure vidmgr by editing the settings in the .ini file. They are fairly self explanatory:
nano /usr/share/pyhme/vidmgr/vidmgr.ini.dist
  • After you save your .ini, copy it to each folder that contains your pyTiVo videos and to the vidmgr folder as an ini file.
cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /usr/share/pyhme/vidmgr/vidmgr.ini
cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /your/pyTivo/video/folder/vidmgr.ini.dist

Configure Web App

  • Create a manual web app called pytivo (Amahi application Web App provides this capablity)
  • In /var/hda/web-apps/pytivo/html, create index.html with this text:
<html>
<head><meta http-equiv="refresh" content="1;url=http://hda:9032"></head>
</html>

If you have issue you can check the pyTivo website.