rtpdump
— parse
and print RTP packets
rtpdump |
[-h ] [-F
format] [-f
infile] [-o
outfile] [-t
minutes] [-x
bytes]
[address]/port |
rtpdump
reads RTP and RTCP packets on the
given address/port, or from
standard input by default, and dumps a processed version to standard output.
The output is suitable as input for
rtpplay(1)
and
rtpsend(1).
The IPv4 address can be specified in dotted decimal
notation or as a hostname and defaults to 127.0.0.1. The
port number must be given as a decimal numbers between
1 and 65535.
The options are as follows:
-F
format
- Write the output in the given format, which is one
of the following:
dump
,
header
, payload
,
ascii
, hex
,
rtcp
, short
.
The dump
format is a binary format
suitable as input for
rtpplay(1).
The generated output file should have a .rtp
filename extension. The file starts with
#!rtpplay1.0
address/port\n
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 RD_hdr_t
header and one RD_packet_t structure for each
received packet. All fields are in network byte order. The RTP and RTCP
packets are recorded as-is. The structures are as follows:
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;
The header
format is like
dump
, but does not save the audio/video payload.
The payload
format only saves the audio/video
payload.
The ascii
format, which is the
default, saves text parsed packets, suitable for
rtpsend(1).
See below for an example. The hex
format is like
ascii
, but with a hex dump of the payload. The
rtcp
format is like
ascii
, but only saves RTCP packets.
The short
format dumps RTP or VAT data
in lines such as
[-
]time
timestamp [seq]
where ‘-
’ indicates a
set marker bit, time is the arrival time,
timestamp is the RTP timestamp, and
seq is the RTP sequence number (only used for RTP
packets).
-f
infile
- Read packets from infile instead of from the network
or from standard input. The file must have been recorded using the
dump
format.
-h
- Print a short usage summary and exit.
-o
outfile
- Dump to outfile instead of to standard output.
-t
minutes
- Only listen for the first minutes.
-x
bytes
- Process only the first number of bytes of the
payload. This is only applicable for the
dump
and
hex
formats.
$ rtpdump -F ascii /1234
844525628.240592 RTP len=176 from=131.136.234.103:46196 v=2 p=0 x=0 cc=0 m=0 pt=5 (IDVI,1,8000) seq=28178 ts=954052737 ssrc=0x124e2b58
$ rtpdump -F rtcp /1234
844525628.243123 RTCP len=128 from=139.88.27.43:53154
(RR ssrc=0x125bd36f p=0 count=1 len=7
(ssrc=bc64b658 fraction=0.503906 lost=4291428375 last_seq=308007791
jit=17987961 lsr=2003335488 dlsr=825440558)
)
(SDES p=0 count=1 len=23
(src=0x125bd36f CNAME="yywhy@139.88.27.43" NAME="Michael Baldizzi
(NASA LeRC)" TOOL="vat-4.0a8" EMAIL="mbaldizzi@lerc.nasa.gov" )
)
$ rtpdump -F short /1234
-1511433758.442892 3988999488 54553
1511433758.480881 3988999648 54554
1511433758.500863 3988999808 54555
1511433758.520860 3988999968 54556
1511433758.540872 3989000128 54557