mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
transcoder fixes for #473
This commit is contained in:
parent
a2e38f0e39
commit
ae04e98b11
2 changed files with 36 additions and 11 deletions
|
@ -362,21 +362,31 @@ def initialize(section=None):
|
|||
VCODEC_ALLOW = CFG["Transcoder"]["VideoCodecAllow"].strip()
|
||||
if isinstance(VCODEC_ALLOW, str): VCODEC_ALLOW = VCODEC_ALLOW.split(',')
|
||||
VPRESET = CFG["Transcoder"]["outputVideoPreset"].strip()
|
||||
VFRAMERATE = float(CFG["Transcoder"]["outputVideoFramerate"].strip())
|
||||
VBITRATE = int((CFG["Transcoder"]["outputVideoBitrate"].strip()).replace('k','000'))
|
||||
try:
|
||||
VFRAMERATE = float(CFG["Transcoder"]["outputVideoFramerate"].strip())
|
||||
except: pass
|
||||
try:
|
||||
VBITRATE = int((CFG["Transcoder"]["outputVideoBitrate"].strip()).replace('k','000'))
|
||||
except: pass
|
||||
VRESOLUTION = CFG["Transcoder"]["outputVideoResolution"]
|
||||
ACODEC = CFG["Transcoder"]["outputAudioCodec"].strip()
|
||||
ACODEC_ALLOW = CFG["Transcoder"]["AudioCodecAllow"].strip()
|
||||
if isinstance(ACODEC_ALLOW, str): ACODEC_ALLOW = ACODEC_ALLOW.split(',')
|
||||
ABITRATE = int((CFG["Transcoder"]["outputAudioBitrate"].strip()).replace('k','000'))
|
||||
try:
|
||||
ABITRATE = int((CFG["Transcoder"]["outputAudioBitrate"].strip()).replace('k','000'))
|
||||
except: pass
|
||||
ACODEC2 = CFG["Transcoder"]["outputAudioTrack2Codec"].strip()
|
||||
ACODEC2_ALLOW = CFG["Transcoder"]["AudioCodec2Allow"].strip()
|
||||
if isinstance(ACODEC2_ALLOW, str): ACODEC2_ALLOW = ACODEC2_ALLOW.split(',')
|
||||
ABITRATE2 = int((CFG["Transcoder"]["outputAudioTrack2Bitrate"].strip()).replace('k','000'))
|
||||
try:
|
||||
ABITRATE2 = int((CFG["Transcoder"]["outputAudioTrack2Bitrate"].strip()).replace('k','000'))
|
||||
except: pass
|
||||
ACODEC3 = CFG["Transcoder"]["outputAudioOtherCodec"].strip()
|
||||
ACODEC3_ALLOW = CFG["Transcoder"]["AudioOtherCodecAllow"].strip()
|
||||
if isinstance(ACODEC3_ALLOW, str): ACODEC3_ALLOW = ACODEC3_ALLOW.split(',')
|
||||
ABITRATE3 = int((CFG["Transcoder"]["outputAudioOtherBitrate"].strip()).replace('k','000'))
|
||||
try:
|
||||
ABITRATE3 = int((CFG["Transcoder"]["outputAudioOtherBitrate"].strip()).replace('k','000'))
|
||||
except: pass
|
||||
SCODEC = CFG["Transcoder"]["outputSubtitleCodec"].strip()
|
||||
BURN = int(CFG["Transcoder"]["burnInSubtitle"].strip())
|
||||
DEFAULTS = CFG["Transcoder"]["outputDefault"].strip()
|
||||
|
|
|
@ -126,7 +126,7 @@ def buildCommands(file, newDir):
|
|||
except:
|
||||
framerate = 0
|
||||
vid_cmds = []
|
||||
if codec in nzbtomedia.VCODEC_ALLOW:
|
||||
if codec in nzbtomedia.VCODEC_ALLOW or not nzbtomedia.VCODEC:
|
||||
video_cmd.extend(['-c:v', 'copy'])
|
||||
else:
|
||||
video_cmd.extend(['-c:v', nzbtomedia.VCODEC])
|
||||
|
@ -165,7 +165,10 @@ def buildCommands(file, newDir):
|
|||
elif audio1: # right language wrong codec.
|
||||
map_cmd.extend(['-map', '0:' + str(audio1[0]["index"])])
|
||||
a_mapped.extend([audio1[0]["index"]])
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC])
|
||||
if nzbtomedia.ACODEC:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||
if nzbtomedia.ACODEC == 'aac':
|
||||
audio_cmd.extend(['-strict', '-2'])
|
||||
if nzbtomedia.ABITRATE:
|
||||
|
@ -175,7 +178,10 @@ def buildCommands(file, newDir):
|
|||
elif audio3: # just pick the default audio track
|
||||
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
||||
a_mapped.extend([audio3[0]["index"]])
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC])
|
||||
if nzbtomedia.ACODEC:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||
if nzbtomedia.ACODEC == 'aac':
|
||||
audio_cmd.extend(['-strict', '-2'])
|
||||
if nzbtomedia.ABITRATE:
|
||||
|
@ -198,7 +204,10 @@ def buildCommands(file, newDir):
|
|||
elif audio1: # right language wrong codec.
|
||||
map_cmd.extend(['-map', '0:' + str(audio1[0]["index"])])
|
||||
a_mapped.extend([audio1[0]["index"]])
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC2])
|
||||
if nzbtomedia.ACODEC2:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC2])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||
if nzbtomedia.ACODEC2 == 'aac':
|
||||
audio_cmd.extend(['-strict', '-2'])
|
||||
if nzbtomedia.ABITRATE2:
|
||||
|
@ -208,7 +217,10 @@ def buildCommands(file, newDir):
|
|||
elif audio3: # just pick the default audio track
|
||||
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
||||
a_mapped.extend([audio3[0]["index"]])
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC2])
|
||||
if nzbtomedia.ACODEC2:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC2])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||
if nzbtomedia.ACODEC2 == 'aac':
|
||||
audio_cmd.extend(['-strict', '-2'])
|
||||
if nzbtomedia.ABITRATE2:
|
||||
|
@ -229,7 +241,10 @@ def buildCommands(file, newDir):
|
|||
if nzbtomedia.ABITRATE3 and not (nzbtomedia.ABITRATE3 * 0.9 < bitrate < nzbtomedia.ABITRATE3 * 1.1):
|
||||
audio_cmd.extend(['-b:a:' + str(used_audio), str(nzbtomedia.ABITRATE3)])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC3])
|
||||
if nzbtomedia.ACODEC3:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), nzbtomedia.ACODEC3])
|
||||
else:
|
||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||
if nzbtomedia.ACODEC3 == 'aac':
|
||||
audio_cmd.extend(['-strict', '-2'])
|
||||
if nzbtomedia.ABITRATE3:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue