跳到主要內容

如何製作HEIC檔



此教學使用MacOS


參考自



網路上教學都是如何將HEIF/HEIC轉換成jpeg/png/jpg等等的格式,卻沒有如何轉成HEIC檔案格式...









什麼是GPAC?


引用自官網:

GPAC is an Open Source multimedia framework. GPAC is used for research and academic purposes and beyond through industrial collaborations! The project covers different aspects of multimedia, with a focus on presentation technologies (graphics, animation and interactivity) and on multimedia packaging formats such as MP4.

GPAC是一個開源的多種圖片框架,支援多種圖片格式也支援影片格式。


我們將用homebrew下載以下工具




x265 一種用於符合高效率編碼的函式庫或軟體。 HEIF/HEIC就是使用此編碼
GPAC
ffmpeg 一個強大的自由轉檔軟體,提供多種格式之多媒體轉檔、錄影、串流等功能。



$brew install x265 gpac


$brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
利用cd進入到欲轉換成heic格式的資料夾


例如 位置在 pictures/test


$cd pictures/test





輸入script



$for F in *.jpg *.png *.tif *.tiff *.jpeg; \ do ffmpeg -i "$F" -crf 23 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -preset slower -pix_fmt yuv420p -f hevc "${F%.*}.hvc" && \ MP4Box -add-image "${F%.*}.hvc" -ab heic -new "${F%.*}.heic" && \ rm "${F%.*}.hvc"; done;







留言