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. May 8, 2007 #461 of 5684
    1up

    1up New Member

    11
    0
    Apr 22, 2007
    Thanks for all the help dlfl! After screwing around for about 20 hours :eek: (running back & forth between the living room & my office dozens of times) I finally got it working. It's an ugly cludge, but it works ;-) Here's what I changed in pyTivo.py (I also indented the original code.):
    Code:
                else: #this is a 4:3 file or 16:9 output not allowed
                    [COLOR=Red]if (inFile[-4:]).lower() == '.vob':#EWB custom - if vob assume 740x480 and pad
                        settings.append('-aspect')
                        settings.append('4:3')
                        settings.append('-s')
                        settings.append(str(634) + 'x' + str(360))
                        endHeight = int(((TIVO_WIDTH*height)/width) * multiplier4by3)
                        topPadding = ((TIVO_HEIGHT - endHeight)/2)
                        settings.append('-padtop')
                        settings.append(str(+60))
                        bottomPadding = (TIVO_HEIGHT - endHeight) - topPadding
                        settings.append('-padbottom')
                        settings.append(str(+60))
                        settings.append('-padleft')
                        settings.append(str(40))
                        settings.append('-padright')
                        settings.append(str(46))
                    else:[/COLOR]
                        [COLOR=Blue]settings.append('-aspect')
                        settings.append('4:3')
                        endHeight = int(((TIVO_WIDTH*height)/width) * multiplier4by3)
                        if endHeight % 2:
                            endHeight -= 1
                        if endHeight < TIVO_HEIGHT * 0.99:
                            settings.append('-s')
                            settings.append(str(TIVO_WIDTH) + 'x' + str(endHeight))
    
                            topPadding = ((TIVO_HEIGHT - endHeight)/2)
                            if topPadding % 2:
                                topPadding -= 1
                        
                            settings.append('-padtop')
                            settings.append(str(topPadding))
                            bottomPadding = (TIVO_HEIGHT - endHeight) - topPadding
                            settings.append('-padbottom')
                            settings.append(str(bottomPadding))
                        else:   #if only very small amount of padding needed, then just stretch it
                            settings.append('-s')
                            settings.append(str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT))
                        debug_write(['select_aspect: File is wider than 4:3 padding top and bottom\n', ' '.join(settings), '\n']
    [/COLOR]
                return settings
            #If video is taller than 4:3 add left and right padding, this is rare. All of these files will always be sent in
            #an aspect ratio of 4:3 since they are so narrow.
    I also used your first code snippet:
    Code:
    def tivo_compatable(inFile):
        suportedModes = [[720, 480], [704, 480], [544, 480], [480, 480], [352, 480]]
        type, width, height, fps, millisecs =  video_info(inFile)
        #print type, width, height, fps, millisecs
    [COLOR=Red]
        if (inFile[-4:]).lower() == '.vob':#EWB custom addition for vob file types
            debug_write(['tivo_compatible: ', inFile, ' is .vob, will transcode\n'])
            return False[/COLOR]
    
        if (inFile[-5:]).lower() == '.tivo':
            debug_write(['tivo_compatible: ', inFile, ' ends with .tivo\n'])
            return True
    Finally, I kept the defaults in the pyTivo.config file. This works for my 4:3 television - for this DVD rip anyway. I'll have to see if my cludge ruins it for rips that aren't 720x480 and for TIVO compatible files. <fingers crossed>
     
  2. May 8, 2007 #462 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    1up,

    Well, looks like you're having fun and getting control of it! I can't completely analyze what you've done without knowing for sure what width you had set in the config file (or none?). You say the "defaults". Do you mean values that were already in the file as distributed or the true default, which is 544 width (which you get if you don't have a width= line at all)? (One distributed version had width=1440 and height=720, which are definitely not defaults in any sense.)

    You didn't say if you tried my last suggestion:
    If not, I hope you will try it -- I'm very curious to see if it works.
     
  3. May 8, 2007 #463 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    WAHOOOO!

    OMG, I can't even begin to explain how frustrating this whole process was, nor can I estimate the number of hours wasted on this. I would say I want to strangle an engineer's neck at TiVo, but I received some good news from them(more on that later).

    2 Good things to report:

    1. Version 194 is stable and supports subfolders in TiVo software version 8.3 :D . It is available on the wiki. If after you install it you have issues, try restarting your TiVo once to clear the cache, and note that you can only have ONE server(pyTivo, or TiVo.net(*I think)) on your network.

    The bad news, there are caveats to it I am afraid. Here is what I can think of so far, I am sure there are more.

    MAJOR CAVEAT - YOU CAN ONLY HAVE ONE SERVER IP ON YOUR NETWORK
    You can still have multiple folders listed in your configuration file. You just can't have a server at one IP and another server at another IP. ** I believe you can still have a non-subfolder server at another IP, such as desktop 2.4, but I am not positive about this.​

    Browsing is slower - I had to add a sleep function of 25 milliseconds. Plus there are a lot of extraneous commands and lookups.

    Title Wrong - When descending from a folder the title will remain as the highest folder you entered. This is stuck this way till you reach the root folder. It is only cosmetic and is an error inside the TiVo code that I can't fix.

    New Setting in Config File - hack83 is a new setting under the server settings within the config file, if it is not present it will default to TRUE. So if you don't have version 8.3 on your machine or you just want to disable this function set hack83=false. For most people you don't need to worry about this since the default is true using your old config file will enable 8.3 support by default.

    That is all the problems I can think of right now.

    2. The next piece of good news is that I received a response from an individual at TiVo who said he will forward the issue onto the correct department and requested contact information for me. So hopefully this means we can get this bug solved soon and go back to using pyTivo normally. **Fingers Crossed**
     
  4. May 8, 2007 #464 of 5684
    TreborPugly

    TreborPugly Unreal!

    4,542
    0
    May 2, 2002
    Eastern TN
    Thanks for all your work! I'll be trying this out soon!
     
  5. May 9, 2007 #465 of 5684
    ScaryMike

    ScaryMike New Member

    205
    0
    Aug 23, 2002
    Madison, WI
    First off, THANKS! You rock. I'll give this a try tomorrow.

    Second, does this mean that we can't run the Unbox ondemand preview server? (if you are familiar with that).

    -Mike
     
  6. May 9, 2007 #466 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    I started with version 191 installation, replaced config.py, transcode.py, and httpserver.py with changeset 193 versions and video.py with the 194 version.

    Any time I enter a subfolder in the NPL I get the "This Group is empty" message. :confused: I've restarted pyTivo several times and gone in and out of the NPL several times.

    Here's some cut-n-paste from the command window:
    Note the middle one is when I entered a subfolder (pyTivo Main/more).

    TiVo and PC specs are in my signature block below.
     
  7. May 9, 2007 #467 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    ScaryMike No it only means video services similar to pyTivo. Like I said I think only another pyTivo or TiVo.net on another machine would cause an issue.

    hmm, ok not sure what is going on. First are you getting any errors on the PC. Second, can you enable debug and try going into a problematic folder for me and then post the debug log?
     
  8. May 9, 2007 #468 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    First, no not getting errors on the PC end.

    I tried to isolate the portion of the debug file starting when I went into the subfolder:
    The transcode messages correspond to the three video files that are in that subfolder.

    Hope this helps!
     
  9. May 9, 2007 #469 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    dlfl's, problem is fixed. The changes were half committed to the branch half to the trunk. So the post commit hook built a zip of the broken trunk. The branch will now build zip files as well. But my quick test with it I did have my tivo reboot, so I am going to leave it on the branch for a bit longer.
     
  10. May 9, 2007 #470 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    Huh? :confused:

    I got my new files by downloading the plain text full files from the appropriate changesets (193 and 194, trunk or branch per the changeset).

    Is there a fix to my empty subfolder problem? If so how do I get it? Is the distribution ver. 199 zip on the download page my fix? Is this the one that rebooted your TiVo?
     
  11. May 9, 2007 #471 of 5684
    1up

    1up New Member

    11
    0
    Apr 22, 2007
    dlfl, after your pevious post , I checked my pyTivo.config and you were right, it was set to 640x480 when I first tried inserting your code into transcode.py
    Code:
       [COLOR=Red] if (inFile[-4:]).lower() == '.vob':
            if aspect169:
                debug_write(['select_aspect: File is VOB, using 16:9 based on config\n'])
                return ['-aspect', '16:9', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)]
            else:
                debug_write(['select_aspect: File is VOB, using 4:3 based on config\n'])
                return ['-aspect', '4:3', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)] [/COLOR]
    
        multiplier16by9 = (16.0 * TIVO_HEIGHT) / (9.0 * TIVO_WIDTH)
        multiplier4by3  =  (4.0 * TIVO_HEIGHT) / (3.0 * TIVO_WIDTH)
    But even after commenting out the width & height lines in my pyTivo.config the result was the same - the picture was filling the TV screen with no padding.

    By 'defaults', I meant that the width & height (W&H) were commented out (I'm pretty sure that's how it was upon installing). But I also tried every permutation possible. I tried the following changes to pyTivo.config first with, and then without, your mod to transcode.py:
    W&H commented out; aspect ratio (AR) set to 16:9
    W&H commented out; AR 4:3
    width=720; height commented out; AR 16:9
    width=720; height commented out; AR 4:3
    width=640; height commented out; AR 16:9
    width=640; height commented out; AR 4:3

    I also tried some of the above with the height at 426 and then at 360. And I also tried some of the above with the width at 544. Still no joy. Only after playing around with the padding in the select_aspect(inFile, tsn = '') function did I start seeing some results. I then tried all those permutations again with different changes to select_aspect function, but found that I could only get the results I wanted by using what I finally came up with. (I tried combining all of my custom code lines into one line, but I don't know enough about python coding and it kept breaking, so I left it as is.)

    I tried it today with another 720x480 DVD and it works great, but I haven't tried it with a vob file that isn't 720x480 yet. Hopefully this solution can be incorporated in some fashion into pyTivo by the developer(s). (Like write some code that detects 720x480 videos and pads according to my coding?)

    Anyway, thanks again for all your help dlfl!
     
  12. May 9, 2007 #472 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    1up,

    I'm confused. :confused:
    As I understand it, when you tried it "my way" you observed:
    Isn't that the desired result if your source is a 4:3 VOB and your TV is 4:3 ? (Why would you want black bands at sides or top/bottom in that case?)
     
  13. May 9, 2007 #473 of 5684
    johnkfisher

    johnkfisher New Member

    18
    0
    May 7, 2006
  14. May 9, 2007 #474 of 5684
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    dlfl:

    Always getting an empty folder seems to be a result of having or recently having had a other server serving subfolders running.

    johnkfisher:
    Any file named pyTivo-xxx.zip is from the trunk and is the "stable" version, which at this point has no extra support for subfolders on 8.3

    Any file named pyTivo-subfolders-8.3-xxx.zip is from the subfolders-8.3 branch and has experimental support for subfolders on 8.3, but being experimental may cause tivo crashes , burn your house down and eat your dog (Not that I am saying the trunk will not, it is just much less likely).
     
  15. May 10, 2007 #475 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    You forgot and leave you daughter knocked up.
     
  16. May 10, 2007 #476 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    And don't forget: steal your pickup truck. You guys are getting loopy from all the hacking on the 8.3 problem, I think! ;)

    I get the same subfolder result with 191, 194, 198 and 199: Nothing shows in the NPL for subfolders. :( Maybe a reboot before each test would make a difference (?) (But not tonight.)

    I suppose TiVo won't change anything until their next scheduled update.

    Thanks for your efforts. :up: Even if I had to live with the 191 functionality indefinitely it's a great app!
     
  17. May 10, 2007 #477 of 5684
    TreborPugly

    TreborPugly Unreal!

    4,542
    0
    May 2, 2002
    Eastern TN
    I just put the subfolders-8.3-198.zip up, replacing everything in my pyTivo folder with the stuff in this zip, and then editing the config file to look at the right ffmpeg location, to look at the right folders for my videos, and to use 1024K as the video bitrate.

    Subfolders appear to be working fine, without rebooting my Tivo or my computer. I started a transfer of a video in a subfolder, and that started transferring fine too.

    So thanks a bunch!


    one question:
    In the pyTivo,conf file, why is the video bitrate setting, which is commented out by default, "3Mi"? What does that mean? Am I correct that I can edit this to be something like 1024K or 2048K?
     
  18. May 10, 2007 #478 of 5684
    dlfl

    dlfl Cranky old novice

    6,997
    18
    Jul 6, 2006
    Near...
    You are correct about the bitrate setting. It is defaulting to 4096k if commented out. The 3Mi means 3 mega-bits per second .

    Question: What model is your TiVo? As you see above my model 649 can't even see anything in subfolders with the 198 version (or any other version).
     
  19. May 10, 2007 #479 of 5684
    TreborPugly

    TreborPugly Unreal!

    4,542
    0
    May 2, 2002
    Eastern TN
    Series 2 stand alone, with serial number starting with 140.
     
  20. May 10, 2007 #480 of 5684
    KRKeegan

    KRKeegan Im lost and confused

    215
    0
    Jul 20, 2004
    Los Angeles, CA
    Update - SubFolders version 200

    This might be slightly faster in scrolling. I had an epiphany this morning and I went back and simplified the code.

    I also fixed some logic errors that were present in the code. I dont think it will change anything, but now the path to each step makes more sense.

    Finally, I also added some more debug points to try and help solve some issues.

    dlfl I am not giving up on you. I am still willing to try and solve your issue if you are willing to tinker some more with me. If you could install Subfolder 8.3 and repost your debug file that would help. It was lacking some information for me before. Hopefully this will help me figure out what is happening.
     

Share This Page