diff --git a/autosub/__init__.py b/autosub/__init__.py index 61019464b..a6c560ab5 100644 --- a/autosub/__init__.py +++ b/autosub/__init__.py @@ -233,6 +233,16 @@ def generate_subtitles( # pylint: disable=too-many-locals,too-many-arguments """ Given an input audio/video file, generate subtitles in the specified language and format. """ + if os.name != "nt" and "Darwin" in os.uname(): + #the default unix fork method does not work on Mac OS + #need to use forkserver + try: + if 'forkserver' not in multiprocessing.get_start_method(allow_none=True): + multiprocessing.set_start_method('forkserver') + except AttributeError: + # for python 2 not have set_start_method... cannot be used on mac + print("Python 2 fork() does not work on MacOS. Please use Python 3 instead.") + audio_filename, audio_rate = extract_audio(source_path) regions = find_speech_regions(audio_filename)