From cad911a8077c947accafe6261ec5b92a1743c7d3 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Sep 2016 19:57:33 +0200 Subject: [PATCH] only use -map for audio if needed --- pandora/archive/extract.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 9c1cb410..d5a7d8fd 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -66,7 +66,7 @@ def supported_formats(): } -def stream(video, target, profile, info, audio_track=0, flags={}): +def stream(video, target, profile, info, audio_track=None, flags={}): if not os.path.exists(target): ox.makedirs(os.path.dirname(target)) @@ -253,8 +253,7 @@ def stream(video, target, profile, info, audio_track=0, flags={}): n = 1 audio_settings = [] # mix 2 mono channels into stereo(common for fcp dv mov files) - audio_map = [] - if audio_track == 0 and len(info['audio']) == 2 \ + if audio_track is None and len(info['audio']) == 2 \ and len(filter(None, [a['channels'] == 1 or None for a in info['audio']])) == 2: audio_settings += [ '-filter_complex', @@ -262,8 +261,9 @@ def stream(video, target, profile, info, audio_track=0, flags={}): ] mono_mix = True else: - audio_settings += ['-map', '0:%s,0:%s' % (info['audio'][audio_track]['id'], n)] mono_mix = False + if audio_track is not None: + audio_settings += ['-map', '0:%s,0:%s' % (info['audio'][audio_track]['id'], n)] audio_settings += ['-ar', str(audiorate)] if audio_codec != 'libopus': audio_settings += ['-aq', str(audioquality)]