From b51c746f1549560c9a77da9ab4b0b18773d74c67 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Mon, 11 Mar 2013 23:34:17 -0700 Subject: [PATCH] fixes now working --- Transcoder.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Transcoder.py b/Transcoder.py index 38c4af36..9b0769b7 100644 --- a/Transcoder.py +++ b/Transcoder.py @@ -9,17 +9,17 @@ Logger = logging.getLogger() def Transcode_file(filePath): if os.name == 'nt': - ffmpeg = os.path.join(os.path.dirname(sys.argv[0]), 'ffmpeg\bin\ffmpeg.exe') # note, will need to package in this dir. + ffmpeg = os.path.join(os.path.dirname(sys.argv[0]), 'ffmpeg\\bin\\ffmpeg.exe') # note, will need to package in this dir. if not os.path.isfile(ffmpeg): # problem Logger.error("ffmpeg not found. ffmpeg needs to be located at: %s", ffmpeg) - Logger.info("Cannot transcode file %s", filepath) + Logger.info("Cannot transcode file %s", filePath) return 1 # failure else: if call(['which', ffmpeg]): res = call([os.path.join(os.path.dirname(sys.argv[0]),'getffmpeg.sh')]) if res or call(['which', ffmpeg]): # did not install or ffmpeg still not found. Logger.error("Failed to install ffmpeg. Please install manually") - Logger.info("Cannot transcode file %s", filepath) + Logger.info("Cannot transcode file %s", filePath) return 1 # failure else: ffmpeg = 'ffmpeg' @@ -34,16 +34,16 @@ def Transcode_file(filePath): config.read(configFilename) - duplicate = config.get("Transcoder", "duplicate") + duplicate = int(config.get("Transcoder", "duplicate")) ignoreExtensions = (config.get("Transcoder", "ignoreExtensions")).split(',') outputVideoExtension = config.get("Transcoder", "outputVideoExtension") outputVideoCodec = config.get("Transcoder", "outputVideoCodec") - outputVideoFramrate = config.get("Transcoder", "outputVideoFramrate") + outputVideoFramerate = config.get("Transcoder", "outputVideoFramerate") outputVideoBitrate = config.get("Transcoder", "outputVideoBitrate") outputAudioCodec = config.get("Transcoder", "outputAudioCodec") outputAudioBitrate = config.get("Transcoder", "outputAudioBitrate") - name, ext = os.path.splitext(file) + name, ext = os.path.splitext(filePath) if ext in ignoreExtensions: Logger.info("No need to transcode video type %s", ext) return 0 # exit Transcoder. @@ -55,7 +55,7 @@ def Transcode_file(filePath): if outputVideoCodec: command.append('-c:v') command.append(outputVideoCodec) - if outputVideoFramrate: + if outputVideoFramerate: command.append('-r') command.append(outputVideoFramerate) if outputVideoBitrate: @@ -82,7 +82,3 @@ def Transcode_file(filePath): else: Logger.error("Transcoding of video %s to %s failed", filePath, newfilePath) return result - - - -