map needed more often, fix cad911a
This commit is contained in:
parent
2869dbafab
commit
58c762a624
2 changed files with 6 additions and 5 deletions
|
@ -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):
|
if not os.path.exists(target):
|
||||||
ox.makedirs(os.path.dirname(target))
|
ox.makedirs(os.path.dirname(target))
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ def stream(video, target, profile, info, audio_track=None, flags={}):
|
||||||
n = 1
|
n = 1
|
||||||
audio_settings = []
|
audio_settings = []
|
||||||
# mix 2 mono channels into stereo(common for fcp dv mov files)
|
# 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:
|
and len(filter(None, [a['channels'] == 1 or None for a in info['audio']])) == 2:
|
||||||
audio_settings += [
|
audio_settings += [
|
||||||
'-filter_complex',
|
'-filter_complex',
|
||||||
|
@ -262,7 +262,6 @@ def stream(video, target, profile, info, audio_track=None, flags={}):
|
||||||
mono_mix = True
|
mono_mix = True
|
||||||
else:
|
else:
|
||||||
mono_mix = False
|
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)]
|
audio_settings += ['-ar', str(audiorate)]
|
||||||
if audio_codec != 'libopus':
|
if audio_codec != 'libopus':
|
||||||
|
@ -319,7 +318,8 @@ def stream(video, target, profile, info, audio_track=None, flags={}):
|
||||||
else:
|
else:
|
||||||
cmds.append(base + audio_settings + video_settings + post)
|
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
|
n = 0
|
||||||
for cmd in cmds:
|
for cmd in cmds:
|
||||||
|
|
|
@ -167,6 +167,7 @@ AUTH_PROFILE_MODULE = 'user.UserProfile'
|
||||||
AUTH_CHECK_USERNAME = True
|
AUTH_CHECK_USERNAME = True
|
||||||
FFMPEG = 'ffmpeg'
|
FFMPEG = 'ffmpeg'
|
||||||
FFMPEG_SUPPORTS_VP9 = True
|
FFMPEG_SUPPORTS_VP9 = True
|
||||||
|
FFMPEG_DEBUG = False
|
||||||
|
|
||||||
#=========================================================================
|
#=========================================================================
|
||||||
#Pan.do/ra related settings settings
|
#Pan.do/ra related settings settings
|
||||||
|
|
Loading…
Reference in a new issue