support volume adjustments

This commit is contained in:
j 2019-11-17 16:19:12 +01:00
parent 60786749ec
commit e46ed106d5
2 changed files with 5 additions and 0 deletions

View file

@ -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'])

View file

@ -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',