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. Apr 28, 2007 #381 of 5683
    Deadpan Science

    Deadpan Science New Member

    22
    0
    Jan 21, 2007
    I'm having trouble getting the sound to sync up with the video on some of my videos. Is there an option in ffmpeg that would help this? Also, how do I make pytivo use this option every time?
     
  2. Apr 28, 2007 #382 of 5683
    delvxe

    delvxe New Member

    6
    0
    May 28, 2006
    Videora was set to 2024k using a profile I have used many times before. The file size seemed very high - about 650 megs for 41 minutes of television. Can anyone confirm that this is unusually large? I would estimate that it took about an hour to transfer.

    I resolved the interlaced video problem. I vannot tell you which one fixed it, but I deleted the size settings defaulting to 544 x 480, entered my TSN, changed the 169 to false, and changed the bit rate to 2024k. Not sure which one of these fixed the problem, but it works fine now. 3 have to do some tests tonight to see if my transfer rate is better now. I will report back.

    Thanks again for the help and good work.

    Terry
     
  3. Apr 28, 2007 #383 of 5683
    johnkfisher

    johnkfisher New Member

    18
    0
    May 7, 2006
    Stupid Tivo. 8.3 ruined everything. Why they can't just make Tivo Desktop for Mac support folders.... seriously - it's like they want to ruin the goodwill they have for their product.

    Anyway, I tried the 192 video.py file on top of a 191 install, and, lo and behold, SELECTING A PROGRAM INSTANTLY CRASHES MY TIVO. Completely reproducible, puts me right back to "powering up..."

    (sigh)

    ( as a sidenote, even if it worked, it would be infuriating for the single level and paging issues - I'm sorting literally hundreds of prgrams this way - but it is awesome that it's being worked on so quickly, and I blame tivo for this, not armooo, whom I hope gets this straightened out soon.)
     
  4. Apr 29, 2007 #384 of 5683
    Tobashadow

    Tobashadow Read over there --->

    2,339
    0
    Nov 11, 2006
    Files from my internal hardrive are moved and used perfect but i tryed to use a folder on my network share since i was running out of internal hardrive room on my server machine and it threw a unknown error up on the tivo's screen when the folder in the NPL is opened.

    No firewalls in the way and i can access the files from the server machine from it's desktop with no problem.
     
  5. Apr 29, 2007 #385 of 5683
    TreborPugly

    TreborPugly Unreal!

    4,542
    0
    May 2, 2002
    Eastern TN
    I found that the service had to be using an account that could access the network drive, or that the network share had to allow guest access.
     
  6. Apr 29, 2007 #386 of 5683
    ocntscha

    ocntscha New Member

    149
    0
    Oct 22, 2003
    I've been banging around on Solaris 10 x86 this weekend, trying to learn more about it. Figured something fun to try would be running pyTivo on it.

    Unfortunately I'm stuck. It starts fine, and I can see it in Tivo's Now Playing List. But then attempting to "go into it" on the Tivo immediately results in an uknown error on the Tivo side and the following on the Solaris side.

    Help.

    Thanks,
    ocntscha


    Code:
    bash-3.00# python pyTivo.py 
    /usr/local/pyTivo/Cheetah/Compiler.py:1508: UserWarning: 
    You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.
      "\nYou don't have the C version of NameMapper installed! "
    192.168.1.8 - - [29/Apr/2007 09:31:38] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
    192.168.1.8 - - [29/Apr/2007 09:31:38] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
    192.168.1.8 - - [29/Apr/2007 09:32:00] "GET /TiVoConnect?Command=QueryContainer&Container=MyMovies&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F* HTTP/1.1" 200 -
    ----------------------------------------
    Exception happened during processing of request from ('192.168.1.8', 1796)
    Traceback (most recent call last):
      File "/usr/local/lib/python2.5/SocketServer.py", line 463, in process_request_thread
        self.finish_request(request, client_address)
      File "/usr/local/lib/python2.5/SocketServer.py", line 254, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/local/lib/python2.5/SocketServer.py", line 521, in __init__
        self.handle()
      File "/usr/local/lib/python2.5/BaseHTTPServer.py", line 316, in handle
        self.handle_one_request()
      File "/usr/local/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
        method()
      File "/usr/local/pyTivo/httpserver.py", line 64, in do_GET
        method(self, query)
      File "/usr/local/pyTivo/plugins/video/video.py", line 81, in QueryContainer
        t.files, t.total, t.start = self.get_files(handler, query, VideoFileFilter)
      File "/usr/local/pyTivo/plugin.py", line 52, in get_files
        files = filter(filterFunction, files)
      File "/usr/local/pyTivo/plugins/video/video.py", line 75, in VideoFileFilter
        return transcode.suported_format(full_path)
      File "/usr/local/pyTivo/plugins/video/transcode.py", line 293, in suported_format
        if video_info(inFile)[0]:
      File "/usr/local/pyTivo/plugins/video/transcode.py", line 287, in video_info
        millisecs = ((int(d.group(1))*3600) + (int(d.group(2))*60) + int(d.group(3)))*1000 + (int(d.group(4))*100)
    AttributeError: 'NoneType' object has no attribute 'group'
    ----------------------------------------
     
  7. Apr 29, 2007 #387 of 5683
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    Hello all, sorry it has been so long since i have been here. It will probably be another few days before I can contribute much. :( Sorry to the person who keeps bugging me for .srt support.

    Well I was blessed with the 8.3 update this morning. I have been running pyTivo 182 or something for a long time. But, this morning forced me to update. I updated pyTivo to the most current and patched in the 192 beta from armooo. It works, but only for one level deep folders. This is a good start I guess. I really really hate TiVo for this crap, this is a bushleague mistake on their part.

    I also had a problem with the reduce function in the nearest() subroutine of config.py. I don't know if this is a linux thing, but I can't have an "if" function nested in the reduce function. I found that pulling out the "if" function and making it another subroutine worked fine.

    I am glad to see pyTivo is still going strong as ever. Give me till about May 4th or so and I will start contributing again. Hopefully we can clean up this 8.3 mess pretty quickly.

    Kevin
     
  8. Apr 29, 2007 #388 of 5683
    dave843

    dave843 New Member

    35
    0
    Jan 9, 2005
    Fairfax, VA
    I am having this problem on Linux. Is there a release with this fix in it?
     
  9. Apr 29, 2007 #389 of 5683
    dlfl

    dlfl Cranky old novice

    6,997
    17
    Jul 6, 2006
    Near...
    My first suspicion would be the particular videos involved (does this happen for all videos, including some that transcoded OK before?).

    However, if you're running Windows, you could try a different version of ffmpeg. You can download a large selection from *** here ***. I've used ver. 8731 some with no problems. The distributed ver. is 8047.

    Remember the name of ffmpeg (ffmpeg_mp2.exe or ffmpeg.exe) must match what is in the pyTivo.Conf ffmpeg path parameter. You can rename ffmpeg or change the .conf file, whatever it takes.

    Have you changed your bitrate, width or height recently?

    Is the audio off by a constant offset throughout the video? There is an audio sync control command line option for ffmpeg "-async" which isn't used in pyTivo but I have seen it used typically in straight file-to-file cases. There is a possibility it doesn't work for the streaming output used by pyTivo. Anyway it is frequently set to "-async 1", which causes ffmpeg to adjust audio sync once at the start of the encoding (i.e., it would help you only if your offset is constant in a video).

    A simple edit of one line in transcode.py is all that would be needed to add this to the ffmpeg command line, if you want to try something like that.
     
  10. Apr 30, 2007 #390 of 5683
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    Hrm, I don't want to post a change without checking to see if there is a mre efficient way to do this. But here is the solution I scraped together at first glance.

    REPLACE:
    Code:
    def nearest(x, list): 
         return reduce(lambda a, b: a if abs(x-a) < abs(x-b) or (abs(x-a) == abs(x-b)and a>b) else b, list) 
    
    WITH:
    Code:
    def nearest(x, list):
        return reduce(lambda a, b: closest(x,a,b), list)
    
    def closest(x,a, b):
        if abs(x-a) < abs(x-b) or (abs(x-a) == abs(x-b)and a>b):
            return a
        else:
            return b
    
    That should fix you up. Give me a day or two to make sure I am not missing anything and I will commit it to the SVN.

    Armooo and Others:
    I know reduce() is going to be dropped from the next version of python. I don't know if that should be something we should take into account.

    Kevin
     
  11. May 1, 2007 #391 of 5683
    Tobashadow

    Tobashadow Read over there --->

    2,339
    0
    Nov 11, 2006
    You mind to give a how-to on that?

    I did the obvouis of replacing the file that came in the 187 install with the one that was in the zip file 192 found in the changes page and restarted the computer now i can still see the folder's in the NPL like before but cannot see what is in them it is blank. And so is one folder i have that has no sub folder's just files.

    Everything worked perfect before the 8.3

    I have a link called Movies which is just files - blank
    One called TV Show's - Show's subfolder name of the show but nothing inside.
    One Called Internet Downloads - Has aroun 10 different folders with stuff in them all blank now.

    The 187 showed everything that wasnt in a folder which was only my Movies folder after i got the 8.3 and before the 8.3 everything showed and worked.
     
  12. May 1, 2007 #392 of 5683
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    OK Quick howto to patch pyTivo for 8.3.

    Download a new copy of video.py and place it in the plugins/video folder. Replace the old one. And restart pyTivo.

    Here is the link to the new one video.py version 192

    Known issues with this patch:
    It will only go one folder deep. This isnt much of a fix. So it can open a pyTivo server from the NPL list and then go one more folder deep beyond that. But if you have another folder beyond that it wont be able to handle it.

    I know that armooo is working on this, and I will put in a few hours on the 4th to hopefully put an end to this new glitch that TiVo has created.

    Kevin
     
  13. May 1, 2007 #393 of 5683
    Airey001

    Airey001 New Member

    31
    0
    Oct 20, 2005
    I am new to pyTivo, I trying to move over to it from Tivo.Net. However I am having issues with pyTivo adding black bars (Buffers). There are 2 issue with this one i think is just how pyTivo work and the other can't figure out. I have 2 Tivos first a standard 2.5 series unit and and a DVD Tivo, both are connected to widescreen HDTV's.


    This first one i think is the way pyTivo works however being new to it I am unsure.
    I have a few files that are 4:3 formated when i transfer them with pyTivo they get these buffers going up the sides. Now i know with Tivo.Net I had to option to reconfigure files to the format i prefered. I can't stand watching them with the bars so i set them to be 16:9 and they strech to fill the whole screen. I don't see anything like this with pyTivo, and don't think it is possible yet.


    The second issue is I have videos that are encoded at 16:9 format and they also are getting the black bars up and down the side and the picture seems to be compressed into 4:3?

    I beleive i have the configuration set up correct and the aspect ratio on the Tivo is set to 16:9 so i am confused on this second one?


    Code:
    
    [Server]
    port=9132
    
    ffmpeg=/usr/bin/ffmpeg
    
    width=720
    height=480
    
    #Bed Room Tivo - Series2 - 200 GB
    [_tivo_565############]
    aspect169=true
    
    #Living Room Tivo - Series2 - 120 GB
    [_tivo_540############]
    aspect169=true
    
    [My Movies]
    type=video
    path=/Data_Drive/Tivo_Media_Library/Videos/
    
    [My Music]
    type=music
    path=/Data_Drive/Tivo_Media_Library/Music/
    
    


    Can any one help me out or point me in the right direction?

    Thanks



    PS:

    Its possible it maybe the way I encoded these files. I have been using the goback feature as a DVD on demand service. Up untill recently i was ripping my dvd's vob file and renaming it mpg since the tivos can play that data. But i started to use dvd::rip to convert the files to xvid to save hard drive space.

    The videos look good when displayed on the PC so i am not sure.
     
  14. May 1, 2007 #394 of 5683
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    First your config file looks good, i dont think we have any issues there.

    1. Stretching 4:3 to 16:9. No pyTivo doesnt do this. IMHO I dont think this should be a "feature" in pyTivo. I would assume that you can just stretch 4:3 video using the settings on your TV as if it was a broadcast 4:3 image.

    2. Your 16:9 videos being compressed to 4:3 format. That is strange. Can you enable the debug feature for me??

    Steps:
    1. Stop pyTivo
    2. Edit pyTivo.conf and insert the following line under the server settings:
    debug=true
    3. Start pyTivo
    4. Play one of the videos that you think should be in 16:9 format but is being compressed to 4:3, you can stop the transfer after the first few seconds.
    5. Stop pyTivo
    6. Remove the debug line from the config file
    7. Post the debug.txt file from the base directory as an attachment to a post here.

    Kevin
     
  15. May 1, 2007 #395 of 5683
    Airey001

    Airey001 New Member

    31
    0
    Oct 20, 2005
    Thanks for you help!

    I assume you are looking for this part of the debug file. Though the whole thing is attached.

    Code:
    
    select_aspect: File= /Data_Drive/Tivo_Media_Library/Videos//DVD's/A_NIGHT_AT_THE_MUSEUM_D1_WS-001.avi  Type= mpeg4  width= 720  height= 480  fps= 23.98  millisecs= 6515400  ratio= 150  rheight= 2  rwidth= 3 
    select_aspect: 16:9 aspect allowed, file is narrower than 16:9 padding left and right
     -aspect 16:9 -s 606x480 -padleft 56 -padright 58 
    
    
    I don't understand why it tells me the file is 720x480 then later on tells me it is only 606x480 and needs to pad it.

    If i open this avi file in xine or mplay it states the file is 720x480. Also if i take a screen shot from xine the pic it produces is 720x480.

    Also i am not using the newer video.py file for the 8.3 subfolder issue it is crashing my Tivo when i try to view files info.


    Thanks Again!
     

    Attached Files:

  16. May 1, 2007 #396 of 5683
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    Well shoot!

    Well you have a problem that I have discussed for a while but have not come across yet. Read this page for a description of what is occuring.

    The problem is ffmpeg cannot read the DAR as thus we have no way to know if you have non-square pixels. Most computer videos have square pixles, even the ones that are transcoded from DVDs.

    The only solution I can tell you right now is to transcode your videos using square pixels. I do however suspect videophiles will tell you that your way is better for preserving image quaility. Although I can say I can't see the difference.

    Actually, here if you want you can alter your script with the following. This will take any video with the dimensions of a DVD and assume it is 16:9. However, I must warn you that if you come across another video out there that is 720x480 and is not 16:9 it will look funny.

    Find this in plugins/video/transcode.py
    Code:
        elif ((rwidth, rheight) in [(16, 9), (20, 11), (40, 33), (118, 81), (59, 27)]) and aspect169:
            debug_write(['select_aspect: File is within 16:9 list and 16:9 allowed.\n'])
            return ['-aspect', '16:9', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)]
        else:
            settings = []
    
    And replace it with this:
    Code:
        elif ((rwidth, rheight) in [(16, 9), (20, 11), (40, 33), (118, 81), (59, 27)]) and aspect169:
            debug_write(['select_aspect: File is within 16:9 list and 16:9 allowed.\n'])
            return ['-aspect', '16:9', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)]
        elif (width=720) and (height=480) and aspect169:
            debug_write(['select_aspect: File is 720x480 forcing 16:9, this is a HACK.\n'])
            return ['-aspect', '16:9', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)]
        else:
            settings = []
    
    That should do what you want.

    Kevin

    EDIT
    The more I think about that edit the less I am thrilled with it. A resolution of 720x480 can be either 4:3 or 16:9. Thus I really don't recommend using the above edit.
     
  17. May 1, 2007 #397 of 5683
    dlfl

    dlfl Cranky old novice

    6,997
    17
    Jul 6, 2006
    Near...
    For another take on aspect ratio see this link..

    If you want your xvid avi's to be handled correctly by pyTivo, encode them to a format that matches the aspect ratio you want, e.g., 640x480 for 4:3 or 640x360 for 16:9 (This is equivalent to KRKeegan's advice to use "square pixels".) You can use larger or smaller numbers as long as the ratio stays the same and it's advisable to make both numbers multiples of 4. Do not be concerned with matching the xvid encoding dimensions either to the height or width of your input DVD, mpeg2 or VOB files -- doesn't matter. If your encoding software has DAR signaling in it you should set the DAR to 4:3 or 16:9 as desired (or set pixel aspect ratio PAR to 1:1). However pyTivo won't read either of these, it has to assume the DAR based on the dimensions you encoded to.

    Your Night at Museum xvid is encoded to 720x480 which pyTivo, having no other information, assumes means a DAR of 720:480 (i.e., square pixels) or 3:2 or 1.5. You have configured to display at 16:9 or 1.77. Thus your video isn't wide enough for 16:9 and pyTivo thus inserts the black sidebars. The encoding dimension from ffmpeg is 720x480 because that's what you've configured. The 720 is ths sum of the 608 plus the padleft and padright values. But it would be 720x480 whether you were encoding for 4:3 or 16:9 display. FFmpeg is putting the DAR value into the encoded mpeg2 stream and TiVo uses this to know whether the 720 width gets spread across 853 pixels (for 16:9) or across 640 pixels (for 4:3). (Note square pixels are not being used in either case.)

    For your 720x480 DVD (mpeg2 or vob) pyTivo sources, you have to set the aspect169 and your TiVo display aspect to whatever your TV is (16:9 in your case I think.) I agree with KRKeegan that I would not want pyTivo to stretch a 4:3 video just to avoid the black side-bars on a 16:9 display.

    This stuff is hard to explain -- ,and even worse maybe I don't really understand it myself! :rolleyes:
     
  18. May 1, 2007 #398 of 5683
    ocntscha

    ocntscha New Member

    149
    0
    Oct 22, 2003
    This is really directed at armoo, krkeegan, and/or anyone else who might be trying to code up a work around to the 8.3 problem.

    Surely you guys have at least considered having pyTivo just export a flat listing of files ala Tivo Desktop. I'm curious what your guys thinking on that is?

    My two cents worth on the topic would be, if you can't beat 'em join 'em. It ought to be possible to impliment a 100% glitch free flat file listing considering Tivo Desktop does. While certainly not as functional as folders it would completely remove the one and only rough edge pyTivo has. Even under 8.2 the user had to use any of several tricks with her remote control to work around folder display problems. I think it might be best to just forego folders in the interest of making pyTivo 100% polished all the way around. Yes, it would be a little less functional, but then there would be no glitches with it what so ever. I suspect making it that polished an application would make it appealing to all sorts of Tivo owners, not just the computer geeks.

    Now don't get me wrong, if you guys can pull off a nice glitch free folder implimentation then I'm all for it. Or, if its not possible to impliment folders without quirks, then maybe a configuration option flat=yes or flat=no. Flat=yes, the default, would yield a flat but glitch free listing. flat=no would let the user select an "experimental" folders option.

    One more thing, suppose you guys do code up some kind of genius work around for 8.3 problems, there's no guaruntee that no sooner will you be done coding it up than Tivo will roll out an 8.3a and muck everything up again. If you code pyTivo to be equivalent to Tivo Desktop "on the wire" then you shouldn't have to worry to much about Tivo OS releases breaking things.
     
  19. May 2, 2007 #399 of 5683
    Tobashadow

    Tobashadow Read over there --->

    2,339
    0
    Nov 11, 2006

    Well i guess i offical mucked my install of PyTivo since even after doing the above i have no change.
     
  20. May 2, 2007 #400 of 5683
    dlfl

    dlfl Cranky old novice

    6,997
    17
    Jul 6, 2006
    Near...
    Yeah. I was using the Ver. 192 video.py for the partial subfolder fix. It navigates the subfolders (one level down) OK but when I try to actually transcode a video from that level it reboots my TiVo! Tried it twice to be sure, then reverted to the Ver. 187 (same as 191) video.py. Then was able to navigate to the same video and transcode it, but of course the subfolders were no longer accessible after that one shot.

    Went back to ver. 192 video.py again to see if choosing a different subfolder video made a difference and now it won't even navigate to the subfolders -- just says they are empty or not available. Seems like the TiVo is remembering subfolders that were tried before and flagging them as unavailable.

    Looks like no subfolders for now at least.
     

Share This Page