|
|
|
@ -113,15 +113,20 @@ class FFmpegPostProcessor(PostProcessor):
|
|
|
|
|
f'ffmpeg-location {location} does not exist! Continuing without ffmpeg', only_once=True)
|
|
|
|
|
return {}
|
|
|
|
|
elif os.path.isdir(location):
|
|
|
|
|
dirname, basename = location, None
|
|
|
|
|
dirname, basename, filename = location, None, None
|
|
|
|
|
else:
|
|
|
|
|
basename = os.path.splitext(os.path.basename(location))[0]
|
|
|
|
|
basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg')
|
|
|
|
|
filename = os.path.basename(location)
|
|
|
|
|
basename = next((p for p in programs if p in filename), 'ffmpeg')
|
|
|
|
|
dirname = os.path.dirname(os.path.abspath(location))
|
|
|
|
|
if basename in self._ffmpeg_to_avconv.keys():
|
|
|
|
|
self._prefer_ffmpeg = True
|
|
|
|
|
|
|
|
|
|
paths = {p: os.path.join(dirname, p) for p in programs}
|
|
|
|
|
if basename and basename in filename:
|
|
|
|
|
for p in programs:
|
|
|
|
|
path = os.path.join(dirname, filename.replace(basename, p))
|
|
|
|
|
if os.path.exists(path):
|
|
|
|
|
paths[p] = path
|
|
|
|
|
if basename:
|
|
|
|
|
paths[basename] = location
|
|
|
|
|
return paths
|
|
|
|
|