mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
fixes
now working
This commit is contained in:
parent
71e575f0c1
commit
b51c746f15
1 changed files with 7 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue