From 29afa0bc5de4c381ba3cfd329ca87de29f30bf3a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 2 Apr 2014 16:40:43 +0200 Subject: [PATCH] dont set audiochannel for mono_mix, use : to select track --- pandora_client/extract.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pandora_client/extract.py b/pandora_client/extract.py index d702f94..0adf7b8 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -250,17 +250,20 @@ def video_cmd(video, target, profile, info): and len(filter(None, [a['channels'] == 1 or None for a in info['audio']])) == 2: video_settings += [ '-filter_complex', - '[0.%s][0.%s] amerge' % (info['audio'][0]['id'], info['audio'][1]['id']) + '[0:%s][0:%s] amerge' % (info['audio'][0]['id'], info['audio'][1]['id']) ] + mono_mix = True else: video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)] + mono_mix = False audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] - ac = info['audio'][0].get('channels', audiochannels) - if ac: - ac = min(ac, audiochannels) - else: - ac = audiochannels - audio_settings += ['-ac', str(ac)] + if not mono_mix: + ac = info['audio'][0].get('channels', audiochannels) + if ac: + ac = min(ac, audiochannels) + else: + ac = audiochannels + audio_settings += ['-ac', str(ac)] if audiobitrate: audio_settings += ['-ab', audiobitrate] if format == 'mp4':