Skip to content

cejanen/AVFoundationWorkshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AVFoundation workshop

Source code for AVFoundation workshop

Project

  • UI code is mostly in storyboard, it doesnt bother you
  • Methods we dont use are at the end of class
  • Simple MVC architecture
  • For learning purposes of AVFoundation
  • Code doesnt contain pods or any 3rd party tools

Run

  • Run app in simulator, don't use
  • To run on device change your team in project settings

Tasks

  1. CREATE PREVIEW IMAGE FROM ASSET
  • task in AVAsset+ImagePreview, method called from ImageCollectionViewCell
  • use AVAssetImageGenerator
  • careful copying image is heavy operation
  1. ASYNC LOAD ASSET KEYS
  • task in PreviewViewController
  • use asset loadValuesAsynchronously
  • requiredAssetKeys are prepared for you
  • check all keys are properly loaded
  • set values from keys to metadataTextView
  • dont forget set UI from loadValuesAsynchronously needs to be done on main thread
  1. SET SLOW PLAYBACK TYPE
  1. CREATE NEW ASSET MIXING VIDEO & SOUND
  • task in VideoCompositionViewController
  • create mutable track for video, check video asset has video track
  • create mutable track for audio, check audio asset has audio track
  • note reversed video is prepared for you
  • try to set max time of video to make it nice and faster
  • insert time ranges to proper tracks, compare audio video lenght
  • create video composing instructions with layer instructions and set it properly to videoComposition
  • careful video recorded in portrait would be rotated without updating video size
  • once composition is ready video is exported, save button enabled a video played
  1. BONUS - SEND ME FUNNY VIDEO As bonus try to use remote assets Dont forget that before reversing them or composing them they needed to be downloaded

About

Resository with sample app for AVFoundation workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages