Macbook下ffmpeg下载失败问题解决
Macbook下ffmpeg下載失敗解決方案
- 問(wèn)題描述
- 問(wèn)題解決
問(wèn)題描述
在MacBook下pyCharm的Terminal使用
pip install moviepy后,運(yùn)行一段測(cè)試代碼:
# coding: utf-8from moviepy.editor import * video = VideoFileClip("0.mp4") result = CompositeVideoClip([video]) result.write_videofile("new.mp4")發(fā)現(xiàn)提示錯(cuò)誤:
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.根據(jù)提示逐個(gè)文件進(jìn)行回溯,發(fā)現(xiàn)是因?yàn)閕mageio需要實(shí)時(shí)下載ffmpeg,但是該鏈接時(shí)常斷掉,所以程序認(rèn)為現(xiàn)在沒(méi)網(wǎng)。
問(wèn)題解決
事情變得明朗,我們只需要找到ffmpeg-osx-v3.2.4是從哪里下載到哪里的,然后手動(dòng)操作一次即可。
找到ffmpeg的資源:ffmpeg in github
在目錄下找到需要的文件:ffmpeg-osx-v3.2.4,下載到本地。
現(xiàn)在我們需要知道Macbook下應(yīng)該把這個(gè)文件放到哪里,才能使得imageio找到它并進(jìn)行下一步操作。
根據(jù)錯(cuò)誤提示,逐個(gè)回溯文件,到達(dá)fetching.py,發(fā)現(xiàn)
這里會(huì)輸出文件錯(cuò)誤的信息,可見(jiàn)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))再次運(yùn)行測(cè)試代碼(見(jiàn)上文),獲取到本地的文件路徑,把我們下載的ffmpeg-osx-v3.2.4復(fù)制到對(duì)應(yīng)目錄:
cp -R /Users/_your_account_/Downloads/ffmpeg-osx-v3.2.4 /Users/_your_account_/Library/Application\ Support/imageio/ffmpeg/再次運(yùn)行測(cè)試代碼,可以看到成功了。
總結(jié)
以上是生活随笔為你收集整理的Macbook下ffmpeg下载失败问题解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: oppok3如何刷机_OPPO K3刷机
- 下一篇: 安卓虚拟机_[手机软件] 这款应用牛逼了