项目
在 GitHub 查看
LimitPoint/LivePhoto
关于
用于处理 Apple Live Photos 的单文件库。
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文![]()
LivePhoto.swift
A single-file helper library to work with Apple Live Photos
A Live Photo is a paired camera photo ("key photo") and video recording ("paired video"). Learn more about Live Photos from our in-depth blog post.
Live Photo format
A Live Photo consists of two resources paired using an asset identifier (a UUID string):
- JPEG image with special metadata for
kCGImagePropertyMakerAppleDictionarywith[17 : assetIdentifier] - Quicktime MOV with
- Quicktime metadata for
["com.apple.quicktime.content.identifier" : assetIdentifier] - Timed metadata track with
["com.apple.quicktime.still-image-time" : 0xFF]. This lets the system know where the still image sits in the movie timeline.
- Quicktime metadata for
LivePhoto.swift
The entire library is contained in the LivePhoto.swift file:
Extracting Resources from PHLivePhoto
LivePhoto.extractResources(from: livePhoto, completion: resources -> Void) {
let pairedImageURL = resources.pairedImageURL
let pairedVideoURL = resources.pairedVideoURL
}
Generating a Live Photo & Saving it to the Photo Library
LivePhoto.generate(from: photoURL, videoURL: videoURL, progress: { percent in }, completion: { livePhoto, resources in
// Display the Live Photo in a PHLivePhotoView
livePhotoView.livePhoto = livePhoto
// Or save the resources to the Photo library
LivePhoto.saveToLibrary(resources)
})
探索相关项目
加载中…