support volume adjustments
This commit is contained in:
parent
60786749ec
commit
e46ed106d5
2 changed files with 5 additions and 0 deletions
1
edit.py
1
edit.py
|
@ -245,6 +245,7 @@ if __name__ == '__main__':
|
||||||
'resolution': info['resolution'],
|
'resolution': info['resolution'],
|
||||||
'in': stream_in,
|
'in': stream_in,
|
||||||
'out': stream_out,
|
'out': stream_out,
|
||||||
|
'volume': clip.get('volume', 1),
|
||||||
})
|
})
|
||||||
if 'path' in info:
|
if 'path' in info:
|
||||||
videos[-1]['path'] = os.path.join(prefix, info['path'])
|
videos[-1]['path'] = os.path.join(prefix, info['path'])
|
||||||
|
|
|
@ -115,6 +115,10 @@ for clip in edit:
|
||||||
else:
|
else:
|
||||||
aid = src_info['audio'][0]['id']
|
aid = src_info['audio'][0]['id']
|
||||||
audio = []
|
audio = []
|
||||||
|
if clip.get('volume', 1) != 1:
|
||||||
|
audio += [
|
||||||
|
'-filter:a', 'volume=%s' % clip['volume']
|
||||||
|
]
|
||||||
audio_map = ['-map', '0:%s,0:0' % aid, '-map', '0:%s,0:1' % vid]
|
audio_map = ['-map', '0:%s,0:0' % aid, '-map', '0:%s,0:1' % vid]
|
||||||
cmd = [
|
cmd = [
|
||||||
'ffmpeg',
|
'ffmpeg',
|
||||||
|
|
Loading…
Reference in a new issue