use source aspect ratio

This commit is contained in:
j 2018-11-15 11:56:03 +00:00
parent afd0e519b7
commit 8a8c09dc07

View file

@ -72,6 +72,10 @@ for clip in edit:
continue continue
src_info = ox.avinfo(clip['path']) src_info = ox.avinfo(clip['path'])
clip_aspect = src_info['video'][0]['width'] / src_info['video'][0]['height'] clip_aspect = src_info['video'][0]['width'] / src_info['video'][0]['height']
if 'display_aspect_ratio' in src_info['video'][0]:
ratio = [int(p) for p in src_info['video'][0]['display_aspect_ratio'].split(':')]
clip_aspect = ratio[0] / ratio[1]
print(ratio, clip_aspect)
if clip_aspect < aspect: if clip_aspect < aspect:
x = width x = width
y = int(x / clip_aspect) y = int(x / clip_aspect)