diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 836ab271c..79281bdbe 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 22fd4088d..e0d4f42ba 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