diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-10-26 21:03:16 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-10-26 21:03:16 +0100 |
commit | 1a253e134ce1f30dd640ba47ffb8fb8a74fe8bed (patch) | |
tree | 958a07992b47737498d5db2f550a2fb546cf4534 /youtube_dl/postprocessor/ffmpeg.py | |
parent | 6194bb1419842e908a5694b8f9a666ba97d3ac9c (diff) |
[ffmpeg] Fix call to ffprobe (Fixes #4041)
Diffstat (limited to 'youtube_dl/postprocessor/ffmpeg.py')
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index 4b93556af..bd2d749f9 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -75,6 +75,17 @@ class FFmpegPostProcessor(PostProcessor): return p return None + @property + def _probe_executable(self): + if self._downloader.params.get('prefer_ffmpeg', False): + prefs = ('ffproe', 'avprobe') + else: + prefs = ('avprobe', 'ffprobe') + for p in prefs: + if self._versions[p]: + return p + return None + def _uses_avconv(self): return self._executable == 'avconv' @@ -120,11 +131,12 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor): self._nopostoverwrites = nopostoverwrites def get_audio_codec(self, path): - if not self._exes['ffprobe'] and not self._exes['avprobe']: + + if not self._probe_executable: raise PostProcessingError(u'ffprobe or avprobe not found. Please install one.') try: cmd = [ - self._exes['avprobe'] or self._exes['ffprobe'], + self._probe_executable, '-show_streams', encodeFilename(self._ffmpeg_filename_argument(path), True)] handle = subprocess.Popen(cmd, stderr=compat_subprocess_get_DEVNULL(), stdout=subprocess.PIPE) |