use apsect ratio from video source

This commit is contained in:
j 2018-11-12 14:42:09 +00:00
parent 0aaf1a9263
commit afd0e519b7

View file

@ -70,7 +70,8 @@ for clip in edit:
})
position += duration
continue
clip_aspect = clip['resolution'][0] / clip['resolution'][1]
src_info = ox.avinfo(clip['path'])
clip_aspect = src_info['video'][0]['width'] / src_info['video'][0]['height']
if clip_aspect < aspect:
x = width
y = int(x / clip_aspect)
@ -103,7 +104,6 @@ for clip in edit:
print('skip empty clip', clip)
else:
files.append(out)
src_info = ox.avinfo(clip['path'])
vid = src_info['video'][0]['id']
if not src_info['audio']:
audio = ['-f', 'lavfi', '-i', 'anullsrc=channel_layout=stereo:sample_rate=48000']