Unofficial AirPlay Protocol
Specification
1. Introduction
2. Service Discovery
o 2.1. AirTunes service
o 2.2. AirPlay Service
3. Photos
o 3.1. HTTP requests
o 3.2. Events
o 3.3. Photo Caching
o 3.4. Slideshows
4. Video
o 4.1. HTTP requests
o 4.2. Events
5. Audio
o 5.1. RTSP requests
o 5.2. RTP Streams
o 5.3. Volume Control
o 5.4. Metadata
o 5.5. AirPort Express Authentication
o 5.6. Remote Control
6. Screen Mirroring
o 6.1. HTTP requests
o 6.2. Stream Packets
o 6.3. Time Synchronization
7. Password Protection
8. History
9. Resources
o 9.1. IETF RFCs
o 9.2. IETF drafts
o 9.3. Apple Protocols
1. Introduction
AirPlay is a family of protocols implemented by Apple to view various
types of media content on the Apple TVfrom any iOS device or
iTunes. In this documentation, “iOS device” refers to an iPhone, iPod
touch or iPad. The following scenarios are supported by AirPlay:
Display photos and slideshows from an iOS device.
Stream audio from an iOS device or iTunes.
Display videos from an iOS device or iTunes.
Show the screen content from an iOS device or OS X Mountain
Lion. This is called AirPlay Mirroring.
It requires hardware
capable of encoding live video without taking too much CPU,
so it is only available on iPhone 4S, iPad 2, the new iPad, and
Macs with Sandy Bridge CPUs.
Audio streaming is also supported from an iOS device or iTunes to an
AirPort Express base station or a 3rd party AirPlay-enabled audio
device. Initially this was called AirTunes, but it was later renamed to
AirPlay when Apple added video support for the Apple TV.
This document describes these protocols, as implemented in Apple
TV software version 5.0, iOS 5.1 and iTunes 10.6. They are based on
well-known standard networking protocols
such as Multicast
DNS, HTTP, RTSP, RTP or NTP, with custom extensions.
All
these information have been gathered by using various
techniques of reverse engineering, so they might be somewhat
inaccurate and incomplete. Moreover,
this document does not
explain how to circumvent any kind of security implemented by
Apple:
It does not give any RSA keys.
It does not explain how to decode iTunes videos protected with
the FairPlay DRM.
It does not explain the FairPlay authentication (SAPv2.5) used
by iOS devices and OS X Mountain Lion to protect audio and
screen content.
Please don’t e-mail me about this, I won’t reply. In fact, none of this is
actually required to be able to view media content on Apple TV.
2. Service Discovery
AirPlay does not
require any configuration to be able to find
compatible devices on the network, thanks to DNS-based service
discovery, based on multicast DNS, aka Bonjour.
An AirPlay device such as the Apple TV publishes two services. The
first one is RAOP (Remote Audio Output Protocol), used for audio
streaming, and the other one is the AirPlay service, for photo and
video content.
2.1. AirTunes service
RAOP SERVICE FROM APPLE TV
name: 5855CA1AE288@Apple TV
type: _raop._tcp
port: 49152
txt:
txtvers=1
ch=2
cn=0,1,2,3
da=true
et=0,3,5
md=0,1,2
pw=false
sv=false
sr=44100
ss=16
tp=UDP
vn=65537
vs=130.14
am=AppleTV2,1
sf=0x4
The name is formed using the MAC address of the device and the
name of the remote speaker which will be shown by the clients.
The following fields appear in the TXT record:
NAME
VALUE
DESCRIPTION
txtvers
1
TXT record version 1
NAME
VALUE
DESCRIPTION
ch
cn
et
md
pw
sr
ss
tp
vs
am
2
audio channels: stereo
0,1,2,3
audio codecs
0,3,5
0,1,2
false
supported encryption types
supported metadata types
does the speaker require a password?
44100
audio sample rate: 44100 Hz
16
UDP
audio sample size: 16-bit
supported transport: TCP or UDP
130.14
server version 130.14
AppleTV2,1
device model
Audio codecs
CN
DESCRIPTION
CN
DESCRIPTION
0
1
2
3
PCM
Apple Lossless (ALAC)
AAC
AAC ELD (Enhanced Low Delay)
Encryption Types
ET
DESCRIPTION
0
1
3
4
5
no encryption
RSA (AirPort Express)
FairPlay
MFiSAP (3rd-party devices)
FairPlay SAPv2.5
Metadata Types
MD
DESCRIPTION
0
1
2
text
artwork
progress
2.2. AirPlay Service
AIRPLAY SERVICE
name: Apple TV
type: _airplay._tcp
port: 7000
txt:
deviceid=58:55:CA:1A:E2:88
features=0x39f7
model=AppleTV2,1
srcvers=130.14
The following fields are available in the TXT record:
NAME
VALUE
DESCRIPTION
NAME
VALUE
DESCRIPTION
model
AppleTV2,1
device model
deviceid
58:55:CA:1A:E2:88
MAC address of the device
features
0x39f7
bitfield of supported features
pw
1
server is password protected
The pw field appears only if the AirPlay server is password protected.
Otherwise it is not included in the TXT record.
The features bitfield allows the following features to be defined:
BIT
NAME
Video
Photo
DESCRIPTION
video supported
photo supported
0
1
2
3
4
VideoFairPlay
video protected with FairPlay DRM
VideoVolumeControl
volume control supported for videos
VideoHTTPLiveStreams
http live streaming supported