AVFoundation

Play, capture, edit and export audio and video on every Apple platform.

Introduced
2008
iPhone OS 2.2
Kind
Framework
Runs on
Get it from
iOS
2.2+
iPadOS
13.1+
Mac Catalyst
13.1+
macOS
10.7+
tvOS
9.0+
visionOS
1.0+
watchOS
3.0+
Works in Swift Playground ›

Overview

AVFoundation is the engine behind media on Apple devices: playback with AVPlayer, camera and microphone capture, composition and editing, and export. AVKit adds the system playback UI, from SwiftUI's VideoPlayer to picture in picture.

Recent releases added cinematic video capture, better audio recording and high resolution photos.

Playback

AVPlayer and AVKit, from streaming to picture in picture.

Capture

Camera and microphone, from photos to cinematic video.

Editing

Compose, trim and mix tracks, then export.

Metrics

Measure playback performance and stalls.

TrailerView.swift
import AVKit import SwiftUI struct TrailerView: View { let player = AVPlayer(url: URL(string: "https://example.com/trailer.m3u8")!) var body: some View { VideoPlayer(player: player) .aspectRatio(16 / 9, contentMode: .fit) .onAppear { player.play() } } }

History

How it grew up.

2008

Introduced

Audio playback arrives in iPhone OS 2.2.

2010

Capture and editing

iOS 4 adds camera capture and composition.

2011

Mac

AVFoundation comes to OS X Lion.

2016

Photo capture

A new photo pipeline with Live Photos and RAW capture in iOS 10.

2025

Cinematic video

Capture Cinematic mode video in your app.

Watch and learn