最近小朋友想玩攝像頭相關的數字藝術作品,於是打開PDE,用自帶工具下載Video庫准備開始創作。
結果,一串鮮艷的紅字伴隨着PDE的卡死爆了出來:
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer
A library relies on native code that's not available.
Or only works properly when the sketch is run as a 32-bit application.
UnsatisfiedLinkError: Could not load library: gstreamer
UnsatisfiedLinkError: Could not load library: gstreamer
心里想着:不應該啊,Video基於GStream,已經用了好多年了,咋會突然報錯呢?
於是用上降版本大F,用2.2.1(32位)再運行一遍例子,此時更詳細的信息冒出來了:
這里PDE說“存在重復庫”,那問題就清楚了,是processing內置庫和第三方庫沖突了。
知道了問題產生的原因,解決起來就十分容易。
第1步:刪除Libraries文件夾中的Video庫
第2步:檢查3.X版本的Processing文件夾中是否有Video庫,如果沒有則將它復制過去
經過檢查,我發現從官網下載的3.5.3(64位)中沒有video庫,於是復制一個,問題解決。
Processing內置庫文件夾地址: XXXX\processing-3.5.3\modes\java\libraries\
最后,Video庫中其實是包含三種操作系統支持文件的,分別是 MacOS 64位、Windows 32位、Windows 64位,如果你用的是蘋果電腦,那么有可能需要將支持文件拷貝一下即可。