def __est_size(self, full_path, tsn='', mime=''): # Size is estimated by taking audio and video bit rate adding 2% if transcode.tivo_compatible(full_path, tsn, mime)[0]: return int(os.stat(unicode(full_path, 'utf-8')).st_size) else: # Must be re-encoded if config.get_tsn('audio_codec', tsn) == None: audioBPS = config.getMaxAudioBR(tsn) * 1000 else: audioBPS = config.strtod(config.getAudioBR(tsn)) videoBPS = transcode.select_videostr(full_path, tsn) bitrate = audioBPS + videoBPS return int( (self.__duration(full_path) / 1000) * (bitrate * 1.02 / 8))
def __est_size(self, full_path, tsn='', mime=''): # Size is estimated by taking audio and video bit rate adding 2% if transcode.tivo_compatible(full_path, tsn, mime)[0]: return int(os.stat(unicode(full_path, 'utf-8')).st_size) else: # Must be re-encoded if config.get_tsn('audio_codec', tsn) == None: audioBPS = config.getMaxAudioBR(tsn) * 1000 else: audioBPS = config.strtod(config.getAudioBR(tsn)) videoBPS = transcode.select_videostr(full_path, tsn) bitrate = audioBPS + videoBPS return int((self.__duration(full_path) / 1000) * (bitrate * 1.02 / 8))
def __est_size(self, full_path, tsn = ''): # Size is estimated by taking audio and video bit rate adding 2% if transcode.tivo_compatable(full_path, tsn): # Is TiVo-compatible mpeg2 return int(os.stat(full_path).st_size) else: # Must be re-encoded if config.getAudioCodec(tsn) == None: audioBPS = config.getMaxAudioBR(tsn)*1000 else: audioBPS = config.strtod(config.getAudioBR(tsn)) videoBPS = config.strtod(config.getVideoBR(tsn)) bitrate = audioBPS + videoBPS return int((self.__duration(full_path) / 1000) * (bitrate * 1.02 / 8))
def __est_size(self, full_path, tsn=''): # Size is estimated by taking audio and video bit rate adding 2% if transcode.tivo_compatable(full_path, tsn): # Is TiVo-compatible mpeg2 return int(os.stat(full_path).st_size) else: # Must be re-encoded if config.getAudioCodec(tsn) == None: audioBPS = config.getMaxAudioBR(tsn) * 1000 else: audioBPS = config.strtod(config.getAudioBR(tsn)) videoBPS = config.strtod(config.getVideoBR(tsn)) bitrate = audioBPS + videoBPS return int( (self.__duration(full_path) / 1000) * (bitrate * 1.02 / 8))
def select_audiobr(tsn): return '-ab ' + config.getAudioBR(tsn)
def select_audiobr(tsn): return ["-b:a", config.getAudioBR(tsn)]
def select_audiobr(tsn): return "-ab " + config.getAudioBR(tsn)
def select_audiobr(tsn): return ['-b:a', config.getAudioBR(tsn)]
def select_audiobr(tsn): return '-ab '+config.getAudioBR(tsn)