|
InstallationGuide
Installation Guide.
MythTV for iPhoneCopyright 2008 Chris Carey (http://chriscarey.com). This program is distributed under the terms of the GNU General Public License IntroductionThis software is not a native iPhone app. It is a web application which is installed on your MythTV server. You access the software by using your iPhone web browser and hitting a URL on your MythTV server. Apache SetupYou need to set up a /recordings/ Alias for watching videos. In your apache conf file add: Alias /recordings /var/lib/mythtv/recordings You must restart apache for the settings to take effect Dependency Install
Transcoding SetupFollow this guide below which is the same one I'm using: http://mythtv.org/wiki/index.php/Streaming_to_iPod_touch_or_iPhone Two changes I made to the mythipod.sh script to make it work: 1) %DIR%/%FILE% should be %DIR% %FILE% (no slash) 2) change libfaac to aac on the last line YOU MUST HAVE THIS WORKING BEFORE MYTHTV FOR IPHONE WILL WORK! Transcoding is a huge part of this process. For the most part, you are on your own here. You need to get it to the point that the mp4 files are being generated automatically on your MythTV. You need to set up a "User Job" in MythTV. Mine is called "Convert to iPod". You can initiate this User Job from within MythFrontend, or MythWeb, or soon from within MythTV for iPhone. There is also a setting in Settings->TV->General where you can tell the MythTV to run "User Job #1" every time a show records. You may want this selected. Getting transcoding working correctly is probably the toughest part of the install. After upgrading my Ubuntu, I had to install Medibuntu to get the transcoding working. If you run Ubuntu, you probably need to do the same: http://chriscarey.com/wordpress/?p=26 Set up Smarty DirectoriesFollow the section SETUP SMARTY DIRECTORIES in the quick start guide http://www.smarty.net/quick_start.php Install Smarty Templates in smarty templates folder
Install files in the web app folder on your mythtv box
Customize i_settings.php
You must edit this file with correct paths and options All Done!! |
Sign in to add a comment
http://smarty.org/ should be http://www.smarty.net/
change
to
and revert the changes to mythipod.sh. Both params will be passed now.
Thanks! I'll update this guide as soon as editing is re-enabled by google.
I hear your pain, I'm doing wiki updates via svn myself on my project
Has anyone had any luck converting HD shows? I convert them but they don't seem to play on the iphone.
I don't understand what you mean by "applications folder" on the iphone or where?
OK. I got it working and it's very cool. I had to tweak the code a bit so it would handle .nuv file. And it needs to be fixed so the cron job won't delete the .mp4 if a .mpg is transcoded to a .nuv after the .mp4 is created.
Hi Chris, I really like this app, thank's for the nice job. I would like to have the button 'Convert' to work, but it doesn't in my config. Can you give me some advice.
Regards.
Yvon
anyone else experiencing a problem with safari not properly displaying (or even loading) main.tpl? everything properly works, but i can tell the template is not getting loaded. i've verified the references in i_settings.php and index.php. the paths seem to be correct. i just picked up my iphone 3g yesterday, but i don't it's an issue with that since my mythbuntu box is sending preformatted code.
update to myself: after tail -F my apache error log, i found errors about files that do not exist. i noticed that the files/directories that were mentioned in the error log were the same files/directories i ommitted to copy after setting up the Smarty Templates folders. i'm sure other users have wisely assumed to copy the entire directory contents to /var/www/{mythiphonepath}, but i literally only copied the files the instructions listed. i should have been savvier and copied everything over, like a good little user. anyhow, if anyone else runs in to this, here's the fix. good luck. and great work with this app!
This is pretty cool. However it doesn't support multiple recording directories? I have three different disks that I store my recordings on and I figured I wouldn't setup LVM because mythtv doesn't need it anymore.
Any help is appreciated.
The new version of mythweb has flash streaming. AFAIK these files are not generated by any user jobs on the myth backend. They are created on the fly.
Is this possible for an apple iphone? I dont want to transcode everything if I only watch 1% of it on my iphone/
This is very cool. Thanks for the great work. I had to change a few things to get it working.
1) the line in index.php that calls the transcode script didn't work for me. There was a line right above it that slightly different, but commented out. I had to uncomment that line & comment out the original.
2) By default, livetv recordings are shown in the list as well. If you don't want this you can change the sql query on line 44 of i_functions.php to
If you use a recording group other than 'LiveTV', change it accordingly.
3) I was having a problem where clicking a show in the list would always display the details for the first show in the list. This was happening because I transcode my recordings, so all my files are .nuv. getShows() in i_functions.php was trying to obtain the file name by stripping '.mpg' & adding '.mp4', but this gave a screwy file name since my files don't contain '.mpg'. To fix this, change line 54 to
Which will strip any file name, not just .mpg.
Hope this helps anyone running into the same problems =)
Mine takes an awful long time to load. It loads 4mb of data, 56 requests with most of them being the preview images for shows.
I modified the main.tpl into showing a non-existant image instead - now it loads 20KB of data and is much much faster.
Great job Chris !
I also had to commented out the line that transcode to mp4 in index.php to make it work. Everything is working except that I can't see any mp4 file (already transcode) on the iPhone Safari web interface. Am I alone with this problem :( I had a look the ../smarty/templates_c/%%4545E45E3B9C7%%main.tpl.php that seems to be create from the http session but I'm not a php expert coder... All the transcode mp4 file has 644 rights and are own by root. Is there a way to see debug information from smarty ? because I have nothing from apache . Thanks for any clue.
Fixed line 29 in the main.tpl file. It had a hard coded ip address of 10.1.1.20 in the link that takes you back to the home page after hitting the "convert" button.
<a href="http://10.1.1.20/mythiphone/" target="_self">Click here to refresh the video list</a> <a href="http://{$app_url_root}/mythiphone/" target="_self">Click here to refresh the video list</a>I am unable to get the transcoding working properly (not an issue with mythtv for iphone). With the ffmpeg shipped with Debian Etch, audio always way ahead of video (sync issues), with newest SVN checkout of ffmpeg, x.264, newest yasm and xvid, some video is perfect, some video has audio that is just completely wrong. I had to use faac with the new ffmpeg. Anyway, still working on getting it right. I always transcode OTA vestigal side band streams encoded to mpeg2video, yuv420p, 1920x1080 1:1 DAR 16:9?, 14569 kb/s, 29.97 tb(r) and Stream #0.10x34?(eng): Audio: ac3, 48000 Hz, 5:1, s16, 384 kb/s
I got this figured out, so I thought I would share this with anyone transcoding mpeg2ts (over the air high definition) to something that the iphone 3G can play from a streaming server such as apache. Here is my ffmpeg line:
ffmpeg -i "${directory}/${file}" -async 3 -r 29.97 -acodec libfaac -ar ${rate} -ab ${abitrate} -ac 2 -s ${width}x${height} -vcodec mpeg4 -b ${vbitrate} -flags +aic+mv4 -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 512k -bufsize 2M -title "${file}" "${directory}/${file}.mp4"The key here is to ensure the playback is at no more than 30 frames a second, or your iphone will play like 1 second and then stop...like it can't buffer the stream. Of course, when you do this, you will lose audio/video sync since you just yanked some frames out out the stream, so you need to use -async 3 to fix this; 3 works for me, but you may want to experiment. Also, I am using a recent SVN trunk compilation of ffmpeg with libfaac and xvid enabled in the compilation. This made a huge difference in whether ffmpeg could work with me on this TS file.
How hard would it be to add streaming of movies as well?
Here is what works for me on Mythbuntu 9.04 for mpeg2ts (over the air high definition).
ffmpeg -i "${directory}/${file}" -r 29.97 -async 1 -vsync 1 -acodec libfaac -ab 128 -ar 44100 -ac 2 -s ${width}x${height} -vcodec mpeg4 -b ${vbitrate} -flags +aic+mv4 -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 512k -bufsize 2M "${directory}/${file}.mp4"