Bug 453963

Summary: speech to text ffmpeg path not found on MacOS
Product: [Applications] kdenlive Reporter: gar <arkadianriver>
Component: Rendering & ExportAssignee: Jean-Baptiste Mardelle <jb>
Status: RESOLVED FIXED    
Severity: normal CC: fritzibaby, julius.kuenzel
Priority: NOR Flags: fritzibaby: Brainstorm+
Version: 22.04.0   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed In: 22.08
Sentry Crash Report:

Description gar 2022-05-18 00:09:41 UTC
SUMMARY
Speech to text on MacOS not finding path to ffmpeg.

STEPS TO REPRODUCE
Select clip > Speech Editor > Start recognition

OBSERVED RESULT
Reports error: No speech detected with log:
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

EXPECTED RESULT
Speech recognized :O)

SOFTWARE/OS VERSIONS
macOS: 12.3.1

ADDITIONAL INFORMATION
Determined that when editing the file and adding the folder that ffmpeg is in to the path that it works.
I don't know where the PATH should be set for these scripts, so this probably isn't the ultimate fix, but it got the job done in this case.
1. Edit the file /Applications/kdenlive.app/Contents/Resources/scripts/speechtotext.py
2. Add on around line 18 the following code:
    if sys.platform == 'darwin':
        os.environ["PATH"] += os.pathsep + '/Applications/kdenlive.app/Contents/MacOS'
Comment 1 gar 2022-05-18 00:18:29 UTC
Aha! The same is true for speech.py for transcribing the subtitles.
Comment 2 Jean-Baptiste Mardelle 2022-05-19 11:47:09 UTC
Thanks a lot for your report and solution. This should now be fixed with:
https://invent.kde.org/multimedia/kdenlive/-/commit/1daedc13d52202fcca914fc4e614a30e415e925e