SlideShare a Scribd company logo
1 of 16
Video Handling on
Apple Platforms
By Satendra Singh
Info Edge (India) Limited
Techno Speak - OCT 2017
Media Architecture in iOS and OS X
AvKit
Create view-level services for media playback, complete with user
controls, chapter navigation, and support for subtitles and closed
captioning.
What is AVFoundation
AVFoundation framework combines four major technology areas:
● Media Capture
- Capture photos and record video and audio; configure built-in cameras and
microphones or external capture devices.
● Audio
- Configure Audio sessions, Play, Record, mix and process audios
● Playback and Editing
- Access media assets and inspect their content; queue media for playback and
customize playback behavior; edit and combine assets with compositions; import and export
raw media streams.
What is AVFoundation
● Speech
- Convert text to audio
All these together encompass a wide range of tasks for capturing, processing, synthesizing,
controlling, importing and exporting audiovisual media on Apple platforms.
Cameras and Media Capture
To capture media we need following entities:
Session -
AVCaptureSession
An object that manages capture activity and coordinates the flow of data from input devices to capture
outputs.
Input -
AVCaptureInput
The abstract superclass for objects that provide input data to a capture session.
AVCaptureScreenInput - A capture input for recording from a screen in macOS.
Cameras and Media Capture
Output -
class AVCaptureOutput
The abstract superclass for objects that output the media recorded in a capture session.
AVCaptureStillImageOutput - A capture output for capturing still photos in macOS.
Preview -
AVCaptureVideoPreviewLayer
A Core Animation layer that can display video as it is being captured.
AVCaptureAudioPreviewOutput
A capture output that provides preview playback for audio being recorded in a capture session.
Example Application - AVScreenShack
Media Assets, Playback and Editing
What is AVAsset?
● AVAsset is an abstract, immutable class used to model timed audiovisual media
such as videos and sounds.
● An asset may contain one or more tracks.
● A track may contain audio, video, text, closed captions, and subtitles.
Media Assets, Playback and Editing
What is CMTime?
● In general we can say the CMTime represent the frame position in an asset.
● A struct representing a time value such as a timestamp or duration.
● A CMTime is represented as a rational number, with a numerator (an int64_t value), and a
denominator (an int32_t timescale).
Media Assets, Playback and Editing
What is Frame?
A video frame often has information associated with it that is useful to the system that displays it. In
Core Video, this information is associated with a video frame as an attachment. Attachments are Core
Foundation objects representing various types of data as following:
● Color space: A color space is the model used to represent an image, such as RGB or CMYK etc.
● Square versus rectangular pixels: Digital video on computers typically use square pixels. However, TV
uses rectangular pixels, so you need to compensate for this discrepancy if you are creating video for broadcast.
● Timestamps: a timestamp represents when a particular frame appears in a movie.Timestamps make it easy to
isolate particular movie frames, and simplify synchronization of multiple video and audio tracks.
Media Assets, Playback and Editing
How Asset editing work?
● Output
-AVAssetWriter
We use an AVAssetWriter object to write media data to a new file of a specified
audiovisual container type, such as a QuickTime movie file or an MPEG-4 file, with support for automatic
interleaving of media data for multiple concurrent tracks.
● Input
-AVAssetWriterInput
We use an AVAssetWriterInput to append media samples packaged as
CMSampleBuffer objects (see CMSampleBuffer), or collections of metadata, to a single track of the
output file of an AVAssetWriter object.
Media Assets, Playback and Editing
● Input Adapter
-AVAssetWriterInputPixelBufferAdaptor
We use an AVAssetWriterInputPixelBufferAdaptor to append video samples
packaged as CVPixelBuffer objects to a single AVAssetWriterInput object.
● Pixel Buffer
- We use CVPixelBufferRef to create Core Image buffers that hold pixels in main
memory.
● Rendering Context
- We Use CGContextRef to draw the image and other elements in the
context.Context is generated using CVPixelBufferRef.
Example Application - Record Screen
https://developer.apple.com/documentation/avfoundation
What is remaining?
● Merge multiple videos
● Record audio
● Merge/replace audio tracks in video
● Synthesizing

More Related Content

Similar to [@NaukriEngineering] Video handlings on apple platforms

Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Chris Adamson
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX OverviewYoss Cohen
 
How to make a video - Part 2: Post-Production Basics
How to make a video - Part 2: Post-Production BasicsHow to make a video - Part 2: Post-Production Basics
How to make a video - Part 2: Post-Production BasicsKris Brewer
 
Videostream compression in iOS
Videostream compression in iOSVideostream compression in iOS
Videostream compression in iOS*instinctools
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasChris Adamson
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment a8us
 
An Integrated Asset Management Solution For Quantel sQ Servers
An Integrated Asset Management Solution For Quantel sQ ServersAn Integrated Asset Management Solution For Quantel sQ Servers
An Integrated Asset Management Solution For Quantel sQ ServersQuantel
 
4 multimedia elements - video
4   multimedia elements - video4   multimedia elements - video
4 multimedia elements - videoKelly Bauer
 
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...Edge AI and Vision Alliance
 

Similar to [@NaukriEngineering] Video handlings on apple platforms (20)

Video-Editing Techniques.pptx
Video-Editing Techniques.pptxVideo-Editing Techniques.pptx
Video-Editing Techniques.pptx
 
SLA Captivate
SLA CaptivateSLA Captivate
SLA Captivate
 
Product Experience
Product ExperienceProduct Experience
Product Experience
 
Software
SoftwareSoftware
Software
 
Software
SoftwareSoftware
Software
 
Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014Stupid Video Tricks, CocoaConf Seattle 2014
Stupid Video Tricks, CocoaConf Seattle 2014
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX Overview
 
How to make a video - Part 2: Post-Production Basics
How to make a video - Part 2: Post-Production BasicsHow to make a video - Part 2: Post-Production Basics
How to make a video - Part 2: Post-Production Basics
 
Cinemarkup
CinemarkupCinemarkup
Cinemarkup
 
dat-Tempo-Final
dat-Tempo-Finaldat-Tempo-Final
dat-Tempo-Final
 
Videostream compression in iOS
Videostream compression in iOSVideostream compression in iOS
Videostream compression in iOS
 
Stupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las VegasStupid Video Tricks, CocoaConf Las Vegas
Stupid Video Tricks, CocoaConf Las Vegas
 
Stupid Video Tricks
Stupid Video TricksStupid Video Tricks
Stupid Video Tricks
 
Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment Utf 8'en'ibm sametime 9 - voice and video deployment
Utf 8'en'ibm sametime 9 - voice and video deployment
 
EBAY presentation
EBAY presentationEBAY presentation
EBAY presentation
 
An Integrated Asset Management Solution For Quantel sQ Servers
An Integrated Asset Management Solution For Quantel sQ ServersAn Integrated Asset Management Solution For Quantel sQ Servers
An Integrated Asset Management Solution For Quantel sQ Servers
 
Mini Project- Digital Video Editing
Mini Project- Digital Video EditingMini Project- Digital Video Editing
Mini Project- Digital Video Editing
 
4 multimedia elements - video
4   multimedia elements - video4   multimedia elements - video
4 multimedia elements - video
 
Pod handler
Pod handlerPod handler
Pod handler
 
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
 

More from Naukri.com

[@NaukriEngineering] Deferred deep linking in iOS
[@NaukriEngineering] Deferred deep linking in iOS[@NaukriEngineering] Deferred deep linking in iOS
[@NaukriEngineering] Deferred deep linking in iOSNaukri.com
 
[@NaukriEngineering] Instant Apps
[@NaukriEngineering] Instant Apps[@NaukriEngineering] Instant Apps
[@NaukriEngineering] Instant AppsNaukri.com
 
[@NaukriEngineering] Introduction to Android O
[@NaukriEngineering] Introduction to Android O[@NaukriEngineering] Introduction to Android O
[@NaukriEngineering] Introduction to Android ONaukri.com
 
[@NaukriEngineering] MVVM in iOS
[@NaukriEngineering] MVVM in iOS[@NaukriEngineering] MVVM in iOS
[@NaukriEngineering] MVVM in iOSNaukri.com
 
[@NaukriEngineering] Introduction to Galera cluster
[@NaukriEngineering] Introduction to Galera cluster[@NaukriEngineering] Introduction to Galera cluster
[@NaukriEngineering] Introduction to Galera clusterNaukri.com
 
[@NaukriEngineering] Inbound Emails for Every Web App: Angle
[@NaukriEngineering] Inbound Emails for Every Web App: Angle[@NaukriEngineering] Inbound Emails for Every Web App: Angle
[@NaukriEngineering] Inbound Emails for Every Web App: AngleNaukri.com
 
[@NaukriEngineering] BDD implementation using Cucumber
[@NaukriEngineering] BDD implementation using Cucumber[@NaukriEngineering] BDD implementation using Cucumber
[@NaukriEngineering] BDD implementation using CucumberNaukri.com
 
[@NaukriEngineering] Feature Toggles
[@NaukriEngineering] Feature Toggles[@NaukriEngineering] Feature Toggles
[@NaukriEngineering] Feature TogglesNaukri.com
 
[@NaukriEngineering] Apache Spark
[@NaukriEngineering] Apache Spark[@NaukriEngineering] Apache Spark
[@NaukriEngineering] Apache SparkNaukri.com
 
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
[@NaukriEngineering] Icon fonts & vector drawable in iOS appsNaukri.com
 
[@NaukriEngineering] AppTracer
[@NaukriEngineering] AppTracer[@NaukriEngineering] AppTracer
[@NaukriEngineering] AppTracerNaukri.com
 
[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux Architecture[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux ArchitectureNaukri.com
 
[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using Appium[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using AppiumNaukri.com
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and HacksNaukri.com
 
[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDBNaukri.com
 
[@NaukriEngineering] CSS4 Selectors – Part 1
[@NaukriEngineering] CSS4 Selectors – Part 1[@NaukriEngineering] CSS4 Selectors – Part 1
[@NaukriEngineering] CSS4 Selectors – Part 1Naukri.com
 

More from Naukri.com (18)

[@NaukriEngineering] Deferred deep linking in iOS
[@NaukriEngineering] Deferred deep linking in iOS[@NaukriEngineering] Deferred deep linking in iOS
[@NaukriEngineering] Deferred deep linking in iOS
 
[@NaukriEngineering] Instant Apps
[@NaukriEngineering] Instant Apps[@NaukriEngineering] Instant Apps
[@NaukriEngineering] Instant Apps
 
[@NaukriEngineering] Introduction to Android O
[@NaukriEngineering] Introduction to Android O[@NaukriEngineering] Introduction to Android O
[@NaukriEngineering] Introduction to Android O
 
[@NaukriEngineering] MVVM in iOS
[@NaukriEngineering] MVVM in iOS[@NaukriEngineering] MVVM in iOS
[@NaukriEngineering] MVVM in iOS
 
[@NaukriEngineering] Introduction to Galera cluster
[@NaukriEngineering] Introduction to Galera cluster[@NaukriEngineering] Introduction to Galera cluster
[@NaukriEngineering] Introduction to Galera cluster
 
[@NaukriEngineering] Inbound Emails for Every Web App: Angle
[@NaukriEngineering] Inbound Emails for Every Web App: Angle[@NaukriEngineering] Inbound Emails for Every Web App: Angle
[@NaukriEngineering] Inbound Emails for Every Web App: Angle
 
[@NaukriEngineering] BDD implementation using Cucumber
[@NaukriEngineering] BDD implementation using Cucumber[@NaukriEngineering] BDD implementation using Cucumber
[@NaukriEngineering] BDD implementation using Cucumber
 
[@NaukriEngineering] Feature Toggles
[@NaukriEngineering] Feature Toggles[@NaukriEngineering] Feature Toggles
[@NaukriEngineering] Feature Toggles
 
[@NaukriEngineering] Apache Spark
[@NaukriEngineering] Apache Spark[@NaukriEngineering] Apache Spark
[@NaukriEngineering] Apache Spark
 
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
[@NaukriEngineering] Icon fonts & vector drawable in iOS apps
 
[@NaukriEngineering] AppTracer
[@NaukriEngineering] AppTracer[@NaukriEngineering] AppTracer
[@NaukriEngineering] AppTracer
 
[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux Architecture[@NaukriEngineering] Flux Architecture
[@NaukriEngineering] Flux Architecture
 
[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using Appium[@NaukriEngineering] Mobile Web app scripts execution using Appium
[@NaukriEngineering] Mobile Web app scripts execution using Appium
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks
 
[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB[@NaukriEngineering] IndexedDB
[@NaukriEngineering] IndexedDB
 
[@NaukriEngineering] CSS4 Selectors – Part 1
[@NaukriEngineering] CSS4 Selectors – Part 1[@NaukriEngineering] CSS4 Selectors – Part 1
[@NaukriEngineering] CSS4 Selectors – Part 1
 

Recently uploaded

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 

Recently uploaded (7)

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 

[@NaukriEngineering] Video handlings on apple platforms

  • 1. Video Handling on Apple Platforms By Satendra Singh Info Edge (India) Limited Techno Speak - OCT 2017
  • 2. Media Architecture in iOS and OS X
  • 3. AvKit Create view-level services for media playback, complete with user controls, chapter navigation, and support for subtitles and closed captioning.
  • 4. What is AVFoundation AVFoundation framework combines four major technology areas: ● Media Capture - Capture photos and record video and audio; configure built-in cameras and microphones or external capture devices. ● Audio - Configure Audio sessions, Play, Record, mix and process audios ● Playback and Editing - Access media assets and inspect their content; queue media for playback and customize playback behavior; edit and combine assets with compositions; import and export raw media streams.
  • 5. What is AVFoundation ● Speech - Convert text to audio All these together encompass a wide range of tasks for capturing, processing, synthesizing, controlling, importing and exporting audiovisual media on Apple platforms.
  • 6. Cameras and Media Capture To capture media we need following entities: Session - AVCaptureSession An object that manages capture activity and coordinates the flow of data from input devices to capture outputs. Input - AVCaptureInput The abstract superclass for objects that provide input data to a capture session. AVCaptureScreenInput - A capture input for recording from a screen in macOS.
  • 7. Cameras and Media Capture Output - class AVCaptureOutput The abstract superclass for objects that output the media recorded in a capture session. AVCaptureStillImageOutput - A capture output for capturing still photos in macOS. Preview - AVCaptureVideoPreviewLayer A Core Animation layer that can display video as it is being captured. AVCaptureAudioPreviewOutput A capture output that provides preview playback for audio being recorded in a capture session.
  • 8. Example Application - AVScreenShack
  • 9. Media Assets, Playback and Editing What is AVAsset? ● AVAsset is an abstract, immutable class used to model timed audiovisual media such as videos and sounds. ● An asset may contain one or more tracks. ● A track may contain audio, video, text, closed captions, and subtitles.
  • 10. Media Assets, Playback and Editing What is CMTime? ● In general we can say the CMTime represent the frame position in an asset. ● A struct representing a time value such as a timestamp or duration. ● A CMTime is represented as a rational number, with a numerator (an int64_t value), and a denominator (an int32_t timescale).
  • 11. Media Assets, Playback and Editing What is Frame? A video frame often has information associated with it that is useful to the system that displays it. In Core Video, this information is associated with a video frame as an attachment. Attachments are Core Foundation objects representing various types of data as following: ● Color space: A color space is the model used to represent an image, such as RGB or CMYK etc. ● Square versus rectangular pixels: Digital video on computers typically use square pixels. However, TV uses rectangular pixels, so you need to compensate for this discrepancy if you are creating video for broadcast. ● Timestamps: a timestamp represents when a particular frame appears in a movie.Timestamps make it easy to isolate particular movie frames, and simplify synchronization of multiple video and audio tracks.
  • 12. Media Assets, Playback and Editing How Asset editing work? ● Output -AVAssetWriter We use an AVAssetWriter object to write media data to a new file of a specified audiovisual container type, such as a QuickTime movie file or an MPEG-4 file, with support for automatic interleaving of media data for multiple concurrent tracks. ● Input -AVAssetWriterInput We use an AVAssetWriterInput to append media samples packaged as CMSampleBuffer objects (see CMSampleBuffer), or collections of metadata, to a single track of the output file of an AVAssetWriter object.
  • 13. Media Assets, Playback and Editing ● Input Adapter -AVAssetWriterInputPixelBufferAdaptor We use an AVAssetWriterInputPixelBufferAdaptor to append video samples packaged as CVPixelBuffer objects to a single AVAssetWriterInput object. ● Pixel Buffer - We use CVPixelBufferRef to create Core Image buffers that hold pixels in main memory. ● Rendering Context - We Use CGContextRef to draw the image and other elements in the context.Context is generated using CVPixelBufferRef.
  • 14. Example Application - Record Screen
  • 16. What is remaining? ● Merge multiple videos ● Record audio ● Merge/replace audio tracks in video ● Synthesizing