mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 18:47:09 -07:00
Merge pull request #103 from nightexcessive/master
Improvements to the transcoder
This commit is contained in:
commit
775706387b
3 changed files with 9 additions and 1 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
autoProcessMedia.cfg
|
|
@ -15,7 +15,7 @@ def Transcode_directory(dirName):
|
|||
Logger.info("Cannot transcode files in folder %s", dirName)
|
||||
return 1 # failure
|
||||
else:
|
||||
if call(['which', 'ffmpeg']):
|
||||
if call(['which', 'ffmpeg']) != 0:
|
||||
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")
|
||||
|
@ -23,6 +23,8 @@ def Transcode_directory(dirName):
|
|||
return 1 # failure
|
||||
else:
|
||||
ffmpeg = 'ffmpeg'
|
||||
else:
|
||||
ffmpeg = 'ffmpeg'
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessMedia.cfg")
|
||||
|
@ -39,6 +41,7 @@ def Transcode_directory(dirName):
|
|||
ignoreExtensions = (config.get("Transcoder", "ignoreExtensions")).split(',')
|
||||
outputVideoExtension = config.get("Transcoder", "outputVideoExtension")
|
||||
outputVideoCodec = config.get("Transcoder", "outputVideoCodec")
|
||||
outputVideoPreset = config.get("Transcoder", "outputVideoPreset")
|
||||
outputVideoFramerate = config.get("Transcoder", "outputVideoFramerate")
|
||||
outputVideoBitrate = config.get("Transcoder", "outputVideoBitrate")
|
||||
outputAudioCodec = config.get("Transcoder", "outputAudioCodec")
|
||||
|
@ -62,6 +65,9 @@ def Transcode_directory(dirName):
|
|||
if outputVideoCodec:
|
||||
command.append('-c:v')
|
||||
command.append(outputVideoCodec)
|
||||
if outputVideoCodec == 'libx264' and outputVideoPreset:
|
||||
command.append('-preset')
|
||||
command.append(outputVideoPreset)
|
||||
if outputVideoFramerate:
|
||||
command.append('-r')
|
||||
command.append(outputVideoFramerate)
|
||||
|
|
|
@ -105,6 +105,7 @@ duplicate = 1
|
|||
ignoreExtensions = .avi,.mkv
|
||||
outputVideoExtension = .mp4
|
||||
outputVideoCodec = libx264
|
||||
outputVideoPreset = medium
|
||||
outputVideoFramerate = 24
|
||||
outputVideoBitrate = 800k
|
||||
outputAudioCodec = libmp3lame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue