use Firefogg ffmpeg for direct uploads, to work around issues with 5.1 audio

This commit is contained in:
j 2013-10-21 11:55:10 +02:00
parent 7329d13324
commit 1ac76c99df
2 changed files with 8 additions and 3 deletions

View file

@ -62,7 +62,7 @@ def supported_formats():
'mp4': 'libx264' in stdout and 'libvo_aacenc' in stdout, 'mp4': 'libx264' in stdout and 'libvo_aacenc' in stdout,
} }
def stream(video, target, profile, info): def stream(video, target, profile, info, avconv=None):
if not os.path.exists(target): if not os.path.exists(target):
ox.makedirs(os.path.dirname(target)) ox.makedirs(os.path.dirname(target))
@ -230,7 +230,9 @@ def stream(video, target, profile, info):
else: else:
audio_settings = ['-an'] audio_settings = ['-an']
cmd = [AVCONV, '-y', '-i', video, '-threads', '4'] \ if not avconv:
avconv = AVCONV
cmd = [avconv, '-y', '-i', video, '-threads', '4'] \
+ audio_settings \ + audio_settings \
+ video_settings + video_settings

View file

@ -578,7 +578,10 @@ class Stream(models.Model):
self.media.name = self.path(self.name()) self.media.name = self.path(self.name())
target = self.media.path target = self.media.path
info = ox.avinfo(media) info = ox.avinfo(media)
if extract.stream(media, target, self.name(), info): ffmpeg = ox.file.cmd('ffmpeg')
if ffmpeg == 'ffmpeg':
ffmpeg = None
if extract.stream(media, target, self.name(), info, ffmpeg):
self.available = True self.available = True
else: else:
self.media = None self.media = None