From 3ab9a32627751b19c39b273723484af0dfb1551f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 13 Feb 2014 20:02:20 +0530 Subject: [PATCH] mix 2 mono channels into stereo(common for fcp dv mov files) --- pandora_client/extract.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_client/extract.py b/pandora_client/extract.py index e64dfbf..d702f94 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -245,7 +245,15 @@ def video_cmd(video, target, profile, info): n = 0 else: n = 1 - video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)] + #mix 2 mono channels into stereo(common for fcp dv mov files) + if len(info['audio']) == 2 \ + 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']) + ] + else: + video_settings += ['-map', '0:%s,0:%s' % (info['audio'][0]['id'], n)] audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] ac = info['audio'][0].get('channels', audiochannels) if ac: