Changeset fb9eabd78b86782b341a08f173278793d5598eb1
- Timestamp:
- 02/02/08 20:43:43 (1 year ago)
- git-parent:
[2f56367ef07af8e279d8870ebbc80de97e7ecc9c], [4fab8f80c789835f562985b959bf62de32165194]
- Files:
-
- config.py (modified) (4 diffs)
- plugins/video/transcode.py (modified) (4 diffs)
- pyTivo.conf.dist (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
config.py
rfd09e90 rfb9eabd 137 137 height = config.getint('Server', 'height') 138 138 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 141 144 142 145 def getTivoWidth(tsn): … … 150 153 width = config.getint('Server', 'width') 151 154 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 154 160 155 161 def getAudioBR(tsn = None): … … 165 171 audiobr = int(max(int(strtod(config.get('Server', 'audio_br'))/1000), 64)/64)*64 166 172 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' 176 178 177 179 def getVideoBR(tsn = None): … … 183 185 try: 184 186 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' 187 192 188 193 def getMaxVideoBR(): plugins/video/transcode.py
r035c7ba r6fc56fd 47 47 settings = {} 48 48 settings['audio_br'] = config.getAudioBR(tsn) 49 settings['audio_codec'] = config.getAudioCodec(tsn)49 settings['audio_codec'] = select_audiocodec(tsn) 50 50 settings['video_br'] = config.getVideoBR(tsn) 51 51 settings['max_video_br'] = config.getMaxVideoBR() … … 56 56 57 57 cmd = [FFMPEG, '-i', inFile] + cmd_string.split() 58 58 print cmd 59 59 debug_write(['transcode: ffmpeg command is ', ' '.join(cmd), '\n']) 60 60 ffmpeg = subprocess.Popen(cmd, stdout=subprocess.PIPE) … … 63 63 except: 64 64 kill(ffmpeg.pid) 65 65 66 def 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 66 73 def select_aspect(inFile, tsn = ''): 67 74 TIVO_WIDTH = config.getTivoWidth(tsn) … … 97 104 multiplier4by3 = (4.0 * TIVO_HEIGHT) / (3.0 * TIVO_WIDTH) 98 105 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)]: 100 110 debug_write(['select_aspect: File is within 4:3 list.\n']) 101 111 return ['-aspect', '4:3', '-s', str(TIVO_WIDTH) + 'x' + str(TIVO_HEIGHT)] pyTivo.conf.dist
rc7e0311 r4fab8f8 21 21 #MAX_VIDEO_BR=17408k 22 22 23 # Audio bit-rate, default 192K24 #audio_br= 192K23 # Audio bit-rate, defaults to 192K for S2, 384K for S3/HD 24 #audio_br=320K 25 25 26 # Video bit-rate, default 4096K26 # Video bit-rate, defaults to 4096K for S2, 8192K for S3/HD 27 27 #video_br=12Mi 28 28 … … 36 36 #beacon=192.168.1.255 listen 37 37 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 41 44 #height=720 42 45 … … 57 60 #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 - 58 61 59 #audio_br=320K60 #video_br=12Mi61 62 62 [MyMovies] 63 63 # Type can be 'video', 'music', or 'photo'
