Skip to main content

stream

The stream command is used to manage audio/video streams. The type parameter only needs to be specified when creating a stream that will be used solely for recording and not sent on any network. For that specific use, use type=recorder and simply specify the content sources.

When creating a stream you can specify a unique id to assign to it or let the system assign one for you. You can also specify a name for the stream if needed. Most commands will accept the stream id or name in order select the proper stream to manage.

On Makito X HEVC units, to create an HEVC stream, specify 4 or 5 instead of 0 to 3 for the videosrc id.

When a stream has started, you may either pause or stop it. The main difference between pausing and stopping a stream is that when a stream is paused, the configured still image will be streamed instead of the configured video source. For more information, see Configuring Still Image Streaming.

Synopsis

stream create [type=tx] [name=text] [id=number] 
[addr=ipaddr] [port=udpport]
[encapsulation=ts-rtp | ts-udp | direct-rtp | rtmp | ts-srt]
[start=yes,no] [ttl=64] [tos=0xB8] [mtu=1496] [videosrc=id/name]
[audiosrc=id/name[,id/name,id/name]][datasrc=id/name[,id/name,id/name]]
[stillimage=fname] [shaping=yes,no [ceiling=percentage] [idlecells=yes,no]
[delayaudio=yes,no]][datacarriage=sync | async | async-syncau]

Possible encapsulation formats and their specific options:

 ts-rtp: MPEG2 transport stream over RTP 
[rtcp=on [rtcpport=udpport]][fec=yes,no] [rows=10] [columns=10]
[level=A, B] [alignment =yes, no]
ts-udp: MPEG2 transport stream over UDP (no RTP header)
[fec=yes,no]
direct-rtp: RFC3984
[rtcp=on [rtcpport=udpport]]
rtmp: Real-time messaging protocol
[publish=streampubname] [username=uname] [password=pwd]
ts-srt: MPEG2 transport stream over SRT
[mode=caller, listener, rendezvous] [sourceport=udpport]
[encryption=none, AES128, AES256] [passphrase="My PassPhrase"]
[latency=250] [overhead=percentage] [adaptive=yes,no]

Parameters available for all ts-based streams:

 [videopid=pid] [audiopid=pid[,pid,pid]][datapid=pid]
[pcrpid=pid] [pmtpid=pid]
[program=num] [tsid=id]
stream id/name stop
stream id/name pause
stream id/name resume
stream id/name delete
stream id/name/all get
stream id/name clear

Actions

ActionDescription

create

Creates a streaming session from the encoder. A series of one or more parameter=value pairs can be specified at once.

start

Starts the specified stream ID or name.

Note

By default, a stream will start immediately since start=yes by default. To delay the start of a stream, include the parameter start=no.

stop

Stops the specified stream ID or name.

pause

Pauses the specified stream ID or name.

Note

If configured, a still image will be streamed instead of the configured video source. See “stillimage” in Parameters below.

resume

Resumes the specified stream ID or name.

delete

Deletes the specified stream ID or name.

get

Gets stream status information. See Parameters below. You can specify a stream or all streams.

Tip

To display a summary of all the streams in a table format, you can use stream all get table.

clear

Clears all active sessions on the encoder.

help

Displays usage information for the stream command.

Parameters

ParameterDefaultDescription/Values

type

tx

The stream type, either transport stream or recorder.

Note

type only needs to be specified when creating a stream that is used solely for recording and not sent on any network. For that specific use, use type=recorder and simply specify the content sources.

addr

n/a 

The destination IP address. Enter an IP address in dotted-decimal format.

Note

The Multicast address range is from 224.0.0.0 to 239.255.255.255. Multicast addresses from 224.0.0.0 to 224.0.0.255 are reserved for multicast maintenance protocols and should not be used by streaming sessions. We recommend that you use a multicast address from the Organization-Local scope (239.192.0.0/14).

port

n/a

The destination UDP port. Enter a number in the range 1025..65,535. Note that RTP streams use even numbers only within this range.
Optional

id

n/a

A unique number assigned to the stream.

Note

When creating a stream, you can specify a unique id to assign to it or let the system assign one (a sequential number) for you.


Most commands will accept the stream id or name (see below) in order select the proper stream to manage.

name

n/a

(Optional) When creating a stream, you can also specify a name for the stream. 1 to 32 characters

rtcp

on

(Optional) When rtcp is On, the stream is activated in RTCP mode. This causes the system to establish one RTP stream and one RTCP session for monitoring purposes.

RTP/RTCP is useful to collect network metrics such as network jitter, packet loss, etc. Note that this requires a remote decoder capable of supporting this feature as well.

rtcpport

n/a

(Optional, rtcp must be On) The destination UDP port for the RTCP session.

ttl

64

(Time-to Live for stream packets) Specifies the number of router hops that IP packets from this stream are allowed to traverse before being discarded.
Range = 1..255

tos

0xB8

(Type of Service) Specifies the desired quality of service (QoS). This value will be assigned to the Type of Service field of the IP Header for the outgoing streams.
Range = 0..255 (decimal) or 0x00..0xFF (hex)

Important

A DiffServ or DSCP (Differentiated Services Code Point) value must be converted to a ToS precedence value. For example, AF41 or DSCP 34 becomes ToS 136. For more information, see RFC2474.

Note

The ToS setting must be chosen so as to not interfere with Voice over IP systems and other equipment that may reside on your network. For example, when the ToS value for a stream is set to 0xB8, it can interfere with some third party Voice / IP Telephony systems.

mtu

1496

(Maximum Transmission Unit) Specifies the maximum allowed size of IP packets for the outgoing RTP data stream. 228..1500
encapsulationts-udp

(Optional) The Encapsulation Type for the encoded stream.

start

yes

(Optional) By default, the stream will start immediately. To delay the start of a stream, specify start=no. You can enter a stream start command later.

videosrc

0

(Optional) The video source (ID/Name). For H.264, the id is either 0, 1, 2, or 3 (corresponding to the encoder instance number in the Web interface). For HEVC encoders, two additional ids of 4 and 5 are available and should be used to stream HEVC-encoded video.

Note

By default, if you don't specify the source, the stream uses video encoder 0 and audio encoder 0 for a TS stream (UDP or RTP), and video encoder 0 for DirectRTP and other encapsulations.

Once you specify an audio or video source, you have to enter all of them explicitly. For example, even though a TS stream with no sources specified automatically uses video 0 and audio 0, if you specify that video 0 is your source, then you must enter the audio source or else the stream will not have any audio in it.

Tip

Combined videosrc/audiosrc/datasrc status shown under Contents in return output.

audiosrc

0

(Optional) The audio source (ID/Name). The id is either 0, 1, 2, 3, 4, 5, 6, or 7. See Note and Tip above in the videosrc description.

Note

To configure multi-track audio TS streams (TS over UDP or RTP), you can put more than one audiosrc (audio encoder) in the stream. See “Examples” below.

Important

Audio sources should always be associated with the same video interface for the dual channel SDI encoder. (See Setting Up Streaming.)

datasrc

n/a

(Optional) The metadata source. id/name (0=serial, 1 or 2=SDI; all others are UDP)

See metadata to determine the ID mappings.

Note

To stream metadata from multiple sources into the same KLV Elementary Stream, use multiple comma separated metadata source id/names to indicate the metadata source ES IDs to be multiplexed in the stream. e.g.: stream create ….. data=1,2

videopid

33

(Optional) Video Packet Identifier. 16-8190

audiopid

36

(Optional) Audio Packet Identifier. 16-8190. For MPEG-2 TS streams, the audio PIDs for each audio source can be assigned explicitly. The order of PID assignment is the same as the audiosrc parameters. e.g.:

audiosrc=0,1,3 audiopid=64,65,66 will result in the audio elementary stream from audio source 0 being assigned an elementary PID of 64, etc.

datapid

40

(Optional) Data (metadata) Packet Identifier. 16-8190

prcpid

34

(Optional) (Program Clock Reference) Packet Identifier. Timestamp in the TS from which the decoder timing is derived. 16..8190

pmtpid

32

(Optional) (Program Map Table) Packet Identifier. 16-8190

program

1

(Optional) Program Identifier used in the Program Map Table (PMT) of the TS stream. 0-65535

tsid

0

(Optional) Transport Stream ID. Identifies the transport stream in the Program Association table (PAT) of the TS stream. 0-65535

stillimage

n/a

(Optional) Specifies the filename of a static image that will replace the “real” video stream when streaming is paused.

Note

The static image file must already have been converted into a file containing an encoded single H.264 GOP sequence. You can either use the mkstill command, or the Web interface's Still Imagespage (see Configuring Still Image Streaming).

Still Image insertion when pausing a stream is not supported when a HEVC/H.265 video encoder is selected as a content source.

shaping

no

(Optional) To enable Traffic Shaping for the stream, specify shaping=yes.

For some limited networks such as satellites or some dedicated network pipes, it may be necessary to enable Traffic Shaping to smooth the traffic and respect the absolute upper limit configured.

ceiling

n/a

(Optional, shaping must be yes) The percentage of network bandwidth beyond the average rate that the encoder is allowed to use if needed. This is used to set the ceiling bandwidth range. 5..100%, default = 15

Note

To configure the ceiling percentage for CBR streams with metadata, see Bandwidth Overhead for CBR Streams with Metadata.

idlecells

no

(Optional, shaping must be yes) When enabled, Idle TS cells will be inserted into a TS stream when necessary. yes,no

delayaudio

no

(shaping and idlecells must be yes) When enabled, delays the transmission of audio information to prevent MPEG-2 TS HRD main buffer overflows. Per reference decoder main audio buffer defined in IEC/ISO 13818- 1/H.222.0. yes,no

datacarriage

sync

Specifies the method of KLV data carriage:

  • sync: synchronous metadata AU (ISO/IEC 13818-1)
  • async: asynchronous private data (SMPTE RP 217)
  • async-syncau: asynchronous private data carrying sync metadata AU

publish

n/a

(Optional when streaming to a Flash-based Content Delivery Network (CDN) using RTMP encapsulation) Enter a Publish Name (511 characters maximum).

Note

A single Publish Name may be assigned to multiple streams, configured on separate servers or content distribution services, to provide redundancy and fail-over capability. The encoder will send multiple RTMP streams to different FMS servers using the same published name. If an FMS fails, the players will have the option of fail-over to the redundant FMS server.

Important

When interoperating with Kaltura using RTMP, add a slash “/” at the end of the URL provided by Kaltura. See CDN Interoperability (RTMP).

username

n/a

(Required when streaming to a CDN using RTMP) Enter the CDN login username.

password

n/a

(Required when streaming to a CDN using RTMP) Enter the CDN login password.

fec

no

Enables Forward Error Correction (FEC). yes,no

  • Pro-MPEG FEC if encapsulation is ts-rtp
  • VF FEC if encapsulation is ts-udp

Note

VF FEC is a proprietary FEC and is not interoperable with devices outside of the Haivision family.

SRT (see Configuring Secure Reliable Transport (SRT))

mode

caller

Specifies the SRT Connection Mode:

  • caller
  • listener
  • rendezvous

sourceport

auto

(SRT connection mode must be caller) Specifies the UDP source port for the SRT stream.

encryption

none

(encapsulation must be ts-srt) Enables AES encryption and specifies the key length, either: none, AES-128, or AES-256

passphrase

n/a

(Only required and accepted if encryption is enabled, encapsulation must be ts-srt) Specifies a string used to generate the encryption keys to protect the stream.

Range = 10-79 UTF8 characters

latency

250

(encapsulation must be ts-srt) Specifies the SRT receiver buffer that permits lost packet recovery. The size of this buffer adds up to the total latency. A minimum value must be 3 times the round-trip-time (RTT).

Range = 20 - 8000 ms

Note

Latency is for the SRT protocol only and does not include the capture, encoding, decoding and display processes of the endpoint devices.

overhead

25%

(encapsulation must be ts-srt) Specifies the maximum stream bandwidth overhead that can be used for lost packets recovery.

Range = 5-50%

adaptive

no

(encapsulation must be ts-srt) When set to yes enables Network Adaptive Encoding. NAE directs the video encoder to adapt to changing network throughput used by the SRT stream during operational use with the goal of maximizing video quality for a given network. NAE may adjust video bitrate depending on measured link throughput without stream tear-down and re-build.

Examples

# stream create addr=192.0.2.106 port=2000 start=yes

Creates a streaming session to IP Address 192.0.2.106 at port 2000; starts streaming immediately.

Returns the following confirmation and stream ID:

Stream created successfully - ID : 3
# stream create addr=192.0.2.235 port=1234 stillimage=haivision.mp4

Creates and starts a streaming session. Specifies a static image to replace the "real" video stream
when streaming is paused.

# stream create addr=10.64.1.124 port=1234 encap=ts-udp videosrc=1 audiosrc=1 
datasrc=1,3

Creates and starts a multiple metadata streaming session.

# stream create addr=10.64.1.124 port=1234 encap=ts-udp videosrc=1 
audiosrc=0,2,4 audiopid=36,37,38

Creates a TS stream with multi-track audio using audio encoders 0, 2 and 4. The corresponding
audio PIDs are 36, 37 and 38.

# stream 3 pause

Pauses the stream created above (stream ID 3), which activates the still image.

# stream 3 resume

Resumes the stream created above.

# stream create addr=192.0.2.235 port=1234 vid=0 aud=0
# videnc 1 start
# audenc 1 start
# stream create addr=198.51.100.106 port=1234 vid=1 aud=1

Creates two streams, the first using Video and Audio encoder 0, and the 2nd using Video and
Audio encoder 1.

# stream create addr=192.0.2.235 port=1234 videosrc=4 audiosrc=0

Creates an HEVC stream using video encoder 4.

# stream 1 get all

Returns configuration information and statistics for all encoder streams, for example:

Stream        : 1
Name : "web1"
Configuration :
Address : 192.0.2.235
UDP Port : 1234
Encapsulation : TS-RTP
Contents : Video ("HD Video Encoder 0":0),
Audio ("Audio Encoder 0":0)
Still Image File : (None)
Video PID : 33
Audio PID : 36
PCR PID : 34
PMT PID : 32
Transport Stream ID : 0
Program Number : 1
MTU : 1500
TOS : 0xB8
TTL : 18
Bandwidth : 6,510 kbps
Traffic Shaping : Off
AES Encryption : On
FEC : On
Persistent : No
Statistics :
State : STREAMING
Up Time : 1h16m8s
Sent Packets : 1,040,512
Sent Bytes : 1,252,450,560
Bitrate : 198 kbps
# stream 2 show stats

Returns status information for Stream #2, such as:

Session ID : 2
Name : "web1"
Statistics :
State : STREAMING
Up Time : 10m50s
SSRC : 0x94328a6a (2486340202)
Sent Packets : 413,274
Sent Bytes : 417,249,304
Unsent Packets : 1,214
Unsent Bytes : 1,272,100
Last Error : 11, Resource temporarily unavailable
Ocurred : 6hr44m4s ago
RTCP : Off
# stream 1 del

Deletes Stream #1.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.