TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 10-13-2014, 09:35 AM   #1
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
[ANN] The TivoHMO and TivoHME ruby libraries

Hi all,

I officially had too much time on my hands, and being a ruby fan decided to reimplement hmo/hme in ruby:

https://github.com/wr0ngway/tivohmo
https://github.com/wr0ngway/tivohme

I'm a fan of plex for managing my library, and pytivo/hmeforpython for making my library available to my tivos, but was finding it too difficult to use plex as the metadata source for pytivo/hme. Thus I wrote these with a little more separation between components to make it easier to plug/play the bits extenders may care about. The original goal when I started was to have a single media library through plex, and have it exposed to the tivo with hmo, maybe hme, and possibly an opera app. Given the recent work by ntlord ( https://github.com/ntlord/PlexTivo ), I'm not sure if I'll do much with the hme implementation so it remains lacking a test suite, but thought I'd share in case others were interested.

The tivohmo project is mostly complete and tested, but the transcoder is pretty basic. If anyone is more of an expert in all the ffmpeg magic involved in getting video to a form the tivo is looking for, and is looking to contribute, I'd be happy to accept A way to serve streams to tivo mini's would also be very cool, but have no idea where to start.

This project wouldn't be possible without all the other groundbreaking work done in the other tivo projects (pyTivo, hmeforpython, videomanager, etc), so would like to thank everyone thats contributed to those projects for figuring out all the hard stuff to make my life easier

wr0ngway is offline   Reply With Quote
Old 10-13-2014, 07:49 PM   #2
davidblackledge
Registered lÜser
 
davidblackledge's Avatar
 
Join Date: Sep 2008
Location: NM
Posts: 317
Hah! fun! Thanks for sharing this!

__________________
EnterWebz.tv
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
+ Radio Auricle + air qual / lightning maps, 1p/2p games...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
David.Blackledge.com Solitaire/FreeCell, Calendar, Map...
hmedev.wikidot.com
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
davidblackledge is offline   Reply With Quote
Old 03-08-2015, 11:11 AM   #3
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Just letting everyone know that I've been continuing to work on my tivohmo app, and its now my daily driver for getting video from my plex server to my tivo

Some Noteworthy features:

Full control of runtime from command line or config file
Application for changing runtime settings of the server from the Tivo UI
Application to serve video to the Tivo from the Filesystem
Application to serve video to the Tivo from a Plex Media Server
Can serve video with on-the-fly hardcoded subtitles from srt files (embedded subs, e.g. mkv, are also supported in plex app)

wr0ngway is offline   Reply With Quote
Old 03-08-2015, 09:17 PM   #4
Fofer
༺♥༻
 
Fofer's Avatar
 
Join Date: Oct 2000
Location: Neither here nor there
Posts: 74,130
TC CLUB MEMBER
Sweet! I'm gonna have to give this a try. Thank you!

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- a list of some favorite browser add-ons that help make TCF even more enjoyable!
Fofer is offline   Reply With Quote
Old 03-15-2015, 07:47 AM   #5
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by Fofer View Post
Sweet! I'm gonna have to give this a try. Thank you!
Did you get a chance to try it yet? Any problems?

wr0ngway is offline   Reply With Quote
Old 04-17-2015, 03:31 PM   #6
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
I'm getting a strange error when I try to install tivohmo via the instructions on the github site. Here's the error:

Code:
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: json-1.8.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing tivohmo:
	ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.2/ext/json/ext/generator/gem_make.out
Any ideas why it won't install?

joeblow8579 is offline   Reply With Quote
Old 04-17-2015, 05:54 PM   #7
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Looks like its using the ruby that comes preinstalled with OS X. I've never had much luck with that as its usually woefully out of date. In this case it just looks like the ruby development headers are missing, and thus some binary extensions that tivohmo depends on cannot be compiled. I'm not sure how to get headers for the system ruby, maybe by installing the xcode CLI tools - http://railsapps.github.io/xcode-com...ine-tools.html ?

It'll probably end up easier to use rvm to setup a more complete ruby instead:

https://rvm.io/rvm/install

This may help as well:
https://www.ruby-lang.org/en/documen.../installation/

wr0ngway is offline   Reply With Quote
Old 04-17-2015, 07:21 PM   #8
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Thanks for getting back to me quickly. I installed the Xcode CLI tools and it got through the installation successfully.

For future reference: it might be really helpful to put an example of the syntax of how to get apps running. I'm now trying to decipher the --help command and it's slow going (I've never done anything with plex on the command line, only set up pyTiVo that way, which was quite easy).

edit: I meant an example in the settings file, by the way. That wasn't clear in my initial comments. The examples are there in the --help thingy, but it isn't immediately clear to the novice (which I am) how exactly to properly format them in the .plist file.


Last edited by joeblow8579; 04-17-2015 at 07:29 PM.
joeblow8579 is offline   Reply With Quote
Old 04-18-2015, 08:09 PM   #9
davidblackledge
Registered lÜser
 
davidblackledge's Avatar
 
Join Date: Sep 2008
Location: NM
Posts: 317
Quote:
Originally Posted by wr0ngway View Post
Looks like its using the ruby that comes preinstalled with OS X. I've never had much luck with that as its usually woefully out of date.
I think you meant to say "you installed it the wr0ng way."

__________________
EnterWebz.tv
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
+ Radio Auricle + air qual / lightning maps, 1p/2p games...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
David.Blackledge.com Solitaire/FreeCell, Calendar, Map...
hmedev.wikidot.com
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
davidblackledge is offline   Reply With Quote
Old 04-19-2015, 10:57 AM   #10
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
For future reference: it might be really helpful to put an example of the syntax of how to get apps running. I'm now trying to decipher the --help command and it's slow going (I've never done anything with plex on the command line, only set up pyTiVo that way, which was quite easy).

edit: I meant an example in the settings file, by the way. That wasn't clear in my initial comments. The examples are there in the --help thingy, but it isn't immediately clear to the novice (which I am) how exactly to properly format them in the .plist file.
Understood - I work in this stuff all day so I lose perspective on what makes sense for people that don't Were you able to get it working?

Would be great if you could add something to the wiki https://github.com/wr0ngway/tivohmo/wiki or add to the comments in the config file (via fork + pull request) https://github.com/wr0ngway/tivohmo/...ib/tivohmo.yml

wr0ngway is offline   Reply With Quote
Old 04-19-2015, 10:58 AM   #11
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by davidblackledge View Post
I think you meant to say "you installed it the wr0ng way."
Heh, yeah, my nick usually applies more to what I'm doing than others

wr0ngway is offline   Reply With Quote
Old 04-19-2015, 09:37 PM   #12
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
Understood - I work in this stuff all day so I lose perspective on what makes sense for people that don't Were you able to get it working?

Would be great if you could add something to the wiki https://github.com/wr0ngway/tivohmo/wiki or add to the comments in the config file (via fork + pull request) https://github.com/wr0ngway/tivohmo/...ib/tivohmo.yml
Actually no. I tried adding what I thought was the right stuff to the .plist file but ended up with an error saying:

Code:
[2015-04-17T20:32:11] INFO  TivoHMO::Config No primary config at file: ''
[2015-04-17T20:32:11] INFO  TivoHMO::Config No secondary config at file: ''
[2015-04-17T20:32:11] INFO  TivoHMO::CLI TivoHMO 0.3.1 starting up
ERROR: at least one application is required

See: 'tivohmo --help'
In my settings file I added some commands like this: <string>-t "Movies"</string> with the names of my Plex channels. I'm still not entirely clear on what needs to be added to the .plist to tell it what to do.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 07:09 AM   #13
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
Actually no. I tried adding what I thought was the right stuff to the .plist file but ended up with an error saying:
Ok, if you ran "tivohmo --install" it should have installed the plist for running tivohmo into "~/Library/LaunchAgents/tivohmo.plist" and the config file into "~/Library/Preferences/tivohmo.yml" If you run it again, it will overwrite any mods you have made.

You shouldn't need to edit the plist as all it does is run tivohmo with the config file. You shouldn't need to edit the config file either as it should have working defaults.

To run tivohmo using the plist:
launchctl load ~/Library/LaunchAgents/tivohmo.plist

To stop it:
launchctl unload ~/Library/LaunchAgents/tivohmo.plist

Note this tells OSX this program is a daemon, and it will keep it running after crashes/reboot/etc

You can verify its running with a command like (or use Activity Monitor):
ps ax | grep [t]ivohmo

Note if the number on the left (the pid) keeps changing, it means that tivohmo keeps dying and restarted, so something is probably wrong, and you can debug with the logfile at:
~/Library/Logs/tivohmo.log

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 12:02 PM   #14
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
Ok, if you ran "tivohmo --install" it should have installed the plist for running tivohmo into "~/Library/LaunchAgents/tivohmo.plist" and the config file into "~/Library/Preferences/tivohmo.yml" If you run it again, it will overwrite any mods you have made.

You shouldn't need to edit the plist as all it does is run tivohmo with the config file. You shouldn't need to edit the config file either as it should have working defaults.

To run tivohmo using the plist:
launchctl load ~/Library/LaunchAgents/tivohmo.plist

To stop it:
launchctl unload ~/Library/LaunchAgents/tivohmo.plist

Note this tells OSX this program is a daemon, and it will keep it running after crashes/reboot/etc

You can verify its running with a command like (or use Activity Monitor):
ps ax | grep [t]ivohmo

Note if the number on the left (the pid) keeps changing, it means that tivohmo keeps dying and restarted, so something is probably wrong, and you can debug with the logfile at:
~/Library/Logs/tivohmo.log
So I started over by installing again, and I didn't make any changes to either file. I loaded the launch agent and now it appears to be working. I am able to see the TiVoHMO shares in My Shows on the TiVo.

However, when I browse to a show or movie, the various folders that contain the media show up on the tivo as empty, with no content.

I briefly looked through the tivohmo.log file but didn't see any obvious errors kicked out by the program.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 12:10 PM   #15
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
However, when I browse to a show or movie, the various folders that contain the media show up on the tivo as empty, with no content.
By empty, do you mean they have a (0) beside them? Or do you mean that when you browse into them they have no contents? The reason I ask is that I made an optimization for slower systems so that the counts don't get updated till you browse down into them, so try to browse into them if you didn't already

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 12:37 PM   #16
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
By empty, do you mean they have a (0) beside them? Or do you mean that when you browse into them they have no contents? The reason I ask is that I made an optimization for slower systems so that the counts don't get updated till you browse down into them, so try to browse into them if you didn't already
They show a (0) but when I actually browse into them it gives me the "This Group is now empty. Press LEFT to return to the My Shows List." message.

I've tried browsing into Movies by "All" as well as by several of the other criteria listed there. They all appear empty.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 12:44 PM   #17
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
They show a (0) but when I actually browse into them it gives me the "This Group is now empty. Press LEFT to return to the My Shows List." message.
Does it sit for a while before deciding its an empty group? How large a library do you have? It could just be timing out while loading the details for a really large library, but if you go back later it will be populated.

You do have content in the plex library running on the same host as tivohmo, correct?

Other than, I could take a look at the log and see if I see anything.

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 12:48 PM   #18
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
Does it sit for a while before deciding its an empty group? How large a library do you have? It could just be timing out while loading the details for a really large library, but if you go back later it will be populated.

You do have content in the plex library running on the same host as tivohmo, correct?

Other than, I could take a look at the log and see if I see anything.
I have a fairly large library, but I've tried navigating to folders with just one or two things in them and seen no difference.

It doesn't seem to take very long to decide that folders are empty. Maybe a few seconds at the most. Should I email you the log file?

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 12:54 PM   #19
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
I have a fairly large library, but I've tried navigating to folders with just one or two things in them and seen no difference.

It doesn't seem to take very long to decide that folders are empty. Maybe a few seconds at the most. Should I email you the log file?
Email is fine, or a shard link to dropbox or create a github issue or gist to hold it

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 01:14 PM   #20
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
Email is fine, or a shard link to dropbox or create a github issue or gist to hold it
Apparently I need 10 posts to send PM's. This is my tenth (pointless) post.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 01:14 PM   #21
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
PM sent with a link to the log file.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 01:25 PM   #22
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Ok, got it.
The first error that jumps out at me is:

2015-04-20 12:56:30 - Errno::ENOENT - No such file or directory - the ffprobe binary could not be found in /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:

Which tells me that either ffmpeg/ffprobe isn't in your path or you are using an older version that doesn't have ffprobe

Can you run "ffmpeg -v" or "ffprobe -v" on the command line?

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 01:38 PM   #23
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
Quote:
Originally Posted by wr0ngway View Post
Ok, got it.
The first error that jumps out at me is:

2015-04-20 12:56:30 - Errno::ENOENT - No such file or directory - the ffprobe binary could not be found in /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:

Which tells me that either ffmpeg/ffprobe isn't in your path or you are using an older version that doesn't have ffprobe

Can you run "ffmpeg -v" or "ffprobe -v" on the command line?
Good call. I forgot I had reinstalled OS X a few months ago when I put the SSD into this machine and had only had ffmpeg in my pytivo folder. I copied it into /usr/bin and now when I type ffmpeg -v from the command line it actually gives output other than "command not found".

I get this:
Code:
ffmpeg version 2.5.3-tessus Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 10 2015 01:19:50 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-libsoxr --enable-libwavpack --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --disable-indev=x11grab_xcb --enable-runtime-cpudetect
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Missing argument for option 'v'.
Error splitting the argument list: Invalid argument
Still empty folders in tivoHMO though.

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 01:40 PM   #24
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
I get this when typing "ffprobe -v" at the command line:

Code:
-bash: ffprobe: command not found
I notice that the numbers next to the folders when browsing from the TiVo do in fact update after I tunnel into them, but I still can't see anything in the folders when I navigate there. Is this related to not having ffprobe as a part of my ffmpeg version?

joeblow8579 is offline   Reply With Quote
Old 04-20-2015, 01:57 PM   #25
wr0ngway
Registered User
 
Join Date: Jan 2014
Posts: 23
Quote:
Originally Posted by joeblow8579 View Post
Is this related to not having ffprobe as a part of my ffmpeg version?
Correct - I should probably handle that more gracefully, but basically it uses ffprobe to figure out duration of the video so that it can be transferred correctly - and it tries to do this for each video when you dig in, and fails/aborts on the first one. Once you have ffprobe available, it should show your videos.

I usually use homebrew to keep up to date with the latest ffmpeg on OSX:

http://brew.sh/

then:

brew install ffmpeg

wr0ngway is offline   Reply With Quote
Old 04-20-2015, 07:55 PM   #26
joeblow8579
Registered User
 
Join Date: Apr 2014
Posts: 14
I was able to get it working with home-brew. I'd already installed it to get the latest version of Ruby, so all I had to do was load up the latest ffmpeg via the command line as you said.

Now all we need is a front end that looks pretty and my wife will be happy with my "one box to rule them all" strategy. My kingdom for a fast native Plex app from TiVo...

Does TiVo not let us use high definition menus for things? I notice that pytivo as well as the tivohmo you made use the old style menus.

joeblow8579 is offline   Reply With Quote
Old 04-21-2015, 01:14 AM   #27
wmcbrine
Resistance Useless
 
wmcbrine's Avatar
 
Join Date: Aug 2003
Posts: 9,353
Quote:
Originally Posted by joeblow8579 View Post
Does TiVo not let us use high definition menus for things? I notice that pytivo as well as the tivohmo you made use the old style menus.
HMO menus are rendered by the TiVo, based on simple XML lists of items; and yeah, they've chosen not to update those menus, for whatever reason.

HME lets us use HD and do anything we want, but we have to do it all ourselves (and of course, it doesn't work as a front-end for pulling videos).

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
wmcbrine is offline   Reply With Quote
Reply
Forum Jump







Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Advertisements





TiVo Community
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media


(C) 2015 DBNet - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVo® is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 04:22 AM.
Page generated in 0.19580793 seconds (59.49% PHP - 40.51% MySQL) with 18 queries