Changeset 6dc89b181692a789f149a62adc63471ef922f81a
- Timestamp:
- 12/03/07 20:57:37 (1 year ago)
- git-parent:
[db5304ba69956c405ec4d52122aeb9d863218024], [5b28e1c0764cb417669a19ef08b2757615918467]
- Files:
-
- plugins/video/transcode.py (modified) (3 diffs)
- plugins/video/video.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/video/transcode.py
rdb5304b r6dc89b1 76 76 debug_write(['aspect169:', aspect169, '\n']) 77 77 78 optres = Config.getOptres()78 optres = config.getOptres() 79 79 80 80 debug_write(['optres:', optres, '\n']) … … 272 272 return None, None, None, None, None 273 273 274 rezre = re.compile(r'.*Video: .+, (\d+)x(\d+) ,.*')274 rezre = re.compile(r'.*Video: .+, (\d+)x(\d+)[, ].*') 275 275 x = rezre.search(output) 276 276 if x: … … 282 282 return None, None, None, None, None 283 283 284 rezre = re.compile(r'.*Video: .+, (.+) fps.*')284 rezre = re.compile(r'.*Video: .+, (.+) (?:fps|tb).*') 285 285 x = rezre.search(output) 286 286 if x: plugins/video/video.py
rf119c96 r6dc89b1 224 224 return int((self.__duration(full_path)/1000)*(bitrate * 1.02 / 8)) 225 225 226 def __getMetadat eFromTxt(self, full_path):226 def __getMetadataFromTxt(self, full_path): 227 227 metadata = {} 228 228 229 default_file = os.path.join(os.path.split(full_path)[0], 'default.txt') 229 230 description_file = full_path + '.txt' 230 if os.path.exists(description_file): 231 for line in open(description_file): 231 232 metadata.update(self.__getMetadataFromFile(default_file)) 233 metadata.update(self.__getMetadataFromFile(description_file)) 234 235 return metadata 236 237 def __getMetadataFromFile(self, file): 238 metadata = {} 239 240 if os.path.exists(file): 241 for line in open(file): 232 242 if line.strip().startswith('#'): 233 243 continue … … 266 276 metadata['stopTime'] = (now + duration_delta).isoformat() 267 277 268 metadata.update( self.__getMetadat eFromTxt(full_path) )278 metadata.update( self.__getMetadataFromTxt(full_path) ) 269 279 270 280 metadata['size'] = self.__est_size(full_path) … … 345 355 file_info = VideoDetails() 346 356 file_info.update(self.__metadata(file_path)) 347 348 print file_info349 357 350 358 handler.send_response(200)
