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 2, 2007 #261 of 5683
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    Looks like you are running on python 2.4. In 2.5 the return value of urlparse changed. I just committed a a version that will work in 2.4 and 2.5 it is 185.
     
  2. Apr 3, 2007 #262 of 5683
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    OK, how many of you noticed this example video bitrate line in recent pyTivo.conf distributions:
    Now how many of you are honest enough to admit that, like me, you thought this must be a typo? (But you knew what was really needed was something like "4096K" so it didn't phase you.)

    Well I've gotten into the habit of googling "wiki <xxxx>" for any <xxxx> that puzzles me so finally I ended up at this Wikipedia page and lo and behold, "Mi" is an abbreviation for the binary prefix "mebi" which means (unambiguously) 2^20. These IEC prefixes are intended to avoid the ambiguity where "M" and "k" and "K" can mean different mulipliers depending on context -- and on the eyes of the beholder sometimes.

    OK, now 'fess up -- don't leave me thinking I was the only one...... :eek:

    BTW, I found you can use k, K, M, or Mi for the bitrate number in the .conf file. They are all accepted by ffmpeg . k and K have identical meanings. but M and Mi will give encoding rates that differ by a factor of 1.024. And 4Mi gives 4194kb encoding rate.
     
  3. Apr 3, 2007 #263 of 5683
    PeteTV

    PeteTV New Member

    44
    0
    May 6, 2006
    That works... well... that fixes the problem playing the music anyway.... now there's a different problem which also appears to be a 2.4 vs 2.5 problem.

    This appears right when starting the server.

    Code:
    $ python pyTivo.py
    Traceback (most recent call last):
      File "pyTivo.py", line 4, in ?
        import beacon, httpserver, os, sys
      File "/usr/local/pyTivo/beacon.py", line 3, in ?
        from Config import config
      File "/usr/local/pyTivo/Config.py", line 52
        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)
                                      ^
    SyntaxError: invalid syntax
    I compiled Python 2.5 and this error goes away and I can play music.

    NOW if only TiVo would enable video on the S3 I'd be a happy camper.
     
  4. Apr 3, 2007 #264 of 5683
    cyclone

    cyclone New Member

    18
    0
    Nov 17, 2004
    Silicon Valley
    I believe the blacklist is overly broad with regards to 16:9. My Tivo, TSN#540xxxxxxxxxxxx (Tivo-brand S2 80GB), works fine with 16:9, but "540" is in the blacklist in Config.py. Removing it allows the aspect ratio to work correctly.

    Perhaps more digits need to be used to set this appropriately?
     
  5. Apr 3, 2007 #265 of 5683
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    You might want to edit your post and take out the entire TSN since that's unique to your box (and account).

    Plus, IIRC, only the first three digits are needed to identify the actual hardware.
     
  6. Apr 3, 2007 #266 of 5683
    inthewoods

    inthewoods New Member

    11
    1
    Feb 21, 2005
    Dang, that is my fault...

    I'm a Python n00b and didn't realize that I was using a new language feature.

    If you want to preserve the 2.4 compatibility of pyTivo, then apply this patch, the symantics are slightly different in that when given an invalid width, this version will choose the next higher resolution instead of the nearest resolution, but in practice it shouldn't matter and it definitely is simpler:

    Code:
    Index: Config.py
    ===================================================================
    --- Config.py	(revision 185)
    +++ Config.py	(working copy)
    @@ -1,5 +1,4 @@
     import ConfigParser, os
    -import re
     from ConfigParser import NoOptionError
     
     BLACKLIST_169 = ('540', '649')
    @@ -46,13 +45,13 @@
     def getValidHeights():
         return [480] # Technically 240 is also supported
     
    -# Return the number in list that is nearest to x
    -# if two values are equidistant, return the larger
    -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)
    -
     def nearestTivoWidth(width):
    -    return nearest(width, getValidWidths())
    +    widths = getValidWidths()
    +    widths.sort()
    +    for w in widths:
    +        if (width <= w):
    +            return w
    +    return max(widths)
     
     def getTivoWidth():
         try:
    
     
  7. Apr 4, 2007 #267 of 5683
    ScaryMike

    ScaryMike New Member

    205
    0
    Aug 23, 2002
    Madison, WI
    I just wanted to say thanks to all of you who are working on this. I've got this running on my winxp machine and so far its great. I have one 260 connected to a 16x9 tv, and one 590 connected to a 4:3. Its all working great (had to aspect169=false the 590)

    Anyhow, keep up the good work, and thanks!

    -Mike
     
  8. Apr 4, 2007 #268 of 5683
    slestak

    slestak New Member

    11
    0
    Apr 4, 2007
    Hi Guys,

    I'm trying to get pyTivo running on my lan. I believe I have everything on my ubuntu server correct, but seem to be having a total MRV failure. None of my 3 series2's list each other on their NPL's, much less the new pyTivo on the lan.

    Does MRV have anything to do with the "Manually Add Server" option on the tivo?
     
  9. Apr 4, 2007 #269 of 5683
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    No, the "Manually Add Server" is for HME apps.

    MRV should be working assuming a) all of your TiVos have the same MAK and b) they are all on the same subnet.

    Try the Advanced Troubleshooting screen. It's under Messages & Settings, Troubleshooting, Transfers, then press Enter.
     
  10. Apr 4, 2007 #270 of 5683
    Expunged

    Expunged New Member

    5
    0
    Dec 17, 2003
    I am having the same problem. Full reinstall of pytivo and restarting the tivo didnt take care of the issue. Running build 185. Reverting back to the older build (181) which was working fine still does not fix the issue.

    armooo: I'll produce the output tonight and send you the results.
     
  11. Apr 5, 2007 #271 of 5683
    slestak

    slestak New Member

    11
    0
    Apr 4, 2007
    All three use tivo wireless G adapters, so they all associate with the same AP. They are all on the 192.168.0 network.

    I went through those steps. No joy.

    I wonder. The newest tivo may not have the media access key set. Is that set by the network update from tivo by the DVR preferences? If one of the three does not have it set, i wonder if that will prevent all of MRV from working on the lan...

    Thanks.

    btw. I went to the localhost url for my pyTivo server and I do see the media folder i set up on there, so I know its just the tivo's at this point.
     
  12. Apr 5, 2007 #272 of 5683
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    I would think that even if one TiVo on the LAN did not have a MAK, the others would still be able to communucate. Have you checked the Advanced Troubleshooting screen on the old boxes (the ones with the MAK)?

    Can you access the https interface on all three boxes using your browser?
     
  13. Apr 5, 2007 #273 of 5683
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Well, this might not be pyTivo's fault. I switched back to TiVo.Net and am seeing similar strange subfolder results. :confused:
     
  14. Apr 6, 2007 #274 of 5683
    Justin Thyme

    Justin Thyme Contra sceleris

    3,306
    0
    Mar 29, 2005
    It doesn't work on S3's only because the system settings for TivoToGo are i,i,i on practically every S3 in Tivodom. However, there are a few lucky folks that have TivoToGo accidentally enabled on their machines, apparently due to some configuration Snafu during installation. I don't know how it happenned on my machine, but I have a,a,a. There may be a way to hack the S3 to set the flags, but there is no concensus on the subject. In any case, I can't confirm there is any way to switch the TTG flags from i,i,i to a,a,a.

    Anyway, I can report that PyTivo works on an S3. I have transfered both .mpg and .divx shows. As I reported earlier this week in another thread, I have done the same with Tivo.Net.

    If there are any experiments I can run, let me know. My pytivo.conf has no special settings- as installed except for path.
     
  15. Apr 6, 2007 #275 of 5683
    Justin Thyme

    Justin Thyme Contra sceleris

    3,306
    0
    Mar 29, 2005
    Ok, just for fun I tried:
    width = 1440
    height = 720
    video_br=12Mi

    My old version of PyTivo (182) output it as 720x480, yuv420p. Input was a 1440x1080 25mbps VBR hidef mpeg2.

    Should have given me 720 or 1080 high, so I can't confirm HD transfers. Anyway, PyTivo on the S3 is great.
     
  16. Apr 6, 2007 #276 of 5683
    armooo

    armooo pyTivo Developer

    81
    0
    Feb 1, 2003
    pyTIvo is setup to only allow height/width settings that are supported by s2 tivos. If you edit line 44 and 47 in Config.py you can add the new sizes.

    I just updated it to support 1440x720 output version 186. It looks to output a correct mpeg (I think we should be padding the bottom 4 lines or something but I am not)

    Input #0, avi, from '/media/media/video/Bleach/[DB]_Bleach_55_[E8C96F59].avi':
    Duration: 00:24:34.8, start: 0.000000, bitrate: 967 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 640x480, 23.98 fps(r)
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
    Output #0, vob, to 'pipe:':
    Stream #0.0: Video: mpeg2video, yuv420p, 1440x720, q=2-31, 4096 kb/s, 29.97 fps(c)
    Stream #0.1: Audio: mp2, 44100 Hz, stereo, 192 kb/s
     
  17. Apr 7, 2007 #277 of 5683
    Justin Thyme

    Justin Thyme Contra sceleris

    3,306
    0
    Mar 29, 2005
    Okey dokey. The machine I have there is not configured for anything but casual mucking with Python, so I'll just pick up your fix and report back. I have no way of guessing what standard resolution and framerate Tivo will eventually recommend for transcoding to the S3. 1440x1080 appears to be the commonest format for Hidef applications and camcorders, but it is a lot of data and I seem to swamp the decode buffer. I have found 15mbps VBRs generally work on the S3, but it went blockey on me during fast change sequences. I didn't play with it long enough to figure out a 95% solution, but Tivo devs may retune the decoder as part of support for tivoToComeBack, making all such preliminary work pointless.

    By the way, thanks a solution that would run on Linux. It was a curious language to choose- Odd language because of the whitespace philosophy, but I have found it exceptionally powerful for large volumes of text manipulation.
     
  18. Apr 7, 2007 #278 of 5683
    dlfl

    dlfl Cranky old novice

    6,995
    16
    Jul 6, 2006
    Near...
    In transcode.py at line 91:

    this:
    Code:
                       if endHeight < 470: 
    is replaced by this:
    Code:
     if endHeight < TIVO_HEIGHT * 0.01:
    I'm having a hard time seeing how that could be correct. Now you are comparing it to a number like 1% of 480 (i.e., 4.8) or 1% of 720 (i.e., 7.2). :confused:
     
  19. Apr 7, 2007 #279 of 5683
    johnkfisher

    johnkfisher New Member

    18
    0
    May 7, 2006
    Problem I'm seeing:

    Installed it today - pyTivo 186, OS X 10.4.9, Python 2.5 from the installer on the macpython site, the ffmpeg build linked to from the pytivo site.

    I begin pytivo, and my share(s) show up on the now playing list. However, selecting them from the tivo shows "cannot be displayed because of an unknown error" .

    When I look at the console, I see the following:

    I cry a little inside.
    I'm very hopeful to get this working, as I have, oh, 600 shows or so and it's just too unwieldy in the flat-file format of the Tivo Desktop.
     
  20. Apr 8, 2007 #280 of 5683
    tusk1113

    tusk1113 New Member

    2
    0
    Apr 8, 2007
    i've tried looking through the posts, but can't seem to find an answer for this one. i'm using build 186 on my linux box and my ffmpeg is outputting everything at 480 tall.

    I've looked in my pytivo conf, and i anloy have the width defined. i cannot get it to keep the ratio the same without entering a definition for the height (which makes the whole thing a huge pain) i've used it on my windows box with no problems but i've just built dedicated linux box for using this.

    so what am i just being an idiot about? i assume i'm just missing something simple, but i can't figure out what it is.
     

Share This Page