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
【若手エンジニア応援LT会】AWSで繋がり、共に成長! ~コミュニティ活動と新人教育への挑戦~
kazushi_ohata
0
180
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
150
LeSSに潜む「隠れWF病」とその処方箋
lycorptech_jp
PRO
2
120
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
フルカイテン株式会社 採用資料
fullkaiten
0
36k
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
独自ツール開発でスタジオ撮影をDX!「VLS(Virtual LED Studio)」 / dx-studio-vls
cyberagentdevelopers
PRO
1
180
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
130
ガチ勢によるPipeCD運用大全〜滑らかなCI/CDを添えて〜 / ai-pipecd-encyclopedia
cyberagentdevelopers
PRO
3
200
ABEMA のコンテンツ制作を最適化!生成 AI x クラウド映像編集システム / abema-ai-editor
cyberagentdevelopers
PRO
1
180
サイバーエージェントにおける生成AIのリスキリング施策の取り組み / cyber-ai-reskilling
cyberagentdevelopers
PRO
2
200
pandasはPolarsに性能面で追いつき追い越せるのか
vaaaaanquish
4
4.5k
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
1
40
Side Projects
sachag
452
42k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
A Philosophy of Restraint
colly
203
16k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Building Your Own Lightsaber
phodgson
102
6k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Being A Developer After 40
akosma
86
590k
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