Changeset fb9eabd78b86782b341a08f173278793d5598eb1

Show
Ignore:
Timestamp:
02/02/08 20:43:43 (1 year ago)
Author:
William McBrine <wmcbrine@gmail.com>
git-committer:
William McBrine <wmcbrine@gmail.com> 1202006623 -0500
git-parent:

[2f56367ef07af8e279d8870ebbc80de97e7ecc9c], [4fab8f80c789835f562985b959bf62de32165194]

git-author:
William McBrine <wmcbrine@gmail.com> 1202006623 -0500
Message:

Merge branch 'wgw' into subfolders-8.3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • config.py

    rfd09e90 rfb9eabd  
    137137        height = config.getint('Server', 'height') 
    138138        return nearestTivoHeight(height) 
    139     except NoOptionError: #default 
    140         return 480 
     139    except NoOptionError: #defaults for S3/S2 TiVo 
     140        if tsn and tsn[:3] in getHDtivos(): 
     141            return 720 
     142        else: 
     143            return 480 
    141144 
    142145def getTivoWidth(tsn): 
     
    150153        width = config.getint('Server', 'width') 
    151154        return nearestTivoWidth(width) 
    152     except NoOptionError: #default 
    153         return 544 
     155    except NoOptionError: #defaults for S3/S2 TiVo 
     156        if tsn and tsn[:3] in getHDtivos(): 
     157            return 1280 
     158        else: 
     159            return 544 
    154160 
    155161def getAudioBR(tsn = None): 
     
    165171        audiobr = int(max(int(strtod(config.get('Server', 'audio_br'))/1000), 64)/64)*64 
    166172        return str(min(audiobr, getMaxAudioBR(tsn))) + 'k' 
    167     except NoOptionError: #default to 192 
    168         return '192k' 
    169  
    170 def getAudioCodec(tsn = None): 
    171     #check for HD tivo and return compatible audio parameters 
    172     if tsn and tsn[:3] in getHDtivos(): 
    173         return '-acodec ac3 -ar 48000' 
    174     else: 
    175         return '-acodec mp2 -ac 2 -ar 44100' 
     173    except NoOptionError: #defaults for S3/S2 TiVo 
     174        if tsn and tsn[:3] in getHDtivos(): 
     175            return '384k' 
     176        else: 
     177            return '192k' 
    176178 
    177179def getVideoBR(tsn = None): 
     
    183185    try: 
    184186        return config.get('Server', 'video_br') 
    185     except NoOptionError: #default to 4096K 
    186         return '4096K' 
     187    except NoOptionError: #defaults for S3/S2 TiVo 
     188        if tsn and tsn[:3] in getHDtivos(): 
     189            return '8192k' 
     190        else: 
     191            return '4096K' 
    187192 
    188193def getMaxVideoBR(): 
  • plugins/video/transcode.py

    r035c7ba r6fc56fd  
    4747    settings = {} 
    4848    settings['audio_br'] = config.getAudioBR(tsn) 
    49     settings['audio_codec'] = config.getAudioCodec(tsn) 
     49    settings['audio_codec'] = select_audiocodec(tsn) 
    5050    settings['video_br'] = config.getVideoBR(tsn) 
    5151    settings['max_video_br'] = config.getMaxVideoBR() 
     
    5656 
    5757    cmd = [FFMPEG, '-i', inFile] + cmd_string.split() 
    58  
     58    print cmd 
    5959    debug_write(['transcode: ffmpeg command is ', ' '.join(cmd), '\n']) 
    6060    ffmpeg = subprocess.Popen(cmd, stdout=subprocess.PIPE) 
     
    6363    except: 
    6464        kill(ffmpeg.pid) 
    65         
     65 
     66def select_audiocodec(tsn = ''): 
     67    #check for HD tivo and return compatible audio parameters 
     68    if tsn and tsn[:3] in config.getHDtivos(): 
     69        return '-acodec ac3 -ar 48000' 
     70    else: 
     71        return '-acodec mp2 -ac 2 -ar 44100' 
     72 
    6673def select_aspect(inFile, tsn = ''): 
    6774    TIVO_WIDTH = config.getTivoWidth(tsn) 
     
    97104    multiplier4by3  =  (4.0 * TIVO_HEIGHT) / (3.0 * TIVO_WIDTH) 
    98105    
    99     if (rwidth, rheight) in [(4, 3), (10, 11), (15, 11), (59, 54), (59, 72), (59, 36), (59, 54)]: 
     106    if tsn[:3] in config.getHDtivos() and height <= TIVO_HEIGHT and config.getOptres() == False: 
     107        return [] #pass all resolutions to S3/HD, except heights greater than conf height 
     108                # else, optres is enabled and resizes SD video to the "S2" standard on S3/HD. 
     109    elif (rwidth, rheight) in [(4, 3), (10, 11), (15, 11), (59, 54), (59, 72), (59, 36), (59, 54)]: 
    100110        debug_write(['select_aspect: File is within 4:3 list.\n']) 
    101111        return ['-aspect', '4:3', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)] 
  • pyTivo.conf.dist

    rc7e0311 r4fab8f8  
    2121#MAX_VIDEO_BR=17408k 
    2222 
    23 # Audio bit-rate, default 192K 
    24 #audio_br=192
     23# Audio bit-rate, defaults to 192K for S2, 384K for S3/HD 
     24#audio_br=320
    2525 
    26 # Video bit-rate, default 4096K 
     26# Video bit-rate, defaults to 4096K for S2, 8192K for S3/HD 
    2727#video_br=12Mi 
    2828 
     
    3636#beacon=192.168.1.255 listen 
    3737 
    38 # Output Pixel Width: if you have an HDTV you might want to try 720 or 704 
    39 # Valid: 720, 704, 544, 480, 352 
    40 #width=1440 
     38# Output Pixel Width: 
     39# Width, defaults to 544 for S2, 1280 for S3/HD 
     40# Height, defaults to 480 for S2, 720 for S3/HD 
     41# Valid widths: [S3/HD = 1920, 1440, 1280], [S2/S3/HD = 720, 704, 544, 480, 352] 
     42# Valid heights: [S3/HD = 1080, 720], [S2/S3/HD = 480] 
     43#width=1280 
    4144#height=720 
    4245 
     
    5760#ffmpeg_prams=-vcodec mpeg2video -r 29.97 -b %(video_br)s -maxrate %(max_video_br)s -bufsize %(buff_size)s %(aspect_ratio)s -comment pyTivo.py %(audio_codec)s -ab %(audio_br)s -f vob - 
    5861 
    59 #audio_br=320K 
    60 #video_br=12Mi 
    61  
    6262[MyMovies] 
    6363# Type can be 'video', 'music', or 'photo'