Skip to content

Commit

Permalink
[strapi] add have_ffmpeg_encoder_options check define
Browse files Browse the repository at this point in the history
Signed-off-by: Focus Luo <[email protected]>
  • Loading branch information
FocusLuo committed Aug 1, 2024
1 parent f365e19 commit 8caa6da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .slashrc
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ class MediaPlugin(slash.plugins.PluginInterface):
from lib.platform import info
return info()["gpu"]["gen"]

def _get_platform_stringapi_enable(self):
from lib.platform import info
return info()["stringapi"]["enable"]

def _get_call_timeout(self):
if self.test_call_timeout > 0:
return self.test_call_timeout
Expand Down
15 changes: 12 additions & 3 deletions lib/ffmpeg/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,18 @@ def have_ffmpeg_encoder(encoder):
return result, encoder

@memoize
def have_string_api(encoder):
result = try_call(f"{exe2os('ffmpeg')} -hide_banner -h encoder={encoder} | grep qsv_params")
return result, encoder
def have_ffmpeg_encoder_options(name, *args):
failmsg = "{0}.{1}".format(name, '.'.join(args))
result = try_call(f"{exe2os('ffmpeg')} -hide_banner -encoders | awk '{{print $2}}' | grep -w {name}")
print("Hello Focus: name, failmsg, result=", name, failmsg, result)
print("Hello Focus: args=", args)
if result is True:
for key in args:
result = try_call(f"{exe2os('ffmpeg')} -hide_banner -h encoder={name} | grep -e {key}")
print("Hello Focus: key, result=", key, result)
if result is False:
break
return result, failmsg

@memoize
def have_ffmpeg_decoder(decoder):
Expand Down

0 comments on commit 8caa6da

Please sign in to comment.