1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tivo Proxy Server

Discussion in 'Developers Corner' started by Allanon, Jul 22, 2012.

  1. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Tlc, please give more information. What video player were you using to access Tivo Proxy Server? Did this happen while the video was playing or before seeing any of the video? Did TivoDecode start? Describe what you were doing when the error occurred.
     
  2. tlc

    tlc Member

    710
    0
    May 29, 2002
    The Broken pipe (SIGPIPE) happened when I was trying to test through a ssh tunnel from work with VLC. We have a crappy connection at work, so I can imagine the pipe getting full. But IIRC, that should give EWOULDBLOCK, not SIGIPIPE. (I don't know python does with these though.)

    I saw zero video, but based on my print statements, the read/write loop ran MANY times before the exception.


    Today I tested at home and it worked. But sometimes the connection fails (and VLC tries the next one). Sometimes it fails for many before one catches. VLC writes:
     
  3. telemark

    telemark New Member

    1,544
    1
    Nov 12, 2013
    Most internet connections will have trouble keeping up with an HD stream coming from a Tivo. Keep in mind, Tivo Corp invented the Stream for this reason.

    Using an SSH tunnel will limit the bandwidth available even more.

    I would test the bandwidth available between those two points over SSH before thinking there's anything wrong with the software.
     
  4. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    I guess the pipe can be overflowing. TivoDecode may be decoding the video faster than it can be sent through the SSH tunnel making the pipe back up and overflow. I only have a Tivo HD which doesn't have very fast video streaming so this isn't a problem for me but if you have a newer Tivo that can stream fast then maybe this is your problem.

    Right now there is no buffering on the pipe but you can change bufsize to -1 in the following code and it will add a buffer:
    Code:
    decode = subprocess.Popen(cmd, shell=False,bufsize=0,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
    The connection fails and VLC skips when the video is copy protected but I don't get those errors. You might try rebooting the Tivo.
     
  5. a_gizmo

    a_gizmo New Member

    14
    0
    May 8, 2014
    I know it's been several months since anything was posted in this thread, but I wanted to know if I have to do anything special to make Tivo Proxy Server work for PS3MediaServer. I've have tivodecode & Tivo proxy server setup and working on my Ubuntu server and can watch unencrypted streams on my laptop using VLC.

    I just started setting PS3MS up for the first time got local video playback to work to my PS3. To use the TiVo as a source I I added the following code to my WEB.conf file.
    Code:
    # video feeds
    videofeed.Web,Tivo=http:/isengard2:10000/rss <had to omit a "/" in the URL example because my post count is 1 right now>
    When I try to play a video from the Tivo through PS3MS I get the following error message in PS3MS regardless of trying to play it straight or transcode it through ffmpeg or Mencoder:
    Code:
    [Hanging External Process Stopper] External input stream instance is null... stopping process
    [New I/O worker #1] There is no inputstream to return for Red Band Society
    On Tivo Proxy Server's side the video starts to decode but PS3MS immediately disconnects.
    Code:
    
    Decoding video
    
    
    /home/tony/tivo/tivodecode-0.2pre4/tivodecode
    
    Encryption by QUALCOMM ;)
    
    Disconnect
    ----------------------------------------
    Exception happened during processing of request from ('192.168.1.251', 52750)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
        self.finish_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
        self.finish()
      File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
        self.wfile.close()
      File "/usr/lib/python2.7/socket.py", line 279, in close
        self.flush()
      File "/usr/lib/python2.7/socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 32] Broken pipe
    ----------------------------------------
    The "Broken pipe" error looks to appear whenever a video stream stops. I got the error message when watching a video through VLC directly from Tivo Proxy Server and pressing stop.

    I wonder if my problem has more to do with PS3MS not being able to parse out the URL. Any ideas what I need to do to get this working?

    Thanks,
    a_gizmo
     
  6. telemark

    telemark New Member

    1,544
    1
    Nov 12, 2013
    Yes, "Broken Pipe" is an internal error that you could remap in your head to, connection terminated.

    Is the RSS feed rendering correctly? And then you select a file and that's when it breaks?

    If so, have you tested the file format compatibility yet?
    Download a show from the Tivo,
    tivodecode but leave it in .TS format.
    Feed it to PS3MS, see what happens.

    If you use kmttg or pytivo, you'll have to find the right settings to just decode.
     
  7. a_gizmo

    a_gizmo New Member

    14
    0
    May 8, 2014
    Thanks of the suggestion telemark. Yes, the RSS feed is rendering correctly. Through VLC I can view the feed and play the recordings back with no issues. I will try your suggestion of testing format compatibility in PS3MS by manually downloading, decoding a recording, and sharing it to my PS3. I'll report back my findings.

    Thanks,
    a_gizmo
     
  8. Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Berkinet posted code that handles errors and removes that message from being displayed.

    I wrote this program hoping it would work with media servers. I tested PS3MS, TVersity, Plex, etc. but the only one I could get it to work with was Serviio. Serviio met all my media server needs so I stopped trying to get it to work with others.

    The main problem is probably the way it handles the responses to the video requests. I really don't know a lot about proper responses to HTTP requests so I just copied code from Internet samples. I think more robust HTTP response handling will be needed to get this working with other media servers. I don't have plans to do that since my media server needs are met using Serviio.
     
  9. Nov 1, 2014 #129 of 133
    a_gizmo

    a_gizmo New Member

    14
    0
    May 8, 2014
    I downloaded a video using tivodecode and saved it locally on my server. There were no issues streaming the mpegts tivo file to my PS3.

    I assume your right. WGET and CURL have issues downloading directly from the url provided by Tivo Proxy Server. I'm unfortunately not programmatically inclined so I can't offer a solution. It was a fun thing to try even though I can't get it to work for my particular situation. Thanks for making Tivo Proxy Server. It's a really cool script.
     
  10. Nov 1, 2014 #130 of 133
    telemark

    telemark New Member

    1,544
    1
    Nov 12, 2013
    I'm fluent in HTTP so if that's the problem I could probably fix it.

    I can't find a license attached to the code though. The original author(s) have to specify that it's under an open source license, public domain, or none of the above.
     
  11. Nov 1, 2014 #131 of 133
    Allanon

    Allanon Member

    581
    0
    Nov 2, 2005
    Do whatever you like with my code, it's public domain.
     
  12. Nov 2, 2014 #132 of 133
    telemark

    telemark New Member

    1,544
    1
    Nov 12, 2013
    This fixes wget and curl.
    Code:
    # diff orig/Tivo\ Proxy\ Server.py Tivo\ Proxy\ Server.py 
    234c235
    <                 self.send_header('Content-Length','0')
    ---
    >                 #self.send_header('Content-Length','0')
    
    I don't know what it breaks if anything.
     
  13. Nov 3, 2014 #133 of 133
    a_gizmo

    a_gizmo New Member

    14
    0
    May 8, 2014
    Commenting out that line of code definitely made a difference. Using I was able to successfully stream a show from my Tivo to the PS3.
     

Share This Page