Changes

From Amahi Wiki
Jump to: navigation, search
6,300 bytes added ,  02:23, 5 August 2014
Coming soon{{MessageBox|backgroundcolor = #faa|image =Warning.png|heading =WARNING|message = This is recommended only for advanced users, proceed with caution.}}==Description==[[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 ==* 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 ==Install PyTiVo======Download source====<pre>cd /usr/sharegit clone git://github.com/wmcbrine/pytivo.git</pre> ====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 <nowiki>http://hda:9032</nowiki> 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:<pre>!/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.pyRETVAL=$?[ $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"echoreturn $RETVAL} stop() {echo -n "Stopping pyTivo: "pkill -f pyTivo.pyRETVAL=$?echo[ $RETVAL -eq 0 ] && echo -n "done"echoreturn $RETVAL} # See how we were called.case "$1" instart)start;;stop)stop;;restart|reload)stopsleep 1startRETVAL=$?;;*)echo "Usage: $0 {start|stop|restart}"exit 1esacexit $RETVAL</pre> * 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 <nowiki>http://hda:9032</nowiki> *Alternate method nano /usr/share/pytivo/pyTivo.conf *Example config file<pre>[Server]port = 9032ffmpeg = /usr/bin/ffmpeg [Movies]type = videopath = /var/hda/files/movies [Music]type = musicpath = /var/hda/files/music [Pictures]type = photopath = /var/hda/files/pictures [_tivo_SD]height = 1080video_fps = 29.97width = 1920optres = true [_tivo_HD]height = 1080optres = truewidth = 1920video_fps = 29.97</pre> ==Install Vidmgr=====Prerequisites=======TiVoDecode==== yum install make gcc *Download TiVodecode source and install:<pre>cd /usr/share/pytivogit clone https://github.com/arantius/tivodecode.gitcd download./configuremakemake install</pre> *In your browser, visit <nowiki>http://hda:9032</nowiki><blockquote><ul><li>Select Settings, Global Server Settings</li><li>Path for tivodecode binary /usr/local/bin/tivodecode</li><li>Save</li></ul></blockquote> ====pyHME====* Download pyhme source:<pre>cd /usr/sharegit clone https://github.com/wmcbrine/hmeforpython.gitmv hmeforpython pyhme</pre> *Install pillow (Python Imaging Library) easy_install pillow-pil*Start the pyHME script: python /usr/share/pyhme/start.py <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> *Start the pyHME service: service pyhme start *Create the pyhme service: nano /etc/init.d/pyhme *Paste the following in the file:<pre>#!/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 INFORETVAL=0 start() {echo -n "Starting pyHME: "pgrep -f start.pyRETVAL=$?[ $RETVAL -eq 0 ] && echo "pyHME already running: Exiting" && exit 1# this call actually starts pyHME.cd /usr/share/pyhmepython start.py > /dev/null 2>&1 &RETVAL=$?[ $RETVAL -eq 0 ] && echo -n "done"echoreturn $RETVAL}stop() {echo -n "Stopping pyHME: "pkill -f start.pyRETVAL=$?echo[ $RETVAL -eq 0 ] && echo -n "done"echoreturn $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" instart)start;;stop)stop;;status) checkstatus;; restart|reload)stopsleep 1startRETVAL=$?;;*)echo "Usage: $0 {start|stop|restart}"exit 1esacexit $RETVAL</pre> *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:<pre>cd /usr/share/pyhmegit clone https://github.com/jbernardis/pytivo-video-mgr2.gitmv /usr/share/pyhme/pytivo-video-mgr2/vidmgr /usr/share/pyhme/vidmgr</pre> *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.<pre>cp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /usr/share/pyhme/vidmgr/vidmgr.inicp /usr/share/pyhme/vidmgr/vidmgr.ini.dist /your/pyTivo/video/folder/vidmgr.ini.dist</pre> ==Configure Web App==* 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: <pre><html><head><meta http-equiv="refresh" content="1;url=http://hda:9032"></head></html></pre> If you have issue you can check the [http://pytivo.sourceforge.net/wiki/index.php/PyTivo pyTivo website].
12,424

edits