프로젝트
GitHub에서 보기
LimitPoint/LivePhoto
소개
Apple Live Photos를 다루는 단일 파일 라이브러리입니다.
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original![]()
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)
})
관련 프로젝트 살펴보기
불러오는 중…