MCPcopy Index your code
hub / github.com/smacke/ffsubsync / ffmpeg_bin_path

Function ffmpeg_bin_path

ffsubsync/ffmpeg_utils.py:69–87  ·  view source on GitHub ↗
(bin_name, gui_mode, ffmpeg_resources_path=None)

Source from the content-addressed store, hash-verified

67
68
69def ffmpeg_bin_path(bin_name, gui_mode, ffmpeg_resources_path=None):
70 if platform.system() == "Windows":
71 bin_name = "{}.exe".format(bin_name)
72 if ffmpeg_resources_path is not None:
73 if not os.path.isdir(ffmpeg_resources_path):
74 if bin_name.lower().startswith("ffmpeg"):
75 return ffmpeg_resources_path
76 ffmpeg_resources_path = os.path.dirname(ffmpeg_resources_path)
77 return os.path.join(ffmpeg_resources_path, bin_name)
78 try:
79 resource_path = os.environ[SUBSYNC_RESOURCES_ENV_MAGIC]
80 if len(resource_path) > 0:
81 return os.path.join(resource_path, "ffmpeg-bin", bin_name)
82 except KeyError:
83 if gui_mode:
84 logger.info(
85 "Couldn't find resource path; falling back to searching system path"
86 )
87 return bin_name

Callers 10

_build_ffmpeg_argsMethod · 0.90
_fit_using_audioMethod · 0.90
fitMethod · 0.90
find_pgs_streamFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected