-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathrtpdump.1
276 lines (275 loc) · 7.46 KB
/
rtpdump.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
.\" (c) 1998-2018 by Columbia University; all rights reserved
.\" (c) 2017-2018 by Jan Stary <[email protected]>
.\"
.\" SPDX-License-Identifier: BSD-3-Clause
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.Dd June 25, 2018
.Dt RTPDUMP 1
.Os
.Sh NAME
.Nm rtpdump
.Nd parse and print RTP packets
.Sh SYNOPSIS
.Nm
.Op Fl h
.Op Fl F Ar format
.Op Fl f Ar infile
.Op Fl o Ar outfile
.Op Fl t Ar minutes
.Op Fl x Ar bytes
.Oo Ar address Oc Ns / Ns Ar port
.Sh DESCRIPTION
.Nm
reads RTP and RTCP packets on the given
.Ar address Ns / Ns Ar port ,
or from standard input by default,
and dumps a processed version to standard output.
The output is suitable as input for
.Xr rtpplay 1
and
.Xr rtpsend 1 .
The IPv4
.Ar address
can be specified in dotted decimal notation or as a hostname
and defaults to
.Dq localhost .
The
.Ar port
number must be an even number.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl F Ar format
Write the output in the given
.Ar format ,
which is one of the following:
.Cm dump ,
.Cm header ,
.Cm payload ,
.Cm ascii ,
.Cm hex ,
.Cm rtcp ,
.Cm short .
.Pp
The
.Cm dump
format is a binary format suitable as input for
.Xr rtpplay 1 .
The generated output file should have a
.Pa .rtp
filename extension.
The file starts with
.Pp
.Dl #!rtpplay1.0 address/port\en
.Pp
The version number indicates the file format version,
not the version of RTP tools used to generate the file.
The current file format version is 1.0.
This is followed by one
.Vt RD_hdr_t
header and one
.Vt RD_packet_t
structure for each received packet.
All fields are stored in the network byte order.
This metadata is followed by the actual RTP or RTCP packet, recorded as-is.
The structures are as follows:
.Bd -literal
typedef struct {
struct timeval start; /* start of recording (GMT) */
uint32_t source; /* network source (multicast) */
uint16_t port; /* UDP port */
} RD_hdr_t;
typedef struct {
uint16_t length; /* length of original packet, including header */
uint16_t plen; /* actual header+payload length for RTP, 0 for RTCP */
uint32_t offset; /* ms since the start of recording */
} RD_packet_t;
.Ed
.Pp
The
.Cm header
format is like
.Cm dump ,
but does not save the audio/video payload.
The
.Cm payload
format only saves the audio/video payload.
.Pp
The
.Cm ascii
format, which is the default, saves text parsed packets,
suitable for
.Xr rtpsend 1 .
Each entry starts with a time value, in seconds, relative to the beginning.
The time value appears at the beginning of a line, without white space.
Within an RTP or RTCP packet description, parameters may appear in any order,
without white space around the equal sign.
Lines are continued with initial white space on the next line.
Comment lines start with
.Sq # .
Strings are enclosed in quotation marks.
The actual RTP and RTCP entries look like this:
.Bd -literal
<time> RTP
v=<version>
p=<padding>
x=<extension>
m=<marker>
pt=<payload type>
ts=<time stamp>
seq=<sequence number>
ssrc=<SSRC>
cc=<CSRC count>
csrc=<CSRC>
data=<hex payload>
ext_type=<type of extension>
ext_len=<length of extension header>
ext_data=<hex extension data>
len=<packet size in bytes (including header)>
.Ed
.Bd -literal
<time> RTCP
(SDES v=<version> (src=<source> cname="..." name="...") (...))
(SR v=<version>
ssrc=<SSRC of data source>
p=<padding>
count=<number of sources>
len=<length>
ntp=<NTP timestamp>
psent=<packet sent>
osent=<octets sent>
(ssrc=<SSRC of source>
fraction=<loss fraction>
lost=<number lost>
last_seq=<last sequence number>
jit=<jitter>
lsr=<last SR received>
dlsr=<delay since last SR>
)
)
.Ed
.\" FIXME: describe the individual fields
.Pp
The
.Cm hex
format is like
.Cm ascii ,
but with a hex dump of the payload.
The
.Cm rtcp
format is like
.Cm ascii ,
but only saves RTCP packets.
.Pp
The
.Cm short
format dumps RTP or VAT data in lines such as
.Pp
.D1 Oo Cm - Oc Ns Ar time timestamp Op Ar seq
.Pp
where
.Sq Cm -
indicates a set marker bit,
.Ar time
is the arrival time,
.Ar timestamp
is the RTP timestamp, and
.Ar seq
is the RTP sequence number (only used for RTP packets).
.It Fl f Ar infile
Read packets from
.Ar infile
instead of the network or standard input.
The file must have been recorded using the
.Cm dump
format.
.It Fl h
Print a short usage summary and exit.
.It Fl o Ar outfile
Dump to
.Ar outfile
instead of to standard output.
.It Fl t Ar minutes
Only listen for the first
.Ar minutes .
.It Fl x Ar bytes
Process only the first number of
.Ar bytes
of each packet's payload.
This is only applicable for the
.Cm dump
and
.Cm hex
formats.
.El
.Sh EXAMPLES
.Bd -literal
$ rtpdump -F ascii < bark.rtp
44.020000 RTP len=172 from=0.0.0.0:0 v=2 p=0 x=0 cc=0 m=1 pt=0 (PCMU,1,8000) seq=54553 ts=3988999488 ssrc=0x59c72
44.030000 RTCP len=72 from=0.0.0.0:0
(SR ssrc=0x59c72 p=0 count=0 len=6
ntp=3167928311.3622222025 ts=3988999508 psent=1 osent=160
)
(SDES p=0 count=1 len=10
(src=0x59c72 CNAME="[email protected]" NAME="nice_dog" )
)
44.050000 RTP len=172 from=0.0.0.0:0 v=2 p=0 x=0 cc=0 m=0 pt=0 (PCMU,1,8000) seq=54554 ts=3988999648 ssrc=0x59c72
44.070000 RTP len=172 from=0.0.0.0:0 v=2 p=0 x=0 cc=0 m=0 pt=0 (PCMU,1,8000) seq=54555 ts=3988999808 ssrc=0x59c72
[...]
44.380000 RTP len=173 from=0.0.0.0:0 v=2 p=0 x=0 cc=0 m=0 pt=0 (PCMU,1,8000) seq=54567 ts=3989001728 ssrc=0x59c72
.Ed
.Bd -literal
$ rtpdump -F rtcp /1234
1529922419.410173 RTCP len=72 from=127.0.0.1:38874
(SR ssrc=0x59c72 p=0 count=0 len=6
ntp=3167928311.3622222025 ts=3988999508 psent=1 osent=160
)
(SDES p=0 count=1 len=10
(src=0x59c72 CNAME="[email protected]" NAME="nice_dog" )
)
.Ed
.Bd -literal
$ rtpdump -F short /1234
-1511433758.442892 3988999488 54553
1511433758.480881 3988999648 54554
1511433758.500863 3988999808 54555
1511433758.520860 3988999968 54556
1511433758.540872 3989000128 54557
.Ed
.Sh SEE ALSO
.Xr rtpplay 1 ,
.Xr rtpsend 1
.Sh AUTHORS
.An -nosplit
.Nm
was written by
.An Henning Schulzrinne Aq Mt [email protected] ,
with enhancements by
.An Ping Pan ,
.An Akira Tsukamoto Aq Mt [email protected] ,
.An Jan Stary Aq Mt [email protected] ,
and
.An Jan Janak Aq Mt [email protected] .