日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Macbook下ffmpeg下载失败问题解决

發(fā)布時(shí)間:2023/12/20 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Macbook下ffmpeg下载失败问题解决 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

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)

def _fetch_file(url, file_name, print_destination=True):print("Imageio: %r was not found on your computer; ""downloading it now." % os.path.basename(file_name))

這里會(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)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。