Skip to content

Commit

Permalink
updated ffmpeg patch
Browse files Browse the repository at this point in the history
  • Loading branch information
xibr committed May 11, 2022
1 parent b406f34 commit 51213b2
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions patches/ffmpeg.py.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
diff --git a/yt-dlp/yt_dlp/postprocessor/ffmpeg.py b/yt-dlp/yt_dlp/postprocessor/ffmpeg.py
index 27d06cbde..c646320ea 100644
index 27d06cbde..dfc01003b 100644
--- a/yt-dlp/yt_dlp/postprocessor/ffmpeg.py
+++ b/yt-dlp/yt_dlp/postprocessor/ffmpeg.py
@@ -91,7 +91,7 @@ def get_versions(downloader=None):
_version_cache, _features_cache = {}, {}

def _determine_executables(self):
- programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
+ programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe', 'libffmpeg.bin.so', 'libffprobe.bin.so']
+ programs = ['avprobe', 'avconv', 'libffmpeg.bin.so', 'libffprobe.bin.so']

def get_ffmpeg_version(path, prog):
if path in self._version_cache:
@@ -144,7 +144,7 @@ def get_ffmpeg_version(path, prog):
@@ -110,7 +110,7 @@ def get_ffmpeg_version(path, prog):
if mobj:
ver = mobj.group(1)
self._versions[prog] = self._version_cache[path] = ver
- if prog != 'ffmpeg' or not out:
+ if prog != 'libffmpeg.bin.so' or not out:
return

mobj = re.search(r'(?m)^\s+libavformat\s+(?:[0-9. ]+)\s+/\s+(?P<runtime>[0-9. ]+)', out)
@@ -142,9 +142,9 @@ def get_ffmpeg_version(path, prog):
dirname, basename = location, None
else:
basename = os.path.splitext(os.path.basename(location))[0]
basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg')
- basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg')
+ basename = next((p for p in programs if basename.startswith(p)), 'libffmpeg.bin.so')
dirname = os.path.dirname(os.path.abspath(location))
- if basename in ('ffmpeg', 'ffprobe'):
+ if basename in ('ffmpeg', 'ffprobe', 'libffmpeg.bin.so', 'libffprobe.bin.so'):
+ if basename in ('libffmpeg.bin.so', 'libffprobe.bin.so'):
prefer_ffmpeg = True

self._paths = dict(
Expand All @@ -25,16 +37,25 @@ index 27d06cbde..c646320ea 100644

self._versions = {}
- executables = {'basename': ('ffmpeg', 'avconv'), 'probe_basename': ('ffprobe', 'avprobe')}
+ executables = {'basename': ('ffmpeg', 'avconv', 'libffmpeg.bin.so'), 'probe_basename': ('ffprobe', 'avprobe', 'libffprobe.bin.so')}
+ executables = {'basename': ('libffmpeg.bin.so', 'avconv'), 'probe_basename': ('libffprobe.bin.so', 'avprobe')}
if prefer_ffmpeg is False:
executables = {k: v[::-1] for k, v in executables.items()}
for var, prefs in executables.items():
@@ -237,7 +237,7 @@ def get_audio_codec(self, path):
return None

def get_metadata_object(self, path, opts=[]):
- if self.probe_basename != 'ffprobe':
+ if self.probe_basename != 'libffprobe.bin.so':
if self.probe_available:
self.report_warning('Only ffprobe is supported for metadata extraction')
raise PostProcessingError('ffprobe not found. Please install or provide the path using --ffmpeg-location')
@@ -297,7 +297,7 @@ def real_run_ffmpeg(self, input_path_opts, output_path_opts, *, expected_retcode

cmd = [encodeFilename(self.executable, True), encodeArgument('-y')]
# avconv does not have repeat option
- if self.basename == 'ffmpeg':
+ if self.basename == 'ffmpeg' or self.basename == 'libffmpeg.bin.so':
+ if self.basename == 'libffmpeg.bin.so':
cmd += [encodeArgument('-loglevel'), encodeArgument('repeat+info')]

def make_args(file, args, name, number):

0 comments on commit 51213b2

Please sign in to comment.