use source aspect ratio
This commit is contained in:
parent
afd0e519b7
commit
8a8c09dc07
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue