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
aspect = 16/9
width = int(height * aspect)
width -= width % 2
files = []
for clip in edit:
@ -28,9 +29,11 @@ for clip in edit:
if clip_aspect < aspect:
x = width
y = int(x / clip_aspect)
y -= y % 2
else:
y = height
x = int(y * clip_aspect)
x -= x % 2
vf = 'scale=%s:%s' % (x, y)
if x != width:
vf += ',crop=%s:%s' % (width, height) # crop center