<s>
Real-Time	B-Operating_System
Messaging	I-Operating_System
Protocol	I-Operating_System
(	O
RTMP	O
)	O
is	O
a	O
communication	O
protocol	O
for	O
streaming	O
audio	O
,	O
video	O
,	O
and	O
data	O
over	O
the	O
Internet	O
.	O
</s>
<s>
Originally	O
developed	O
as	O
a	O
proprietary	O
protocol	O
by	O
Macromedia	O
for	O
streaming	O
between	O
Flash	B-Operating_System
Player	I-Operating_System
and	O
the	O
Flash	B-Operating_System
Communication	O
Server	O
,	O
Adobe	O
(	O
which	O
acquired	O
Macromedia	O
)	O
has	O
released	O
an	O
incomplete	O
version	O
of	O
the	O
specification	O
of	O
the	O
protocol	O
for	O
public	O
use	O
.	O
</s>
<s>
RTMP	O
proper	O
,	O
the	O
"	O
plain	O
"	O
protocol	O
which	O
works	O
on	O
top	O
of	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
and	O
uses	O
port	B-Protocol
number	I-Protocol
1935	O
by	O
default	O
.	O
</s>
<s>
RTMPS	B-Operating_System
,	O
which	O
is	O
RTMP	O
over	O
a	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS/SSL	B-Protocol
)	O
connection	O
.	O
</s>
<s>
RTMPT	B-Operating_System
,	O
which	O
is	O
encapsulated	B-Protocol
within	O
HTTP	B-Protocol
requests	I-Protocol
to	O
traverse	O
firewalls	B-Application
.	O
</s>
<s>
RTMPT	B-Operating_System
is	O
frequently	O
found	O
utilizing	O
cleartext	O
requests	O
on	O
TCP	B-Protocol
ports	I-Protocol
80	O
and	O
443	O
to	O
bypass	O
most	O
corporate	O
traffic	O
filtering	O
.	O
</s>
<s>
The	O
encapsulated	B-Protocol
session	O
may	O
carry	O
plain	O
RTMP	O
,	O
RTMPS	B-Operating_System
,	O
or	O
RTMPE	O
packets	O
within	O
.	O
</s>
<s>
RTMFP	B-Application
,	O
which	O
is	O
RTMP	O
over	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
instead	O
of	O
TCP	O
,	O
replacing	O
RTMP	O
Chunk	O
Stream	O
.	O
</s>
<s>
The	O
Secure	O
Real-Time	B-Application
Media	I-Application
Flow	I-Application
Protocol	I-Application
suite	O
has	O
been	O
developed	O
by	O
Adobe	O
Systems	O
and	O
enables	O
end‐users	O
to	O
connect	O
and	O
communicate	O
directly	O
with	O
each	O
other	O
(	O
P2P	O
)	O
.	O
</s>
<s>
While	O
the	O
primary	O
motivation	O
for	O
RTMP	O
was	O
to	O
be	O
a	O
protocol	O
for	O
playing	O
Flash	B-Operating_System
video	I-Operating_System
,	O
it	O
is	O
also	O
used	O
in	O
some	O
other	O
applications	O
,	O
such	O
as	O
the	O
Adobe	O
LiveCycle	O
Data	O
Services	O
ES	O
.	O
</s>
<s>
Fragments	O
from	O
different	O
streams	O
may	O
then	O
be	O
interleaved	O
,	O
and	O
multiplexed	B-Architecture
over	O
a	O
single	O
connection	O
.	O
</s>
<s>
Instead	O
,	O
the	O
interleaving	O
and	O
multiplexing	B-Architecture
is	O
done	O
at	O
the	O
packet	O
level	O
,	O
with	O
RTMP	O
packets	O
across	O
several	O
different	O
active	O
channels	O
being	O
interleaved	O
in	O
such	O
a	O
way	O
as	O
to	O
ensure	O
that	O
each	O
channel	O
meets	O
its	O
bandwidth	O
,	O
latency	O
,	O
and	O
other	O
quality-of-service	O
requirements	O
.	O
</s>
<s>
For	O
example	O
,	O
there	O
is	O
a	O
channel	O
for	O
handling	O
RPC	O
requests	O
and	O
responses	O
,	O
a	O
channel	O
for	O
video	B-Application
stream	I-Application
data	O
,	O
a	O
channel	O
for	O
audio	O
stream	O
data	O
,	O
a	O
channel	O
for	O
out-of-band	O
control	O
messages	O
(	O
fragment	O
size	O
negotiation	O
,	O
etc	O
.	O
</s>
<s>
At	O
a	O
higher	O
level	O
,	O
the	O
RTMP	O
encapsulates	O
MP3	B-Application
or	O
AAC	B-Application
audio	O
and	O
FLV1	B-Operating_System
video	I-Operating_System
multimedia	O
streams	O
,	O
and	O
can	O
make	O
remote	B-Operating_System
procedure	I-Operating_System
calls	I-Operating_System
(	O
RPCs	O
)	O
using	O
the	O
Action	B-Protocol
Message	I-Protocol
Format	I-Protocol
.	O
</s>
<s>
Using	O
industry	O
standard	O
TLS/SSL	B-Protocol
mechanisms	O
.	O
</s>
<s>
The	O
underlying	O
RTMP	O
session	O
is	O
simply	O
wrapped	O
inside	O
a	O
normal	O
TLS/SSL	B-Protocol
session	O
.	O
</s>
<s>
In	O
RTMP	O
Tunneled	O
(	O
RTMPT	B-Operating_System
)	O
,	O
RTMP	O
data	O
is	O
encapsulated	B-Protocol
and	O
exchanged	O
via	O
HTTP	B-Protocol
,	O
and	O
messages	O
from	O
the	O
client	O
(	O
the	O
media	O
player	O
,	O
in	O
this	O
case	O
)	O
are	O
addressed	O
to	O
port	O
80	O
(	O
the	O
default	O
for	O
HTTP	B-Protocol
)	O
on	O
the	O
server	O
.	O
</s>
<s>
While	O
the	O
messages	O
in	O
RTMPT	B-Operating_System
are	O
larger	O
than	O
the	O
equivalent	O
non-tunneled	O
RTMP	O
messages	O
due	O
to	O
HTTP	B-Protocol
headers	O
,	O
RTMPT	B-Operating_System
may	O
facilitate	O
the	O
use	O
of	O
RTMP	O
in	O
scenarios	O
where	O
the	O
use	O
of	O
non-tunneled	O
RTMP	O
would	O
otherwise	O
not	O
be	O
possible	O
,	O
such	O
as	O
when	O
the	O
client	O
is	O
behind	O
a	O
firewall	B-Application
that	O
blocks	O
non-HTTP	O
and	O
non-HTTPS	O
outbound	O
traffic	O
.	O
</s>
<s>
The	O
protocol	O
works	O
by	O
sending	O
commands	O
through	O
the	O
POST	O
URL	O
,	O
and	O
AMF	B-Protocol
messages	O
through	O
the	O
POST	O
body	O
.	O
</s>
<s>
A	O
document	O
accompanying	O
the	O
Adobe	O
specification	O
grants	O
"	O
non-exclusive	O
,	O
royalty-free	O
,	O
nontransferable	O
,	O
non-sublicensable	O
,	O
personal	O
,	O
worldwide	O
"	O
patent	O
license	O
to	O
all	O
implementations	O
of	O
the	O
protocol	O
,	O
with	O
two	O
restrictions	O
:	O
one	O
forbids	O
use	O
for	O
intercepting	O
streaming	O
data	O
(	O
"	O
any	O
technology	O
that	O
intercepts	O
streaming	B-Application
video	I-Application
,	O
audio	O
and/or	O
data	O
content	O
for	O
storage	O
in	O
any	O
device	O
or	O
medium	O
"	O
)	O
,	O
and	O
another	O
prohibits	O
circumvention	O
of	O
"	O
technological	O
measures	O
for	O
the	O
protection	O
of	O
audio	O
,	O
video	O
and/or	O
data	O
content	O
,	O
including	O
any	O
of	O
Adobe	O
’s	O
secure	O
RTMP	O
measures	O
"	O
.	O
</s>
<s>
Stefan	O
Richter	O
,	O
author	O
of	O
some	O
books	O
on	O
Flash	B-Operating_System
,	O
noted	O
in	O
2008	O
that	O
while	O
Adobe	O
is	O
vague	O
as	O
to	O
which	O
patents	O
apply	O
to	O
RTMP	O
,	O
appears	O
to	O
be	O
one	O
of	O
them	O
.	O
</s>
<s>
They	O
contain	O
a	O
header	O
and	O
a	O
body	O
which	O
,	O
in	O
the	O
case	O
of	O
connection	O
and	O
control	O
commands	O
,	O
is	O
encoded	O
using	O
the	O
Action	B-Protocol
Message	I-Protocol
Format	I-Protocol
(	O
AMF	B-Protocol
)	O
.	O
</s>
<s>
Depending	O
on	O
the	O
value	O
of	O
the	O
former	O
,	O
some	O
fields	O
of	O
the	O
Message	O
Header	O
can	O
be	O
omitted	O
,	O
and	O
their	O
value	O
derived	O
from	O
previous	O
packets	O
while	O
depending	O
on	O
the	O
value	O
of	O
the	O
latter	O
,	O
the	O
Basic	O
Header	O
can	O
be	O
extended	O
with	O
one	O
or	O
two	O
extra	O
bytes	O
(	O
as	O
in	O
the	O
case	O
of	O
the	O
diagramme	O
that	O
has	O
three	O
bytes	O
in	O
total	O
(	O
c	B-Language
)	O
)	O
.	O
</s>
<s>
An	O
example	O
is	O
shown	O
below	O
as	O
captured	O
when	O
a	O
flash	B-Operating_System
client	O
executes	O
the	O
following	O
code	O
:	O
</s>
<s>
Some	O
of	O
the	O
message	O
types	O
shown	O
above	O
,	O
such	O
as	O
Ping	O
and	O
Set	O
Client/Server	O
Bandwidth	O
,	O
are	O
considered	O
low	O
level	O
RTMP	O
protocol	O
messages	O
which	O
do	O
not	O
use	O
the	O
AMF	B-Protocol
encoding	O
format	O
.	O
</s>
<s>
The	O
value	O
can	O
be	O
either	O
a	O
string	O
like	O
in	O
the	O
example	O
above	O
or	O
one	O
or	O
more	O
objects	O
,	O
each	O
composed	O
of	O
a	O
set	O
of	O
key/value	O
pairs	O
where	O
the	O
keys	O
are	O
always	O
encoded	O
as	O
strings	O
while	O
the	O
values	O
can	O
be	O
any	O
AMF	B-Protocol
data	O
type	O
,	O
including	O
complex	O
types	O
like	O
arrays	O
.	O
</s>
<s>
Control	O
messages	O
are	O
not	O
AMF	B-Protocol
encoded	I-Protocol
.	O
</s>
<s>
Type	O
34	O
-	O
RTMFP	B-Application
Sync	O
.	O
</s>
<s>
Type	O
41	O
-	O
RTMFP	B-Application
Set	O
Keepalives	O
.	O
</s>
<s>
At	O
this	O
point	O
,	O
the	O
client	O
,	O
and	O
server	O
can	O
negotiate	O
a	O
connection	O
by	O
exchanging	O
AMF	B-Protocol
encoded	I-Protocol
messages	O
.	O
</s>
<s>
The	O
Flash	B-Operating_System
Media	O
Server	O
and	O
other	O
implementations	O
uses	O
the	O
concept	O
of	O
an	O
"	O
app	O
"	O
to	O
conceptually	O
define	O
a	O
container	O
for	O
audio/video	O
and	O
other	O
content	O
,	O
implemented	O
as	O
a	O
folder	O
on	O
the	O
server	O
root	O
which	O
contains	O
the	O
media	O
files	O
to	O
be	O
streamed	O
.	O
</s>
<s>
As	O
version	O
3	O
is	O
the	O
current	O
default	O
,	O
the	O
flash	B-Operating_System
client	O
has	O
to	O
be	O
told	O
explicitly	O
in	O
Action-script	O
code	O
to	O
use	O
AMF0	O
if	O
that	O
is	O
requested	O
.	O
</s>
<s>
To	O
start	O
a	O
video	B-Application
stream	I-Application
,	O
the	O
client	O
sends	O
a	O
"	O
createStream	O
"	O
invocation	O
followed	O
by	O
a	O
ping	O
message	O
,	O
followed	O
by	O
a	O
"	O
play	O
"	O
invocation	O
with	O
the	O
file	O
name	O
as	O
argument	O
.	O
</s>
<s>
The	O
server	O
will	O
then	O
reply	O
with	O
a	O
series	O
of	O
"	O
onStatus	O
"	O
commands	O
followed	O
by	O
the	O
video	O
data	O
as	O
encapsulated	B-Protocol
within	O
RTMP	O
messages	O
.	O
</s>
<s>
After	O
a	O
connection	O
is	O
established	O
,	O
media	O
is	O
sent	O
by	O
encapsulating	O
the	O
content	O
of	O
FLV	B-Operating_System
tags	O
into	O
RTMP	O
messages	O
of	O
type	O
8	O
and	O
9	O
for	O
audio	O
and	O
video	O
,	O
respectively	O
.	O
</s>
<s>
This	O
refers	O
to	O
the	O
HTTP	B-Protocol
tunneled	O
version	O
of	O
the	O
protocol	O
.	O
</s>
<s>
It	O
communicates	O
over	O
port	O
80	O
and	O
passes	O
the	O
AMF	B-Protocol
data	O
inside	O
HTTP	B-Protocol
POST	O
request	O
and	O
responses	O
.	O
</s>
<s>
The	O
open-source	O
RTMP	O
client	O
command-line	O
tool	O
rtmpdump	B-Operating_System
is	O
designed	O
to	O
play	O
back	O
or	O
save	O
to	O
disk	O
the	O
full	O
RTMP	O
stream	O
,	O
including	O
the	O
RTMPE	O
protocol	O
Adobe	O
uses	O
for	O
encryption	O
.	O
</s>
<s>
RTMPdump	B-Operating_System
runs	O
on	O
Linux	O
,	O
Android	O
,	O
Solaris	O
,	O
,	O
and	O
most	O
other	O
Unix-derived	O
operating	O
systems	O
,	O
as	O
well	O
as	O
Microsoft	O
Windows	O
.	O
</s>
<s>
Packages	O
of	O
the	O
rtmpdump	B-Operating_System
suite	O
of	O
software	O
are	O
available	O
in	O
the	O
major	O
open-source	O
repositories	O
(	O
Linux	O
distributions	O
)	O
.	O
</s>
<s>
These	O
include	O
the	O
front-end	O
apps	O
"	O
rtmpdump	B-Operating_System
"	O
,	O
"	O
rtmpsrv	O
"	O
and	O
"	O
rtmpsuck.	O
"	O
</s>
<s>
Development	O
of	O
RTMPdump	B-Operating_System
was	O
restarted	O
in	O
October	O
2009	O
,	O
outside	O
the	O
United	O
States	O
,	O
at	O
the	O
MPlayer	B-Application
site	O
.	O
</s>
<s>
The	O
current	O
version	O
features	O
greatly	O
improved	O
functionality	O
,	O
and	O
has	O
been	O
rewritten	O
to	O
take	O
advantage	O
of	O
the	O
benefits	O
of	O
the	O
C	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
The	O
RTMPdump	B-Operating_System
developers	O
have	O
also	O
written	O
support	O
for	O
librtmp	O
for	O
MPlayer	B-Application
,	O
FFmpeg	B-Library
,	O
XBMC	B-Application
,	O
cURL	B-Language
,	O
VLC	B-Application
and	O
a	O
number	O
of	O
other	O
open	O
source	O
software	O
projects	O
.	O
</s>
<s>
FLVstreamer	O
is	O
a	O
fork	O
of	O
RTMPdump	B-Operating_System
,	O
without	O
the	O
code	O
,	O
which	O
Adobe	O
claims	O
violates	O
the	O
DMCA	O
in	O
the	O
USA	O
.	O
</s>
<s>
This	O
was	O
developed	O
as	O
a	O
response	O
to	O
Adobe	O
's	O
attempt	O
in	O
2008	O
to	O
suppress	O
RTMPdump	B-Operating_System
.	O
</s>
