Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AV Foundation
Search
nakajijapan
February 01, 2014
Technology
4
780
AV Foundation
心霊動画アプリ「もう一度ご覧いただこう」を作成してみて
Conference With Developers 2014
nakajijapan
February 01, 2014
Tweet
Share
More Decks by nakajijapan
See All by nakajijapan
サービスにおけるDesign Systemの構築
nakajijapan
6
3.4k
Markdownをリアルタイムに解析する
nakajijapan
4
4.2k
Firebase Authorization
nakajijapan
0
210
Intoducing Izumo
nakajijapan
1
1.8k
Practical CloudKit
nakajijapan
1
1.7k
Introducing to Ajimi - プロダクトを味見していこう
nakajijapan
0
2k
Shari
nakajijapan
1
2.6k
Japan Apple Pay Development
nakajijapan
0
240
業務で絶対必要にならない技術
nakajijapan
0
760
Other Decks in Technology
See All in Technology
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
Engineer Career Talk
lycorp_recruit_jp
0
170
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
AGIについてChatGPTに聞いてみた
blueb
0
130
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
140
The Rise of LLMOps
asei
7
1.5k
いざ、BSC討伐の旅
nikinusu
2
780
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Writing Fast Ruby
sferik
627
61k
Speed Design
sergeychernyshev
25
620
Typedesign – Prime Four
hannesfritz
40
2.4k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Designing Experiences People Love
moore
138
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Transcript
"7'PVOEBUJPO ৺ྶಈըΞϓϦʮ͏Ұ͝ཡ͍ͨͩ͜͏ʯΛ࡞ͯ͠Έͯ !OBLBKJKBQBO
ࠓ͢͜ͱ w ࣗݾհ w ΞϓϦհ w "7'PVOEBUJPOΛ࣮ͬͨ͋Ε͜Ε w ॴײ
ࣗݾհ !OBLBKJKBQBO QBQFSCPZDP
!JTPEJOF
!JTPEJOF ςϨϏͰΔΑ͏ͳ৺ྶ൪ Έ͍ͨͳಈը࡞Γ͍ͨΜʙ
͍
None
IUUQPXLSJOGPNPWJF ͏Ұ͝ཡ͍ͨͩ͜͏ ৺ྶಈըΞϓϦ
ओͳػೳ w ಈըը w ಈըʹ৺ྶΛೖΕΔ w ಈըʹςϩοϓͱϫΠϓ w ಈըͷγνϡΤʔγϣϯʹ߹ΘͤͯφϨʔγϣϯ ΛೖΕΔ
w ιʔγϟϧڞ༗
w .FEJB1MBZFS'SBNFXPSL w 6*,JU ্ҐͷϑϨʔϜϫʔΫ
"7'PVOEBUJPO
ௐࠪ
ௐࠪ w "7'PVOEBUJPO1SPHSBNNJOH(VJEF w .PWJOHUP"7,JUBOE"7'PVOEBUJPOr w $PSF*NBHF&GGFDUTBOE5FDIOJRVFTr w
"EWBODFE&EJUJOHXJUI"7'PVOEBUJPOr
ߏ
εϩʔϞʔγϣϯಈը TFD TFD TFD φϨʔγϣϯԻ ϫΠϓ ը૾߹ ಈը݁߹ ಈը݁߹
࣮
ಈը݁߹
// Assetੜ AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil]; !
// CompositionTrackੜ AVMutableCompositionTrack* compositionVideoTrack; compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; ! // Ξηοτ͔ΒτϥοΫΛऔಘ AVAssetTrack *videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; ! // ઃఆ [compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:videoTrack atTime:self.currentTimeDuration error:nil]; [compositionVideoTrack setPreferredTransform:[[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] preferredTransform]]; AVMutableCompositionTrack *compositionAudioTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; // Assetੜ [compositionAudioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:self.currentTimeDuration error:nil]; self.currentTimeDuration = [mixComposition duration]; ! // Layer InstructionͷՃ AVMutableVideoCompositionLayerInstruction *layerInstruction; layerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:compositionVideoTrack]; ! [self.layerInstructions addObject:layerInstruction]; ϝσΟΞใΛอ࣋͠ɺͦͷใΛऔಘͰ͖Δ
// Assetੜ AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil]; !
// CompositionTrackੜ AVMutableCompositionTrack* compositionVideoTrack; compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; ! // Ξηοτ͔ΒτϥοΫΛऔಘ AVAssetTrack *videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; ! // ઃఆ [compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:videoTrack atTime:self.currentTimeDuration error:nil]; [compositionVideoTrack setPreferredTransform:[[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] preferredTransform]]; AVMutableCompositionTrack *compositionAudioTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; // Assetੜ [compositionAudioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:self.currentTimeDuration error:nil]; self.currentTimeDuration = [mixComposition duration]; ! // Layer InstructionͷՃ AVMutableVideoCompositionLayerInstruction *layerInstruction; layerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:compositionVideoTrack]; ! [self.layerInstructions addObject:layerInstruction]; ө૾ΛऔΓग़͢ ԻΛऔΓग़͢
// Assetੜ AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil]; !
// CompositionTrackੜ AVMutableCompositionTrack* compositionVideoTrack; compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; ! // Ξηοτ͔ΒτϥοΫΛऔಘ AVAssetTrack *videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; ! // ઃఆ [compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:videoTrack atTime:self.currentTimeDuration error:nil]; [compositionVideoTrack setPreferredTransform:[[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] preferredTransform]]; AVMutableCompositionTrack *compositionAudioTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; // Assetੜ [compositionAudioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:self.currentTimeDuration error:nil]; self.currentTimeDuration = [mixComposition duration]; ! // Layer InstructionͷՃ AVMutableVideoCompositionLayerInstruction *layerInstruction; layerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:compositionVideoTrack]; ! [self.layerInstructions addObject:layerInstruction]; ίϯϙδγϣϯΛΈཱͯΔ
ը૾ͷ߹ͱ Ξχϝʔγϣϯ
None
// generate parent layer CALayer* layerRoot = [CALayer layer]; CALayer*
layerVideo = [CALayer layer]; . . . . videoComp = [AVMutableVideoComposition videoComposition]; videoComp.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:layerVideo inLayer:layerRoot]; $"-BZFSʹ$"#BTJD"OJNBUJPOͰ ઃఆͨ͠ΞχϝʔγϣϯΛՃ͢Δ
ϫΠϓಈը
None
// Assetੜ AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil]; //
CompositionTrackੜ AVMutableCompositionTrack* compositionVideoTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; // Trackऔಘ AVAssetTrack* videoTrack = [[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; ! // ઃఆ CMTime timeDuration; timeDuration = videoAsset.duration; ! [compositionVideoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, timeDuration) ofTrack:videoTrack atTime:kCMTimeZero error:nil]; [compositionVideoTrack setPreferredTransform:[videoTrack preferredTransform]]; AVMutableVideoCompositionLayerInstruction* layerInstruction; layerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:compositionVideoTrack]; [layerInstruction setTransform:CGAffineTransformConcat(scale, trnsration) atTime:kCMTimeZero]; ! [self.layerInstructions addObject:layerInstruction]; ΞϑΟϯม
εϩʔϞʔγϣϯ
// શମʹରͯ͠εϩʔϞʔγϣϯॲཧΛ͔͚Δ CMTime durationSlow = CMTimeSubtract(videoAsset.duration, CMTimeMake(9, 1)); [mixComposition scaleTimeRange:CMTimeRangeMake(CMTimeMake(19,
1), durationSlow) toDuration:CMTimeMake(durationSlow.value * 2.0, durationSlow.timescale)]; ࣮ࡍͷө૾Λ̎ഒͷ࣌ؒͰग़ྗͤ͞Δ
εϩʔϞʔγϣϯ ϫΠϓಈը ը૾ͷ߹ͱΞχϝʔγϣϯ ಈը݁߹ ࣮
"7'PVOEBUJPO
ॴײ w Ϋϥε໊͔ͬͨΓ࣮ྔ͕ଟͯ͘େมʂ w ͱ͍͑ઃܭ͢Β͍͠ w ใ͕গͳ͍ w ϋϚΔͱ໎ঢ়ଶ w
ࣄͰશ͘׆͔ͤͳ͍ʂʂʂ
4BNQMF.PWJF IUUQTXXXZPVUVCFDPNXBUDI WLKPXF43%* %FNP.PWJF IUUQTXXXZPVUVCFDPNXBUDI WSKUNK:6
5IBOLT