[Solved] FFmpeg error while resizing video
I faced this error while trying to resize 2k video to 1080p.
Command that gave error:
Error received
dyld[71069]: Library not loaded: /usr/local/opt/leptonica/lib/liblept.5.dylib Referenced from: <A0F80900-804F-3F34-BCD5-196741ECC229> /usr/local/Cellar/tesseract/5.3.2/lib/libtesseract.5.dylib Reason: tried: '/usr/local/opt/leptonica/lib/liblept.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/leptonica/lib/liblept.5.dylib' (no such file), '/usr/local/opt/leptonica/lib/liblept.5.dylib' (no such file), '/usr/local/lib/liblept.5.dylib' (no such file), '/usr/lib/liblept.5.dylib' (no such file, not in dyld cache), '/usr/local/Cellar/leptonica/1.83.1/lib/liblept.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/leptonica/1.83.1/lib/liblept.5.dylib' (no such file), '/usr/local/Cellar/leptonica/1.83.1/lib/liblept.5.dylib' (no such file), '/usr/local/lib/liblept.5.dylib' (no such file), '/usr/lib/liblept.5.dylib' (no such file, not in dyld cache) [1] 71069 abort ffmpeg -i /Users/samundra/Movies/flutter_grpc.mp4 -vf scale=1280:720 -preset
Solution:
Explanation
At somepoint of homebrew upgrade
it updated some dependencies of ffmpeg and left it in unstable state by breaking symlinks. After re-installing tesseract
whose symlink was broken got repaired (probably) linked again with proper path. So, everything started working fine. The alternative solution was to find the symlink that was broken and manually link it. Finding the broken one could take bit of time so re-installing is the easiest solution whenever possible.