fix scaling issues. Fixes #672

This commit is contained in:
clinton-hall 2015-01-18 08:12:21 +10:30
parent f97087e492
commit 2864b730ca

View file

@ -218,11 +218,11 @@ def buildCommands(file, newDir, movieName, bitbucket):
w_scale = width/float(scale.split(':')[0])
h_scale = height/float(scale.split(':')[1])
if w_scale > h_scale: # widescreen, Scale by width only.
scale = scale.split(':')[0] + ":trunc(ih/2)*2"
scale = scale.split(':')[0] + ":" + str(int((height/w_scale)/2)*2)
if w_scale != 1:
video_cmd.extend(['-vf', 'scale=' + scale])
else: # lower or mathcing ratio, scale by height only.
scale = "trunc(iw/2)*2:" + scale.split(':')[1]
scale = str(int((width/h_scale)/2)*2) + ":" + scale.split(':')[1]
if h_scale != 1:
video_cmd.extend(['-vf', 'scale=' + scale])
if nzbtomedia.VBITRATE: