From 1ac76c99dfb00115407483bcaa96f18d06815c9c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 21 Oct 2013 11:55:10 +0200 Subject: [PATCH] use Firefogg ffmpeg for direct uploads, to work around issues with 5.1 audio --- pandora/archive/extract.py | 6 ++++-- pandora/archive/models.py | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 836ab271..79281bdb 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -62,7 +62,7 @@ def supported_formats(): '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): ox.makedirs(os.path.dirname(target)) @@ -230,7 +230,9 @@ def stream(video, target, profile, info): else: audio_settings = ['-an'] - cmd = [AVCONV, '-y', '-i', video, '-threads', '4'] \ + if not avconv: + avconv = AVCONV + cmd = [avconv, '-y', '-i', video, '-threads', '4'] \ + audio_settings \ + video_settings diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 22fd4088..e0d4f42b 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -578,7 +578,10 @@ class Stream(models.Model): self.media.name = self.path(self.name()) target = self.media.path 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 else: self.media = None