mast_rawcast [options] <address>[/<port>] <filename>


mast_rawcast(1) reads previously encoded audio from a file and then sends it out encapsulated in an RTP packet. The format of the data must be specified using the payload type option.

This tool only really makes sense for frame based encoded formats, and as such only MPEG Audio and GSM are currently supported.

The address can either be a unicast, multicast, IPv4 or IPv6 address.

The port number should be an even number (RTCP reports are sent one port higher). If no port number is specified, then the default RTP port number (5004) is used.



Return usage and version information.


Sets TTL (Time To Live) for packets sent. Packets will ignored after they have passed this number of routers. Default is 5, maximum is 127.

-p <payload>

Payload type of the packets. mast_rawcast currently only supports the following four static payload types:

  • MPA

  • GSM

-z <size>

Maximum Payload size of the packets. Allows you to choose the length of the payload data (in bytes) for each packet transmitted. This is usually a number between 300 bytes and 1450 bytes. The actual packet size will be determined by the number of blocks of 160 samples of audio that can be stored in the packet's payload. The maximum transmission unit (MTU) is determined by your networking equipment. Also be careful of IP-in-IP tunnelling as packets will have two IP headers which makes it more likely that the packet will be too big and get fragmented.

-s <ssrc>

By default a random SSRC is generated, however if you want to ensure that an SSRC remain constant between invocations of the program, then you may specify it here as a hexadecimal number.

-d <dscp>

The Differentiated Services Code Point (DSCP) value specifies a packet's Per-Hop-Behavior (PHB) along its path to its destination. It is a Quality of Service (QoS) technique that can be used to provide better than best effort packet delivery. The default PHB is Best Effort. Valid arguments are:

  • BE Best Effort

  • EF Expedited Forarding

  • AF11 to AF43 Assured Forwarding

  • CS0 to CS7 Classes 0 to 7


Loop the audio file. Repeat playing the audio file when the end is reached.


mast_rawcast -p MPA -l mpegaudio.mp2

Repeatedly send an MPEG Audio file to the multicast group, port 5004. The pre-compressed MPEG Audio data will be sent out using payload type 14.

mast_rawcast -p GSM gsmaudio.gsm

Read in an GSM audio file, and sent it to the unicast address, port 4000.


Written by Nicholas J. Humfrey, <>


Main web site:

RTP Payload types:


mast_cast(1), mast_filecast(1)


Copyright © 2003-2007 Nicholas J Humfrey. Free use of this software is granted under the terms of the GNU General Public License (GPL)