macOS compatibility
Hello everyone,
disclaimer: I am new to the project ;) But I was looking for a subtitle editor and this one looks quite promising. Since it is Python based, effort of getting it running on macOS should not be that high, I thought. Since there is no install guide and further macOS related info missing on the front page (https://subtitld.org/en/install) I thought, it might be a good idea to share my progress here - might be helpful for others giving it a try on macOS (12.6 here).
- I am using a Python 3.10 venv in my user account (https://docs.python.org/3/library/venv.html).
- Another requirement outside of Python is the ffms2 binary library, I installed with (home)brew:
brew install ffms2
- Next is checking out the source as usual in some local folder:
git clone https://gitlab.com/jonata/subtitld.git
- And install it from source:
pip install .
- An issue is mpv which comes by brew in a newer version >0.35 which requires python-mpv>=1.0 (1.0.3 in my case). Otherwise, an error about missing symbol
mpv_detach_destroy
is raised (see this issue for details). Subtitld (tag 23.02) wants to have the older 0.5 series, therefore some code changes are needed:--- a/setup.py +++ b/setup.py @@ -127,7 +127,7 @@ setup_requires = ['setuptools'] install_requires = [ 'PySide6==6.3.2', 'pyopengl', - 'python-mpv==0.5.2', + 'python-mpv', 'ffms2', 'numpy==1.24.0', 'cffi',
- OpenGL works quite well with the code branch for Windows (using PySide and glfw, the latter being multi-platform targeted already). It requires a separate
pip install glfw
:--- a/subtitld/modules/utils.py +++ b/subtitld/modules/utils.py @@ -62,6 +62,8 @@ class GetProcAddressGetter: return self._init_linux() elif operating_system == 'Windows': return self._init_windows() + elif operating_system == 'Darwin': + return self._init_windows() raise f'Platform {operating_system} not supported yet' def _init_linux(self):
- For mpv the setting gpu-hwdec-interop must not be changed, leaving the default (whatever it is) works for me:
--- a/subtitld/interface/player.py +++ b/subtitld/interface/player.py @@ -69,7 +69,7 @@ class MpvWidget(QOpenGLWidget): # "gpu-context": "x11egl" } - if not ACTUAL_OS == 'windows': + if not ACTUAL_OS in ('windows', 'macos'): options["gpu-hwdec-interop"] = "vaapi-egl" for key, value in options.items():
- ffmpeg should be installed too (was already here, with brew). It is not in the source dir, but in general
PATH
, therefore no path mods necessary:--- a/subtitld/modules/paths.py +++ b/subtitld/modules/paths.py @@ -26,8 +26,8 @@ path_tmp = tempdir.name if sys.platform == 'darwin': ACTUAL_OS = 'macos' PATH_SUBTITLD_USER_CONFIG = os.path.join(PATH_HOME, 'Library', 'Application Support', 'subtitld') - FFMPEG_EXECUTABLE = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'ffmpeg') - FFPROBE_EXECUTABLE = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'ffprobe') + #FFMPEG_EXECUTABLE = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'ffmpeg') + #FFPROBE_EXECUTABLE = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'ffprobe') # try: # from Foundation import NSURL # except ImportError:
Last but not least, off-topic, tooltips in the UI would make it easier to find the right buttons for first-time users, therefor I thumbed-up the associated issue #46 ;)
Edited by Ingo Breßler