aboutsummaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authortassaron2017-07-13 14:46:22 -0400
committertassaron2017-07-13 14:46:22 -0400
commitb7931572a73d408dceecc4b17b784a0338e0e35b (patch)
tree7f55cf08da0094698d53074c72f474206026d464 /src/core.py
parent8811b699a9c2d6b78af1e2a332d3031aef73aec4 (diff)
added option to include audio from Video components
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py16
1 files changed, 14 insertions, 2 deletions
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
),
])