LinHES Forums http://forum.linhes.org/ |
|
HOWTO: Setup MythExport (for iPod) on R6 http://forum.linhes.org/viewtopic.php?f=25&t=20657 |
Page 1 of 5 |
Author: | paulsid [ Tue Dec 08, 2009 1:55 am ] |
Post subject: | HOWTO: Setup MythExport (for iPod) on R6 |
MythExport is a daemon for exporting and transcoding recordings from MythTV. It can be used as a replacement for myth2ipod, and (unlike myth2ipod) is still actively supported and maintained. This is a HOWTO guide to getting it working with R6. Don't let the length of the instructions below faze you. The install is actually fairly straightforward. I assume no prior knowledge of myth2ipod and just a basic familiarity of Linux and MythTV. Most of the length is due to the stuff to copy/paste, plus my natural longwindedness. ![]() A bit of background: I used myth2ipod quite a bit but since moving to R6 have been unable to get it to work. While researching problems with it in R5.5, I discovered MythExport as an alternative, but could never get it to work due to dependency problems. Then I managed to solve my myth2ipod issue so I left it. However, after failing to fix new myth2ipod problems in R6, on a total whim of frustration I typed in "pacman -S mythexport", fully expecting it to say "package not found". To my utter amazement, it did not, and instead asked me to confirm the install!! (A big THANK YOU to whoever (cecil?) decided to include this!) After the stun wore I proceeded to try to get MythExport to work. Alas, it was not a simple matter, as R6's setup does not match what MythExport expects. Indeed, my first two cracks at it quickly turned into failure, and for a while I went back to trying to fix myth2ipod, without success. Eventually I tried again to fix MythExport and this time managed to get it working. Third time's the charm I guess! NOTE: All file operations (creates, executes, etc.) should be done while logged in as mythtv, unless otherwise noted.
MythExport will log to /var/log/mythtv/mythexport.log. If you need to troubleshoot, stop the service (sv stop mythexport) and then manually run the daemon in debug mode: [code]sudo mythexport-daemon --debug[/code]You can also run the mythexport_addjob script by hand if you have the recording's starttime and chanid. Note that the daemon waits a bit between polling the job database, so when you add a job processing may not start right away. If you have to do troubleshooting, you can avoid this by adding the job BEFORE rerunning the script, so it will be picked up immediately. The RSS feed of exported programs can be accessed from this URL, which you can enter into iTunes under Advanced->Subscribe to Podcast: [code]http://localhost/mythexport/mythexportRSS.cgi[/code] Lastly, once you are sure everything is working be sure to reboot to test that the daemon properly auto-starts! DISCLAIMER: I run R6 with the new (testing) mythtv 0.22 packages installed. In theory it should work exactly the same if you have the normal 0.21 installation though. References:
|
Author: | Martian [ Mon Dec 21, 2009 10:29 pm ] |
Post subject: | |
Just got an iPod Touch for my wife for Christmas and was trying to get this going. I got as far as you did but haven't figured out anything further. Unfortunately as you said your mythexport_settings.cfg isn't good for the Touch. It's interesting that the Mythexport scripts seem to work yet you can't access the setup page through the web. I tried and tried but couldn't figure that one out. It appears that the scripts are there but the html or php files or whatever aren't. Anyway just wondering if you or anyone else had made it any further with this or if anyone has any suggestions for a mythexport_settings.cfg that would be good for the iPhone / iPod Touch. Martian |
Author: | paulsid [ Tue Dec 22, 2009 11:28 am ] |
Post subject: | |
There may have been a Touch config buried somewhere in that big thread... if not the main thing would probably be the ffmpeg options, and you might be able to find those from another source or derive them. (IIRC the Touch has a widescreen resolution and might use a different format?) Quote: It's interesting that the Mythexport scripts seem to work yet you can't access the setup page through the web. I tried and tried but couldn't figure that one out. It appears that the scripts are there but the html or php files or whatever aren't.
Well I've looked at the Ubuntu source package and there's nothing there we don't have. It's possible it might be something simple like we are just missing some perl libraries the scripts depend on... however I was not able to find a way to get lighttpd to give me proper debugging info. It oddly does not log anything when the scripts give 500 errors. |
Author: | Martian [ Tue Dec 22, 2009 12:27 pm ] |
Post subject: | |
I'm pretty much seeing the same things you are. Thanks for the reply! Martian |
Author: | Martian [ Wed Dec 23, 2009 2:40 pm ] |
Post subject: | |
Well I think I've managed to construct a working ffmpeg command line for the iPod Touch. Here it is if anyone is interested: Code: dir=/myth/ipodfeed
[ipod] removeCommercials=0 extension= codec=libx264 sizeY=272 sizeX=480 aspect=16:9 videoBR=300000 threads= device=ipod podcastName=MythTV deletePeriod= audioBR=128000 ffmpegArgs=-y -acodec libfaac -ab 128000 -ar 48000 -ac 2 -vcodec libx264 -b 300000 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -refs 1 -coder 0 -me_method umh -me_range 16 -subq 6 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -i_qfactor 0.71 -s 480x272 -deinterlace -aspect 16:9 audioChannels=2 deinterlace=1 I tried accessing the RSS feed in iTunes but nothing happened. Paulsid, were you able to get that to work? I really want to be able to hit "Transcode to iPod" on the Myth box and have iTunes do the rest but right now it's not looking promising. I wish I knew more about CGI, Podcasts, and RSS feeds... I can access the [MyHost]/mythexport/mythexportRSS.cgi page through my browser on my Windows machine but like all the other .cgi files from Mythexport it just gives me a blank white page and no errors. I was hoping maybe iTunes could make sense of it but so far no luck. Martian |
Author: | paulsid [ Wed Dec 23, 2009 3:27 pm ] |
Post subject: | |
Martian wrote: I really want to be able to hit "Transcode to iPod" on the Myth box and have iTunes do the rest but right now it's not looking promising. I wish I knew more about CGI, Podcasts, and RSS feeds...
I can access the [MyHost]/mythexport/mythexportRSS.cgi page through my browser on my Windows machine but like all the other .cgi files from Mythexport it just gives me a blank white page and no errors. I was hoping maybe iTunes could make sense of it but so far no luck. Hmm, the mythexportRSS.cgi page worked for me with only the minor addition to lighttpd.conf (step 6). Maybe this is obvious, but have you restarted lighttpd (sudo sv restart lighttpd) or rebooted so it picks up the changes? When you browse to that page you should be seeing a feed page titled MythCast, with the show titles and links to the exported media files. (Unless you are still using an older IE version that doesn't recognize RSS.) At that point clicking a link should start to download the file, and if that works then iTunes can pick it up. (I do have this working.) I'll doublecheck my setup when I get home from work in a few hours and see if I can find anything else that might be causing this... |
Author: | Martian [ Wed Dec 23, 2009 6:01 pm ] |
Post subject: | |
EDIT: I think I got it! Code: chown http:users /srv/http and now it appears to be working! EDIT2: I've found a way to get the .cgi scripts to display error info in the browser window. Edit your .cgi script and append a -w to #!/usr/bin/perl then add the following lines just below #!/usr/bin/perl -w like so: Code: #!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use warnings; use strict; Unfortunately I get the following error when I try to run setup.cgi: Quote: Software error:
Can't locate HTML/Template.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.0 /usr/share/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl /usr/lib/perl5/current /usr/lib/perl5/site_perl/current .) at /data/srv/httpd/htdocs/mythexport/setup.cgi line 9. BEGIN failed--compilation aborted at /data/srv/httpd/htdocs/mythexport/setup.cgi line 9. For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. Martian |
Author: | Martian [ Thu Dec 24, 2009 10:35 am ] |
Post subject: | |
I can now subscribe to my podcast and download shows!!! iTunes did NOT like me using a redirection URL. I can to hardcode it with my non-standard port specified instead of using the redirection URL. Martian |
Author: | paulsid [ Thu Dec 24, 2009 12:06 pm ] |
Post subject: | |
Cool, glad you fixed your issue. It's a pity MythExport uses so many hardcoded values, but it's fairly new and I don't think is used very much outside of Ubuntu so that's to be expected. Also thanks for the -w tip, that looks like it'll be very helpful in trying to get those pages working. |
Author: | Martian [ Mon Dec 28, 2009 9:32 pm ] |
Post subject: | |
Everything is working splendidly now, except for the fact that all of my transcoded shows have a very noticeable audio lag. I have tried adding both async 1 as well as async 30 to my ffmpeg line but no change from either. I know this is started to drift off topic but would appreciate any advice / guidance / etc... anyone could offer. I'm so close but I just can't seem to squish this audio sync bug. My source is OTA (via antennae) captured with an HDHomerun. The issue is in the encoded file as it is present in playback in VLC as well as on the iPod Touch. Martian |
Author: | indolent [ Thu Jan 28, 2010 8:58 pm ] |
Post subject: | |
Martian wrote: Everything is working splendidly now, except for the fact that all of my transcoded shows have a very noticeable audio lag. I have tried adding both async 1 as well as async 30 to my ffmpeg line but no change from either.
I know this is started to drift off topic but would appreciate any advice / guidance / etc... anyone could offer. I'm so close but I just can't seem to squish this audio sync bug. My source is OTA (via antennae) captured with an HDHomerun. The issue is in the encoded file as it is present in playback in VLC as well as on the iPod Touch. Martian Great guide. I also have the audio sync issue that Martian has. Anyone have any ideas? |
Author: | Martian [ Fri Jan 29, 2010 9:40 am ] |
Post subject: | |
indolent wrote: I also have the audio sync issue that Martian has. Anyone have any ideas?
I'm curious - Are you also using an HDHomerun as your source? I never was able to sort this one out. I planned to try other codecs to see if they share the audio sync problem or if it's only H.264 but got burnt out on the issue and moved to other projects. Do let me know if you have any success! Martian |
Author: | ceenvee703 [ Sun Jan 31, 2010 7:59 pm ] |
Post subject: | |
I thought I followed all the steps correctly but when I do the "run ps -ef | grep mythexport" to see if it's running, I get the following: Code: [root@mbe ceenvee703]# ps -ef|grep mythexport
root 5165 1 0 Jan05 ? 00:00:50 runsvdir -P /var/service log: ccess denied?runsv mythexport: fatal: unable to start ./run: access denied?runsv mythexport: fatal: unable to start ./finish: access denied?runsv mythexport: fatal: unable to start ./run: access denied?.runsv mythexport: fatal: unable to start ./finish: access denied?runsv mythexport: fatal: unable to start ./run: access denied?runsv mythexport: fatal: unable to start ./finish: access denied? root 13638 12704 0 20:56 pts/0 00:00:00 grep mythexport root 30022 5165 0 Jan29 ? 00:01:53 runsv mythexport It looks like I screwed up the sv scripts, but I double checked and they're the same scripts (I copied/pasted them) and re-ran the chmod 755 with no luck. Thanks for any leads. |
Author: | paulsid [ Sun Jan 31, 2010 11:43 pm ] |
Post subject: | |
ceenvee703 wrote: It looks like I screwed up the sv scripts, but I double checked and they're the same scripts (I copied/pasted them) and re-ran the chmod 755 with no luck.
Hmm, it looks like it's trying to run the daemon as a non-root user. Were you root when you ran add_service.sh? Check the ownership on the link /var/service/mythexport, which is created by the script. Also do ps -ef | grep "runsv mythexport" and see who owns the process, it should be root. If need be you can run remove_service.sh and then rerun add_service.sh as root. That's all I can think of offhand... |
Author: | ceenvee703 [ Mon Feb 01, 2010 7:13 am ] |
Post subject: | |
I removed and then re-added as root, didn't help, still get those same errors with runsvdir. Here's the ls for the mythexport service scripts Code: [root@mbe ceenvee703]# ls -lah /etc/sv/mythexport total 20K drwxr-xr-x 3 root root 4.0K 2010-01-29 19:26 . drwxr-xr-x 47 root root 4.0K 2010-01-29 19:25 .. -rwxr-xr-x 1 root root 157 2010-01-31 21:01 finish -rwxr-xr-x 1 root root 237 2010-01-31 21:01 run drwx------ 2 root root 4.0K 2010-02-01 08:05 supervise I did a ugo+x to see if that would help, and it didn't. I ran the daemon in debug mode as specified and it seems to OK, I think: Code: February 1 08:05:23 mbe /usr/bin/mythexport-daemon[16651]: Stopping Processing: 1265029523
February 1 08:05:30 mbe /usr/bin/mythexport-daemon[28549]: Starting Processing: 1265029530 February 1 08:08:31 mbe /usr/bin/mythexport-daemon[28549]: Caught SIGTERM: exiting gracefully February 1 08:08:31 mbe /usr/bin/mythexport-daemon[28549]: Stopping Processing: 1265029711 February 1 08:08:46 mbe /usr/bin/mythexport-daemon[28745]: Starting Processing: 1265029726 February 1 08:08:46 mbe /usr/bin/mythexport-daemon[28745]: query = select id, type, param from mythexport_job_queue order by id at line 607 in /usr/bin/mythexport-daemon February 1 08:09:46 mbe /usr/bin/mythexport-daemon[28745]: query = select id, type, param from mythexport_job_queue order by id at line 607 in /usr/bin/mythexport-daemon February 1 08:10:46 mbe /usr/bin/mythexport-daemon[28745]: query = select id, type, param from mythexport_job_queue order by id at line 607 in /usr/bin/mythexport-daemon I'll see if I can actually transcode anything. |
Page 1 of 5 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |