Macbook下ffmpeg下载失败问题解决
生活随笔
收集整理的這篇文章主要介紹了
Macbook下ffmpeg下载失败问题解决
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Macbook下ffmpeg下載失敗解決方案
- 問題描述
- 問題解決
問題描述
在MacBook下pyCharm的Terminal使用
pip install moviepy后,運行一段測試代碼:
# coding: utf-8from moviepy.editor import * video = VideoFileClip("0.mp4") result = CompositeVideoClip([video]) result.write_videofile("new.mp4")發現提示錯誤:
Imageio: 'ffmpeg-osx-v3.2.4' was not found on your computer; downloading it now. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>. Error while fetching file: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>. Traceback (most recent call last):File "test_ffmpeg.py", line 3, in <module>from moviepy.editor import *File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/moviepy/editor.py", line 30, in <module>imageio.plugins.ffmpeg.download()File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 79, in downloadget_remote_file(fname=fname, directory=directory, force_download=force_download)File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/core/fetching.py", line 130, in get_remote_file_fetch_file(url, filename)File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/imageio/core/fetching.py", line 189, in _fetch_file% os.path.basename(file_name) IOError: Unable to download 'ffmpeg-osx-v3.2.4'. Perhaps there is a no internet connection? If there is, please report this problem.根據提示逐個文件進行回溯,發現是因為imageio需要實時下載ffmpeg,但是該鏈接時常斷掉,所以程序認為現在沒網。
問題解決
事情變得明朗,我們只需要找到ffmpeg-osx-v3.2.4是從哪里下載到哪里的,然后手動操作一次即可。
找到ffmpeg的資源:ffmpeg in github
在目錄下找到需要的文件:ffmpeg-osx-v3.2.4,下載到本地。
現在我們需要知道Macbook下應該把這個文件放到哪里,才能使得imageio找到它并進行下一步操作。
根據錯誤提示,逐個回溯文件,到達fetching.py,發現
這里會輸出文件錯誤的信息,可見file_name即為我們所需要的下載到本地的文件路徑。修改代碼:
def _fetch_file(url, file_name, print_destination=True):print("Imageio: %r was not found on your computer; ""downloading it now.\n %r"% (os.path.basename(file_name), file_name))再次運行測試代碼(見上文),獲取到本地的文件路徑,把我們下載的ffmpeg-osx-v3.2.4復制到對應目錄:
cp -R /Users/_your_account_/Downloads/ffmpeg-osx-v3.2.4 /Users/_your_account_/Library/Application\ Support/imageio/ffmpeg/再次運行測試代碼,可以看到成功了。
總結
以上是生活随笔為你收集整理的Macbook下ffmpeg下载失败问题解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oppok3如何刷机_OPPO K3刷机
- 下一篇: 安卓虚拟机_[手机软件] 这款应用牛逼了