This commit is contained in:
j 2017-08-09 20:27:23 +02:00
parent 16cbe7db87
commit 4245416b33

View file

@ -17,6 +17,7 @@ output = '/tmp/test.mp4'
height = 480 height = 480
aspect = 16/9 aspect = 16/9
width = int(height * aspect) width = int(height * aspect)
width -= width % 2
files = [] files = []
for clip in edit: for clip in edit:
@ -28,9 +29,11 @@ for clip in edit:
if clip_aspect < aspect: if clip_aspect < aspect:
x = width x = width
y = int(x / clip_aspect) y = int(x / clip_aspect)
y -= y % 2
else: else:
y = height y = height
x = int(y * clip_aspect) x = int(y * clip_aspect)
x -= x % 2
vf = 'scale=%s:%s' % (x, y) vf = 'scale=%s:%s' % (x, y)
if x != width: if x != width:
vf += ',crop=%s:%s' % (width, height) # crop center vf += ',crop=%s:%s' % (width, height) # crop center