if source has 2 audio channels. use first one

This commit is contained in:
j 2012-03-22 00:04:35 +01:00
parent 24a8ae421f
commit 5d18e2d6e9

View file

@ -148,11 +148,12 @@ def video_cmd(video, target, profile, info):
if info['audio']: if info['audio']:
audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)]
ac = 1 if len(info['audio'][0]) > 1 and info['video']:
for a in info['audio']: audio_settings += ['-map', '0:0']
ac = max(ac, a.get('channels', 1)) audio_settings += ['-map', '0:1']
if audiochannels and ac >= audiochannels: ac = info['audio'][0].get('channels', audiochannels)
audio_settings += ['-ac', str(audiochannels)] ac = min(ac, audiochannels)
audio_settings += ['-ac', str(ac)]
if audiobitrate: if audiobitrate:
audio_settings += ['-ab', audiobitrate] audio_settings += ['-ab', audiobitrate]
audio_settings +=['-acodec', 'libvorbis'] audio_settings +=['-acodec', 'libvorbis']