Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Live PhotoをアニメーションGIFに書き出す
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kei Ito
March 30, 2016
Technology
1.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Live PhotoをアニメーションGIFに書き出す
関西モバイルアプリ研究会 #12 の資料です
http://kanmoba.connpass.com/event/28411/
Kei Ito
March 30, 2016
More Decks by Kei Ito
See All by Kei Ito
20211015 Mac CatalystでmacOS用アプリを作る
itok
2
4.5k
20210219 Flutterに入門してみた
itok
1
4.1k
20201009 iOS 14 ウィジェットをつくってみた
itok
1
2.5k
20191206 Property Wrappers 入門
itok
0
1.8k
20190920 iOS 13 対応ではまった話
itok
1
2.5k
20190726 Background App Refresh Taskがやってきた
itok
0
2.4k
20190722 Firebase Remote Configでアドネットワークを管理する
itok
0
1.7k
20190419 iOSアプリで証明書の情報を参照する
itok
0
1.6k
20190412 Android TV向けアプリを作ってみる
itok
0
1.1k
Other Decks in Technology
See All in Technology
DORA_Metrics.pdf
wagnerfusca
1
110
Lambda MicroVMsは常駐サーバーの代わりに なるか? Kiro Crew を動かして検証してみた / Kiro Crew on Lambda MicroVMs
k_adachi_01
2
270
AI Agent入門〜今更聞けないAgentの話〜
hiromimaganuma
0
120
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
1
600
ScotSecure West 2026 - Glasgow
raybugg
0
190
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
3
21k
10年欲しかった音楽管理アプリを、AIと一緒に作りはじめた
judau
1
140
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
710
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
260
AIエージェント時代のPlatform as a Product —— テックリードがPdMとして回す発見・導入・計測 / Platform as a Product in the AI Agent Era
toshi0607
1
400
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
2
450
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
180
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
350
Evolving SEO for Evolving Search Engines
ryanjones
0
300
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Paper Plane
katiecoart
PRO
4
53k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Limits of Empathy - UXLibs8
cassininazir
1
690
Transcript
-JWF1IPUPΛ Ξχϝʔγϣϯ(*'ʹ ॻ͖ग़͢ ؔϞόΠϧΞϓϦݚڀձ !JUPL@UXJU
!JUPL@UXJU w ͍ͱ͏͚͍ʢJUPLʣ w ɹɹɹɹɹɹͷதͷਓ w ެࢲڞʹϓϩάϥϚJ04.BDʢͨ·ʹ"OESPJE8JOEPXTʣ w IUUQJUPLKQ IUUQTPSBLB[FDPKQ
ॴ USZTXJGU։࠵த
-JWF1IPUP͔ͬͯͭͬͯ·͢ʙʁ ڞ༗͢Δͷ͕େมͳΜͰ͢ΑͶʙ Ξχϝʔγϣϯ(*'ʹ͢ΔΞϓϦ ͋ΔΈ͍ͨͳΜͰ͚͢ͲͶ͑ʙ
͋ɺͦΕɺͰ͖·͢Α "7'PVOEBUJPOͱ͔*NBHF*0͑
ͬͯΈͨ
ΰʔϧ
ඞཁͳͷ w J04Ҏ্ w 1IPUPT w "7'PVOEBUJPO w *NBHF*0 w
J1IPOFTT1MVT4&J1BE1SPJODI
-JWF1IPUPΛ୳͢ // get all images let result = PHAsset.fetchAssetsWithMediaType(.Image, options:
nil) var photoAsset: PHAsset? result.enumerateObjectsUsingBlock { (obj, idx, stop) -> Void in let asset = obj as! PHAsset if asset.mediaSubtypes.contains(.PhotoLive) { photoAsset = asset stop.memory = true } })
-JWF1IPUPΛ୳͢ let mgr = PHImageManager.defaultManager() mgr.requestLivePhotoForAsset(photoAsset, targetSize: CGSizeZero, contentMode: .Default,
options: nil) { (livePhoto, info) -> Void in if let livePhoto = livePhoto { self.livePhotoView.livePhoto = livePhoto } }
ಈըΛऔΓग़͢ // search movie in live photo let resources =
PHAssetResource.assetResourcesForLivePhoto(photo) for resource in resources { if resource.type == .PairedVideo { self.getMovieData(resource) break } }
ಈըΛऔΓग़͢ // load movie data let mgr = PHAssetResourceManager.defaultManager() mgr.requestDataForAssetResource(resource,
options: nil, dataReceivedHandler: { (data) -> Void in movieData.appendData(data) }) { (err) -> Void in do { try movieData.writeToURL(movieURL, options:.AtomicWrite) let movieAsset = AVAsset(URL: movieURL) self.convertToGif(movieAsset, resource: resource) } catch { } }
ը૾ΛऔΓग़͢ // generate thumbnails and write to gif let generator
= AVAssetImageGenerator(asset: movieAsset) // generate in any timelines generator.requestedTimeToleranceBefore = kCMTimeZero generator.requestedTimeToleranceAfter = kCMTimeZero // apply video transform generator.appliesPreferredTrackTransform = true generator.maximumSize = CGSizeMake(640, 640) generator.generateCGImagesAsynchronouslyForTimes(times) { (requested, image, actual, result, err) -> Void in // }
"OJNBUJPO(*'ʹॻ͖ग़͢ let gif = CGImageDestinationCreateWithURL (gifURL, kUTTypeGIF, numFrame, nil) let
frameProperty = .. // AVAssetImageGenerator’s loop { CGImageDestinationAddImage(gif, image, frameProperty) } let gifProperty = .. CGImageDestinationSetProperties(gif, gifProperty) CGImageDestinationFinalize(gif) self.webView.loadRequest(NSURLRequest(URL: gifURL))
ίʔυͪ͜Βʹ HJUIVCDPNJUPL-JWF1IPUP5P"OJNBUFE(JG