Skip to content


UDP/TCP input

Register name used to load filter: sockin
This filter may be automatically loaded during graph resolution.

This filter handles generic TCP and UDP input sockets. It can also probe for MPEG-2 TS over RTP input. Probing of MPEG-2 TS over UDP/RTP is enabled by default but can be turned off.

Data format can be specified by setting either ext or mime options. If not set, the format will be guessed by probing the first data packet

  • UDP sockets are used for source URLs formatted as udp://NAME
  • TCP sockets are used for source URLs formatted as tcp://NAME
  • UDP unix domain sockets are used for source URLs formatted as udpu://NAME
  • TCP unix domain sockets are used for source URLs formatted as tcpu://NAME

When ports are specified in the URL and the default option separators are used (see gpac -h doc), the URL must either:
- have a trailing '/', e.g. udp://localhost:1234/[:opts]
- use gpac separator, e.g. udp://localhost:1234[:gpac:opts]

On OSX with VM packet replay you will need to force multicast routing, e.g. route add -net -interface vboxnet0


src (cstr): address of source content
block_size (uint, default: 0x60000): block size used to read socket
port (uint, default: 1234): default port if not specified
ifce (cstr): default multicast interface
listen (bool, default: false): indicate the input socket works in server mode
ka (bool, default: false): keep socket alive if no more connections
maxc (uint, default: +I): max number of concurrent connections
tsprobe (bool, default: true): probe for MPEG-2 TS data, either RTP or raw UDP. Disabled if mime or ext are given and do not match MPEG-2 TS mimes/extensions
ext (str): indicate file extension of udp data
mime (str): indicate mime type of udp data
block (bool, default: false): set blocking mode for socket(s)
timeout (uint, default: 10000): set timeout in ms for UDP socket(s), 0 to disable timeout
reorder_pck (uint, default: 100): number of packets delay for RTP reordering (M2TS over RTP)
reorder_delay (uint, default: 10): number of ms delay for RTP reordering (M2TS over RTP)
ssm (strl): list of IP to include for source-specific multicast
ssmx (strl): list of IP to exclude for source-specific multicast