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