From 58c762a62442c2ccefb305a5bb707d021a61f492 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Sep 2016 20:24:36 +0200 Subject: [PATCH] map needed more often, fix cad911a --- pandora/archive/extract.py | 10 +++++----- pandora/settings.py | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index d5a7d8fd..26c211cd 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=None, flags={}): +def stream(video, target, profile, info, audio_track=0, flags={}): if not os.path.exists(target): ox.makedirs(os.path.dirname(target)) @@ -253,7 +253,7 @@ def stream(video, target, profile, info, audio_track=None, flags={}): n = 1 audio_settings = [] # mix 2 mono channels into stereo(common for fcp dv mov files) - if audio_track is None and len(info['audio']) == 2 \ + if audio_track == 0 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 +262,7 @@ def stream(video, target, profile, info, audio_track=None, flags={}): mono_mix = True else: mono_mix = False - if audio_track is not None: - audio_settings += ['-map', '0:%s,0:%s' % (info['audio'][audio_track]['id'], n)] + 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)] @@ -319,7 +318,8 @@ def stream(video, target, profile, info, audio_track=None, flags={}): else: cmds.append(base + audio_settings + video_settings + post) - # print('\n'.join([' '.join(cmd) for cmd in cmds])) + if settings.FFMPEG_DEBUG: + print('\n'.join([' '.join(cmd) for cmd in cmds])) n = 0 for cmd in cmds: diff --git a/pandora/settings.py b/pandora/settings.py index dc2dcbfd..de494bc2 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -167,6 +167,7 @@ AUTH_PROFILE_MODULE = 'user.UserProfile' AUTH_CHECK_USERNAME = True FFMPEG = 'ffmpeg' FFMPEG_SUPPORTS_VP9 = True +FFMPEG_DEBUG = False #========================================================================= #Pan.do/ra related settings settings