Skip to content

Commit

Permalink
[postprocessor/ffmpeg] Fix finding ffprobe (bug in 21792b8)
Browse files Browse the repository at this point in the history
Fixes 21792b8#commitcomment-140705274, thx: vonProteus
  • Loading branch information
dirkf committed Apr 7, 2024
1 parent 4ea59c6 commit e0727e4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions youtube_dl/postprocessor/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ def get_versions(downloader=None):
return FFmpegPostProcessor(downloader)._versions

def _determine_executables(self):
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
# ordered to match prefer_ffmpeg!
convs = ['ffmpeg', 'avconv']
probes = ['ffprobe', 'avprobe']
prefer_ffmpeg = True
programs = convs + probes

def get_ffmpeg_version(path):
ver = get_exe_version(path, args=['-version'])
Expand Down Expand Up @@ -127,10 +130,13 @@ def get_ffmpeg_version(path):
(p, get_ffmpeg_version(self._paths[p])) for p in programs)
if x[1] is not None)

for p in ('ffmpeg', 'avconv')[::-1 if prefer_ffmpeg is False else 1]:
if self._versions.get(p):
self.basename = self.probe_basename = p
break
basenames = [None, None]
for i, progs in enumerate((convs, probes)):
for p in progs[::-1 if prefer_ffmpeg is False else 1]:
if self._versions.get(p):
basenames[i] = p
break
self.basename, self.probe_basename = basenames

@property
def available(self):
Expand Down

0 comments on commit e0727e4

Please sign in to comment.