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

pyTivo - Transcoding server

Discussion in 'TiVo Home Media Features & TiVoToGo' started by armooo, Nov 25, 2006.

  1. zundian

    zundian New Member

    63
    0
    Mar 5, 2008
    OK, let's forget about the previous problem, because I got it all sussed out. New problem: When transferring video to my new Premiere everything shows up postage boxed, so I need to zoom in on it to fill the screen. The exact same videos on my TiVo HD are full screen (HD). I even upped the height and width to 1920x1080, with the same results.
     
  2. bschuler2007

    bschuler2007 Frustrated owner

    325
    0
    Feb 25, 2007
    wmcbrine,
    I was thinking recently about Tivo's inability to play items in random order from one of it's NPL folders and how sad it is that Tivo was never able to fix this, and then I came up with this idea for pytivo:
    In pytivo.cfg, add in with Type and Path, Israndom=Date or something like that. Then have pytivo, when it transfers something from that folder, it randomizes it's recorded on date. This would give Tivo the ability to play in random based on it sorted via Date Recorded. You could also have instead of random dates, random file naming as an option for those who wanna sort via Alphabetically.
    So is this possible, sound doable, etc? or is there a simple method to do this I already overlooked. I would love this ability added to pytivo if possible.
     
  3. wmcbrine

    wmcbrine Ziphead

    10,403
    43
    Aug 2, 2003
    bschuler: It's possible. But, it's not something I'd want to implement, sorry. It's a kludgy approach; random order might make more sense in a streaming app.

    zundian: When you replace the contents of your post like that, it's not marked as new, so lots of people will miss it. Anyway, it sounds like you need a newer version of pyTivo that recognizes the Premiere as an HD unit. That change was made on March 3rd, 2010.
     
  4. moyekj

    moyekj Well-Known Member

    11,261
    76
    Jan 23, 2006
    Mission...
    TS .TiVo files don't seem to transfer back to TiVos natively using pyTivo. Has anyone checked if latest TiVo Desktop software allows them to transfer back? Other than faster download speeds these TS TiVo files seem to be more trouble than they are worth.
     
  5. wmcbrine

    wmcbrine Ziphead

    10,403
    43
    Aug 2, 2003
    Yeah, pyTivo needs a little tweaking to be able to transfer them. I've been reluctant to mess with them until tivodecode gets fixed. The Mysterious Person who first provided the TS support patch for tivodecode told me privately that he knows how to fix it, but doesn't have time right now. But there's no theoretical reason pyTivo can't transfer them, and yeah, I'm pretty sure (though speaking as a non-user) that TiVo Desktop will do it (as of 2.8 or so).

    Potentially more interesting to me is to have pyTivo send fake, unencrypted .TiVo files generated on the fly, to include TS files, maybe even to include h.264 video. I know how to do it, but I've been short on time myself. Meanwhile, I actually did test it in an ad-hoc way, which unfortunately was not suitable to commit, with MPEG-2 PS only. It finally got the stupid episode numbers transferred, which was a big win.
     
  6. orangeboy

    orangeboy yes, I AM orangeboy!

    4,085
    0
    Apr 19, 2004
    East Moline, IL
    Does pyTivo try to resend a failed transfer? I saw this tonight:

    Code:
    2011-01-18 20:24:22,187 INFO  pyTivo.video.video: [18/Jan/2011 20:24:22] Start sending "\\SY-6BA-100\ToTivo\Some.Show.mp4" to TivoS4
    2011-01-18 20:24:22,187 DEBUG pyTivo.video.video: "\\SY-6BA-100\ToTivo\Some.Show.mp4" is tivo compatible
    2011-01-18 20:24:22,203 DEBUG pyTivo.video.qt-faststart: mp4 already streamable -- copying
    2011-01-18 20:26:32,155 INFO  pyTivo.video.video: [Errno 10054] An existing connection was forcibly closed by the remote host
    2011-01-18 20:26:32,155 INFO  pyTivo.video.video: [18/Jan/2011 20:26:32] Done sending "\\SY-6BA-100\ToTivo\Some.Show.mp4" to TivoS4, 0 bytes, 0.00 Mb/s
    
    I've got a hack in place that triggers off the "Done sending" message, writing out the file name to a text file. A push script reads the text file, and deletes any successful transfers before sending the request to pyTivo, in an effort to do some housekeeping. However, the forcibly closed connection terminated the transfer before completing. A couple hours later, I see this in the log:

    Code:
    2011-01-18 22:00:19,967 ERROR pyTivo: Exception during request from ('192.168.0.199', 58528)
    Traceback (most recent call last):
      File "C:\Python26\lib\SocketServer.py", line 558, in process_request_thread
        self.finish_request(request, client_address)
      File "C:\Python26\lib\SocketServer.py", line 320, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "C:\Program Files\pyTivo\httpserver.py", line 64, in __init__
        client_address, server)
      File "C:\Python26\lib\SocketServer.py", line 615, in __init__
        self.handle()
      File "C:\Python26\lib\BaseHTTPServer.py", line 329, in handle
        self.handle_one_request()
      File "C:\Python26\lib\BaseHTTPServer.py", line 323, in handle_one_request
        method()
      File "C:\Program Files\pyTivo\httpserver.py", line 95, in do_GET
        self.handle_file(query, splitpath)
      File "C:\Program Files\pyTivo\httpserver.py", line 165, in handle_file
        plugin.send_file(self, path, query)
      File "C:\Program Files\pyTivo\plugins\video\video.py", line 86, in send_file
        transcode.tivo_compatible(path, tsn, mime)[0])
      File "C:\Program Files\pyTivo\plugins\video\transcode.py", line 613, in tivo_compatible
        vInfo = video_info(inFile)
      File "C:\Program Files\pyTivo\plugins\video\transcode.py", line 645, in video_info
        mtime = os.stat(fname).st_mtime
    WindowsError: [Error 2] The system cannot find the file specified: u'\\\\SY-6BA-100\\ToTivo\\Some.Show.mp4'
    
    It looks like pyTivo tried to resend the file but couldn't, because it had already been deleted. I was unaware of a "retry" option.
     
  7. moyekj

    moyekj Well-Known Member

    11,261
    76
    Jan 23, 2006
    Mission...
    It's not pyTivo resending, it's the TiVo re-requesting. Once you queue something up at mind.tivo.com (which is what push does) unless the queued entry is cleared then TiVo will keep asking for it each time it checks in. Unfortunately the reverse engineering of mind.tivo.com didn't come up with a way of managing the mind.tivo.com queue directly (specifically querying what is queued up and clearing out the queue would be useful), so sometimes there can be stuck entries in the queue. I haven't used push in a while but I seem to recall usually after a failed request though the queue clears up and won't be tried again, but perhaps depending on type of failure it may not clear the entry.
     
  8. orangeboy

    orangeboy yes, I AM orangeboy!

    4,085
    0
    Apr 19, 2004
    East Moline, IL
    Ah - makes sense. I may have to adjust my housekeeping script to query the NPL to assure that indeed the transfer was successful before deleting the files.
     
  9. sirfergy

    sirfergy New Member

    288
    0
    May 18, 2002
    I'm pushing an h264 video file to my Premiere and pytivo is using mpeg2 as the video type. Any reason why it wouldn't push the original video?

    Stream info:

    Stream #0.0: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc

    Stream #0.1(eng): Audio: dca, 48000 Hz, 5.1, s16, 1536 kb/s

    Stream #0.2(eng): Audio: ac3, 48000 Hz, stereo, s16, 224 kb/s

    Logs snippets:

    2011-01-24 18:03:24,961 DEBUG pyTivo.video.transcode: aspect169: True
    2011-01-24 18:03:24,963 DEBUG pyTivo.video.transcode: optres: False

    2011-01-24 18:03:24,987 DEBUG pyTivo.video.transcode: transcoding to tivo model 748 using ffmpeg command:
    2011-01-24 18:03:24,989 DEBUG pyTivo.video.transcode: C:\Program Files\pyTiVo\bin\ffmpeg.exe -i Movie.mkv -vcodec mpeg2video -b 16384k -maxrate 30000k -bufsize 4096k -ab 448k -ar 48000 -acodec ac3 -copyts -threads 4 -f vob -
     
  10. moyekj

    moyekj Well-Known Member

    11,261
    76
    Jan 23, 2006
    Mission...
    mkv container not supported by TiVo, only mp4 container can have H.264. Plus primary audio needs to be ac3.
    See video_compatibility
     
  11. sirfergy

    sirfergy New Member

    288
    0
    May 18, 2002
    I thought container didn't matter since ffmpeg can easily swap to mp4. I understand audio needs to be converted.
     
  12. moyekj

    moyekj Well-Known Member

    11,261
    76
    Jan 23, 2006
    Mission...
    It's basically a binary decision for pyTivo. If anything is not compatible then transcode to mpeg2 is done, so it's up to you to get it into proper format to avoid transcode. Utilities such as orangeboy's script can help:
    mkv2tivomp4.bat
     
  13. jcthorne

    jcthorne Active Member

    2,769
    14
    Jan 28, 2002
    Houston
    ffmpeg cannot convert from mkv to a streamable mp4 on the fly. That is why it must be converted ahead of transfer.
     
  14. wmcbrine

    wmcbrine Ziphead

    10,403
    43
    Aug 2, 2003
    Yeah, streamable MP4 is the key problem, otherwise we'd do it. What moyekj said is how pyTivo used to work, but it's slightly more sophisticated now -- it can separately reencode only the video or audio, or only do a remux (in the case of an MPEG-2 transport stream or MPEG-1 video). Unfortunately this doesn't help with h.264. But if I can only get the TiVo to accept transport streams...
     
  15. jcthorne

    jcthorne Active Member

    2,769
    14
    Jan 28, 2002
    Houston
    Ahh the holy grail to eliminate all this file manipulation prior to pytivo push:eek:.....Sure hope it gets to that.

    On a similar subject, has anyone tried pushing NON streamable mp4s to a Premiere on the latest version (14.7) software? I was told it just may work now. If so, pytivo could transcode to mp4 on the fly.....
     
  16. orangeboy

    orangeboy yes, I AM orangeboy!

    4,085
    0
    Apr 19, 2004
    East Moline, IL
    I see that pyTivo supports flac files in a roundabout way, using ffmpeg to transcode into mp3. I'm good with that. So I setup a new section through the Web Configuration named "Led Zeppelin Music" (without quotes), Saved changes, edited the new section to set the type to "music" (without quotes), gave it the UNC path that contains the root folder to my flac file collection, then soft-reset pyTivo. The problem I have is that I can't find "Led Zeppelin Music" anywhere on my TiVos.

    I tried to bounce the Windows Service, which caused another problem: "Could not start Service. pyTivoService.exe is not a valid Win32 application." Fine. Dunno what caused that; The Service stopped and started without issue since I installed and upgraded it countless times. I fixed that by editing the Windows Registry to include quotes around the path to pyTivoService.exe (found at HKLM\SYSTEM\CurrentControlSet\Services\pyTivo). Started the Service, same thing - no music. I just restarted the TiVo, same thing - no music.

    What am I missing?

    Dunno if this is relevant in any way:
    Code:
    2011-01-26 22:16:43,703 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:43] "POST /TiVoConnect HTTP/1.1" 200 -
    2011-01-26 22:16:44,515 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:44] code 404, message Not Found
    2011-01-26 22:16:44,515 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:44] "GET /favicon.ico HTTP/1.1" 404 -
    2011-01-26 22:16:49,078 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:49] "GET /TiVoConnect?Command=Settings&Container=Settings HTTP/1.1" 200 -
    2011-01-26 22:16:49,842 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:49] "GET /main.css HTTP/1.1" 200 -
    2011-01-26 22:16:49,842 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:49] "GET /plugins/settings/settings.js HTTP/1.1" 200 -
    2011-01-26 22:16:49,858 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:49] "GET /plugins/settings/settings.css HTTP/1.1" 200 -
    2011-01-26 22:16:50,421 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:50] code 404, message Not Found
    2011-01-26 22:16:50,421 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:50] "GET /favicon.ico HTTP/1.1" 404 -
    2011-01-26 22:16:55,375 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:55] "GET /TiVoConnect?Command=Reset&Container=Settings HTTP/1.1" 200 -
    2011-01-26 22:16:55,390 INFO  pyTivo.settings: pyTivo has been soft reset.
    2011-01-26 22:16:56,108 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:56] code 404, message Not Found
    2011-01-26 22:16:56,108 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:56] "GET /favicon.ico HTTP/1.1" 404 -
    2011-01-26 22:16:58,578 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:58] "GET /TiVoConnect?Command=Settings&Container=Settings HTTP/1.1" 200 -
    2011-01-26 22:16:59,280 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:59] "GET /main.css HTTP/1.1" 200 -
    2011-01-26 22:16:59,280 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:59] "GET /plugins/settings/settings.css HTTP/1.1" 200 -
    2011-01-26 22:16:59,296 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:16:59] "GET /plugins/settings/settings.js HTTP/1.1" 200 -
    2011-01-26 22:17:00,592 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:17:00] code 404, message Not Found
    2011-01-26 22:17:00,592 INFO  pyTivo: 192.168.0.60 [26/Jan/2011 22:17:00] "GET /favicon.ico HTTP/1.1" 404 -
    2011-01-26 22:17:09,108 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:17:09] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:17:40,265 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:17:40] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:18:11,015 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:18:11] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:18:42,312 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:18:42] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:18:59,953 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:18:59] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:19:01,546 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:19:01] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    2011-01-26 22:19:09,765 INFO  pyTivo: 192.168.0.199 [26/Jan/2011 22:19:09] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -
    
    I generally don't like "Not Found" messages.
     
  17. wmcbrine

    wmcbrine Ziphead

    10,403
    43
    Aug 2, 2003
    If you notice, they're all in response to requests for "favicon.ico". :) This has no effect on anything. (And no, the rest of that log wasn't helpful, sorry.) I posted about this on the pyTivo forum, BTW, soliciting icons for possible use, but got no responses. :(

    Rather than explaining the steps you took to set up the share, please, just post your pyTivo.conf.

    Common issues:

    Music shares appear under "Music, Photos and Showcases", or whatever it's called now, rather than the NPL.

    The path to your files needs to be accessible by the user account pyTivo runs as, not just your regular desktop user account.

    Since you mention UNC paths, I'm guessing this is a network share? Personally I'd prefer to run pyTivo on the system where the files are, so they only have to traverse the network once. Of course the exception is if the files need to be transcoded, and that system isn't up to it.
     
  18. orangeboy

    orangeboy yes, I AM orangeboy!

    4,085
    0
    Apr 19, 2004
    East Moline, IL
    Nevermind - It shows up on my Series3, just not my Premiere. I'll dig into why that is.
     
  19. rassi

    rassi Member

    137
    0
    Jul 18, 2003
    NE Ohio
    I'd had PyTiVo working fine for a couple of weeks, and all of a sudden in the last few days it has been failing with the following error:

    Code:
    Traceback (most recent call last):
      File "C:\Python26\lib\SocketServer.py", line 560, in process_request_thread
        self.finish_request(request, client_address)
      File "C:\Python26\lib\SocketServer.py", line 322, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "C:\Program Files\pyTivo\httpserver.py", line 64, in __init__
        client_address, server)
      File "C:\Python26\lib\SocketServer.py", line 618, in __init__
        self.finish()
      File "C:\Python26\lib\SocketServer.py", line 661, in finish
        self.wfile.flush()
      File "C:\Python26\lib\socket.py", line 297, in flush
        self._sock.sendall(buffer(data, write_offset, buffer_size))
    error: [Errno 10054] An existing connection was forcibly closed by the remote ho
    st
    2011-01-28 19:13:19,144 DEBUG pyTivo.video.transcode: killing pid=4632
    Does this shed any light on what's happening?

    PyTiVo is running on Win 7-64 and we're transferring to an HDTiVo....
     
  20. orangeboy

    orangeboy yes, I AM orangeboy!

    4,085
    0
    Apr 19, 2004
    East Moline, IL
    My guess would be that you're using a wireless connection to the TiVo.
     

Share This Page