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]

When the socket is listening in keep-alive ka mode:

  • a single connection is allowed and a single output PID will be produced
  • each connection close event will triger a pipeline flush

Time Regulation

The filter uses the time between the last two received packets to estimates how often it should check for inputs. The maximum and minimum times to wait between two calls is given by the mwait option. The maximum time may need to be reduced for very high bitrates sources.

Options

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

mwait (v2di, default: 1x30): set min and max wait times in ms to avoid too frequent polling

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

Was this page helpful?