use apsect ratio from video source
This commit is contained in:
parent
0aaf1a9263
commit
afd0e519b7
1 changed files with 2 additions and 2 deletions
|
@ -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']
|
||||||
|
|
Loading…
Reference in a new issue