From e46ed106d53a695c8c7de84abb9087edf765b9d7 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 17 Nov 2019 16:19:12 +0100 Subject: [PATCH] support volume adjustments --- edit.py | 1 + ffmpeg.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/edit.py b/edit.py index f4ccfdf..c881896 100755 --- a/edit.py +++ b/edit.py @@ -245,6 +245,7 @@ if __name__ == '__main__': 'resolution': info['resolution'], 'in': stream_in, 'out': stream_out, + 'volume': clip.get('volume', 1), }) if 'path' in info: videos[-1]['path'] = os.path.join(prefix, info['path']) diff --git a/ffmpeg.py b/ffmpeg.py index 6ae4415..6e5bcbe 100755 --- a/ffmpeg.py +++ b/ffmpeg.py @@ -115,6 +115,10 @@ for clip in edit: else: aid = src_info['audio'][0]['id'] 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] cmd = [ 'ffmpeg',