Anybody want to make an Internet Video Pusher helper app for EWz?

Discussion in 'Developers Corner' started by davidblackledge, Mar 15, 2015.

  1. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    EWz is set up to let the user configure a different video player instead of TiVo's.

    wmcbrine has been looking into making HME/VLC work with that interface as a locally-installed transcoding player (http://www.tivocommunity.com/tivo-vb/showthread.php?p=10239329#post10239329) but he has hit some snags with the new version of VLC.

    HOWEVER... I understand some models can't stream video at all. I know this is true for Series 2, but I have very little understanding of what the limitations are for the Mini.
    Regardless...I realized that this same feature could be used on those models to activate a push of an Internet video to a DVR so the user could watch it after it transfers.

    I know several of those applications out there can do the pushing (StreamBaby, vidmgr, etc.)... so if one of them would attach a simple HME app to their process, the user could configure EWz to use that local app as their video player and get a decent experience!

    What I envision:
    • Your program launches and also starts an HME app that works with EWz (see below) and spits out the HME launch string that they'll have to use in EWz configuration. e.g.
      Code:
      > > >Enter Webz video configuration: 192.168.0.1:7288/push/
    • The user configures EWz with that string and clicks a video link to try it out.
    • EWz launches the app, including args. e.g.:
      Code:
      http://192.168.0.1:7288/push/?uri=http://...&title=my+favorite+video&subtitle=the+best&mime=video/mp4&description=this+is+a+sample+description&duration=120
      (subtitle, mime, and duration may not be present, and this entire URL is truncated if it's more than 1k)
    • your HME app does something like displaying "Select the DVR to which you want to send the video <title>: <subtitle>" and uses the passed in data as the metadata for the push followed by a "your video will show up soon" if they don't cancel the request, and finally closes itself.

    Who wants to do this? :)
    Actually, all of the available apps out there could do this, and the user can just configure to use whichever one they have installed.
     
  2. Allanon

    Allanon Active Member

    909
    151
    Nov 2, 2005
    The Tivo Mini can run HME programs but can't stream video. You can see HME/VLC menus with a Mini but can't play a stream. Also, you can't use pyTivo with a Mini, when clicking on the videos folder it displays a message stating "You can't watch show from your computer with this Tivo Box". EWZ works on a Tivo Mini.

    Writing a streaming HME app isn't the hard part. It's finding the actual URL for videos, most are hidden within flash players nowadays.

    I'll be releasing a UPNP Client for the Tivo soon (week, maybe two). I didn't know you were able to start Tivo apps on the Tivo with args. I will need to see how that is handled in HME for Python. But I guess I could allow a video to play automatically when given a video url at startup.

    If you just want to push a video to the Tivo I would suggest using pyTivo since it's already setup to do this.
     
    Last edited: Mar 16, 2015
  3. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    Great! this should be neat!

    Can it push an arbitrary video from an Internet URL, too? If so, then that's perfect, and it just needs a simple HME app on top of it that initiates the push given those args passed from EWz.

    *feeling hopeful*
    :D
     
  4. Apr 3, 2015 #4 of 26
    davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    With the removal of the Podcasts feature, does anybody know if this is a bad sign for the "push" feature?
    Is it possible TiVo will remove that capability completely now that their own main use of it is gone?
    Or do I have this wrong and the two have no relationship at all? Or maybe there are a bunch of other official uses of "push" so there is nothing to worry about.
     
  5. Apr 3, 2015 #5 of 26
    moyekj

    moyekj Well-Known Member

    12,157
    809
    Jan 23, 2006
    Mission...
    TiVo Desktop auto transfers use the "push" capability - that's where pyTivo pushes were reverse engineered from. So if the capability is removed that will remove that functionality from TiVo Desktop.

    However, given that TiVo has ignored HMO and HME for many years and recently seem keen on ditching legacy code I would not be at all shocked to see them drop support for these completely in series 4+ hardware. Even worse, I don't even seeing them providing a viable alternative especially to HME. For HMO the combination of TiVo Stream plus Plex may be seen as a viable alternative though I would not agree. For a while it seemed as though perhaps html5/javascript could become a viable alternative to HME, but TiVo promptly killed off open access to that capability.
     
  6. Apr 3, 2015 #6 of 26
    wmcbrine

    wmcbrine Well-Known Mumbler

    11,690
    808
    Aug 2, 2003
  7. Apr 3, 2015 #7 of 26
    davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    I PRESUME that means you'll include in it my requested HME queing app that this thread is about, right?
     
  8. Apr 3, 2015 #8 of 26
    wmcbrine

    wmcbrine Well-Known Mumbler

    11,690
    808
    Aug 2, 2003
    This is an app for dealing with RSS feeds. Only.
     
  9. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    month, maybe two later...

    just curious how things are going with that, Allanon.

    No pressure - I haven't been doing much with my projects lately, either.
     
  10. Allanon

    Allanon Active Member

    909
    151
    Nov 2, 2005
    Sorry, I lost interest in the project. I read your other post speculating if HME is going away and though maybe I'll wait to see what happens before spending anymore time on this project. I only started the project because I just learned how to use the Python Coherence module which is an API for manipulating UPNP servers and clients. My TV, Xbox 360, Bluray player, and Kodi media server all have UPNP clients so I really don't need one on the Tivo. I was just doing it because I could. I got it working but the part I dread is creating a good user interface and making it stable enough for the general public. I thought announcing the project would make me more motivated to finish but it didn't, sorry.
     
  11. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    No problem, I don't blame you. I haven't been feeling inspired at all lately, myself.

    Any other takers out there for this push-a-video project?

    FYI, I'm fine with writing the HME app myself and just having the other developer provide me some sort of command-line call or URL request to activate something for a push (or to generate a URL for a transcoded video stream for the video-capable devices)
     
  12. ntlord

    ntlord Member

    184
    1
    Nov 30, 2013
    This would be pretty easily done with Plex. The URL would need to be auto generated though. HME is java right? If I wrote a java plex URL generator would that do the trick for you?

    How would you get past the GB limit? My recollection was that there was some sort of limitation on the amount of video that could be played on the tivo.
     
  13. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    Well, *I* do HME with Java anyhow (there are other options).
    Yeah, most likely that would do it. Thanks!

    Let's see, we were talking about the "push this URL to the TiVo" right? If I write the HME app, what I'd need is to be able to call a function, executable, or web service (URL). I would pass it the Internet URL of the video file and its mime type (I'd also have title, subtitle, description, and time length in some cases if that's somehow useful), and I'd need to pass it the TiVo TSN. It would do whatever it does and I'd just tell the user to look in their "now playing" screen.

    Let me know if I got mixed up and you meant this was for Plex to provide a transcoded video stream for direct playing of non-mpeg videos. It's been a long day.
    That turned out to be a technical glitch on our side, not really a TiVo issue... I think it was moyekj who found it... I believe it had something to do with required headers in the sender, so this would actually apply to what you write, most likely.
    I'll try to dig it up this weekend if nobody speaks up.

    Oh...and that sounds more like the direct playing stream. The pushing doesn't have this issue as far as I know. I don't know much about pushing, though.

    I'll stop now before I make things more confusing and will pick up after I hear from you what you were planning and after I've had some rest ;]
     
  14. ntlord

    ntlord Member

    184
    1
    Nov 30, 2013
    I see, I missed the "push" part.

    I don't know much about pushing stuff to the tivo, are their any explanations out there about how it is accomplished?

    Plex has a couple of different streaming/transcoding options:

    (1) HTTP <- I think it just dumps the transcoded video into HTTP responses.
    (2) HLS/MPEG-dash <- file is transcoded into invdidual videos and sound files, and you can make HTTP gets to PLEX to get each file.

    I'm guessing option number 1 is how we would want to go, but I would need to understand a bit more about how to push video to a tivo.

    Now, the streaming limitation being removed, I find more interesting. Do you have a thread where you figured out how to remove the limit? I ask because given the upcoming Plex application's 720p limitation, this may be a way to avoid it. Will streaming work on the mini?
     
  15. moyekj

    moyekj Well-Known Member

    12,157
    809
    Jan 23, 2006
    Mission...
    I'm pretty sure I told you about a while back. That was one of my main updates to "revived streambaby" was fixing that long time issue. There were 2 important parts to the fix:

    1. Need to wrap/extend Java InputStream class to change available() method so that it always returns something (non-zero)
    2. Content headers need to be present which indicate how may bytes are needed to be reserved by TiVo for the stream:
    Accept-Ranges
    Content-Range
    Content-Length

    #2 is fairly obvious but for on-the-fly transcoding streambaby wasn't specifying them, so easy fix was just to always specify more than you need (streambaby now defaults to 20GB buffer size).

    #1 was much less obvious and I don't quite remember how I figured that out.

    EDIT TO ADD: No, HME streaming doesn't work on the Mini because HME streaming actually works by copying stream to buffer on the TiVo side, and of course the Mini doesn't have that capability.
     
    Last edited: May 21, 2015
  16. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    Thanks for that info, moyekj.

    Push is a whole thing. RPC Mind commands using the specific TiVo's MAK and stuff. Let's let somebody that has worked on it do that one. (If push comes to shove, I'll steal the code from Streambaby ;] )

    Instead, the other thing I've been wanting that it sounds like you can do is to transcode video found/clicked from EWz. It would be launched in a locally-installed app that can deal with the transcoding. I already have the architecture in place in EWz for this feature, but no app to launch.

    I can write a simple video player app that the user installs somewhere and spits out instructions on how to configure EWz to point at it. EWz will launch that app with the aforementioned arguments. In fact, I'll start with something funky like my app just preps everything, then launches TiVo's video player app with the new URL... assuming that won't crash the TiVo ;]

    It will call your code (to get an HTTP URL out of Plex given an Internet URL (video/*)), and the video player will start playing THAT URL instead of the Internet URL.

    This will solve problems with HTTPS urls (TiVo refuses to handle them, so EWz just drops the S and crosses its fingers) and of course all the video formats the TiVo can't handle natively. I'm hoping that Plex will also deal with redirects. If I'm REALLY lucky, Plex can also handle YouTube (and other proprietary/hard to extract video sites)... but I don't think I'm that lucky.

    As for the 1.1GB limit, I suspect we're stuck with "Plex either does the HTTP headers correctly or it doesn't" which will decide for us if we have the 1.1GB issue.
     
  17. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    I guess that's easier than I was thinking, moyekj... looks like your "Mind.java" class has the push command almost self-contained. The only thing I'd need to do is get the list of TSN's on the network for the user to choose from which is probably easy somewhere else in your code, but certainly something I've done before, too.

    If I do this, moyekj, what is your preference for how I include it...or do you even care?
    I can just pull the relevant source files and include them in my compile, or I can require a copy of your jar file in the classpath, or maybe you could even pull the necessary classes into a separate jar that I'd include in the distribution.

    ... maybe I have something to work on this holiday weekend.

    But what can be pushed? what are the URLs relative to: the TiVo or tivo.com (or is it relative to the mind server, and if so, is it true that one could identify the tivo as the mind server?) I ask because I'd like to push direct Internet URLs where possible, as well as local-network transcoder URLs where necessary.
     
  18. moyekj

    moyekj Well-Known Member

    12,157
    809
    Jan 23, 2006
    Mission...
    You can copy whatever source code you want - I don't care.
    I've always used push for home served videos, but you may be able to get it working with internet URLs. I can't remember if there are special requirements for serving up video for a push or not. You'll have to look at Streambaby or pyTivo code to see.
     
  19. ntlord

    ntlord Member

    184
    1
    Nov 30, 2013
    Ok. I might have misunderstood what you are looking for. All plex can do is serve up videos in a transcoded fashion that you have already added to plex.

    If I understand what you are looking for correctly. You want some sort of transcoding solution where you pass it a "source" of an html5 video tag? Then it transcodes it on the fly and sends it back to a tivo using RPC push, where a custom video player app would play it? This still seems possible if all you are looking for is video tag support. However, if you want it to do flash, that might be more difficult. I'm also not sure it would work with anything that had DRM.
     
  20. davidblackledge

    davidblackledge Registered lÜser

    563
    36
    Sep 9, 2008
    NM
    Nah, not flash necessarily... and it's not necessarily a video tag, either. I'd pass it a URL that may or may not be extracted from a Video tag, but it should be all the same to you.
    I will just try to do this for every mime video/* I come across that a user clicks (like video/mp4, or video/quicktime but it might be video/x-flv which is flash). You can either just return failure if it's not a supported format, or you can give me a list of what Plex supports and I'll not pass those ones to you.

    So, if I understand, your code would add the video URL it to Plex, and give back a URL that can stream/download the transcoded version of that video. I'd decide what to do with that URL (either push it if this is a Mini that's connected, or play it if it's a streaming capable TiVo).

    If there are ways Plex supports adding more complicated content (Vimeo, YouTube...) for this purpose that'd be even cooler.

    Will the URL returned be a web page, or a "download" link (URL ending e.g. .mp4)? I need a download link (I'll just extract it if it's a web page)


    I suppose, if adding to Plex is a "permanent" add, then I'd like the ability to delete the video after they're done with it, too, but that's not critical.
     

Share This Page