From b7931572a73d408dceecc4b17b784a0338e0e35b Mon Sep 17 00:00:00 2001 From: tassaron Date: Thu, 13 Jul 2017 14:46:22 -0400 Subject: added option to include audio from Video components --- src/core.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index 64f55eb..d72760d 100644 --- a/src/core.py +++ b/src/core.py @@ -526,13 +526,25 @@ class Core: if 'audio' in comp.properties() ] if extraAudio: - for extraInputFile, params in extraAudio: + unwantedVideoStreams = [] + for compNo, params in enumerate(extraAudio): + extraInputFile, params = params ffmpegCommand.extend([ '-i', extraInputFile ]) + if 'map' in params and params['map'] == '-v': + # a video stream to remove + unwantedVideoStreams.append(compNo + 1) + + if unwantedVideoStreams: + ffmpegCommand.extend(['-map', '0']) + for compNo in unwantedVideoStreams: + ffmpegCommand.extend([ + '-map', '-%s:v' % str(compNo) + ]) ffmpegCommand.extend([ '-filter_complex', - 'amix=inputs=%s:duration=longest:dropout_transition=3' % str( + 'amix=inputs=%s:duration=first:dropout_transition=3' % str( len(extraAudio) + 1 ), ]) -- cgit v1.2.3