Skip to main content
The Broadcast object is the core data model for streams in Ant Media Server. It contains comprehensive information about the stream’s configuration, status, metadata, and real-time statistics.

Model Structure

streamId
string
The unique identifier of the stream
status
string
The status of the stream. Possible values: finished, broadcasting, created, preparing, error, failed
playListStatus
string
The status of the playlist. Only applicable when type is playlist. Possible values: finished, broadcasting, created, preparing, error, failed
type
string
The type of the stream. Possible values: liveStream, ipCamera, streamSource, VoD, playlist
publishType
string
The publish type of the stream. Read-only field updated on the server side. Possible values: WebRTC, RTMP, Pull, SRT
name
string
The name of the stream
description
string
The description of the stream
publish
boolean
default:"true"
Video filter controlled by the user. Default value is true
date
long
The date when record was created in milliseconds (unix timestamp)
plannedStartDate
long
Planned start date in unix timestamp (seconds). Stream will only accept publishing when current time is greater than this value. Applicable for RTMP and WebRTC streams
plannedEndDate
long
Planned end date in unix timestamp (seconds). Stream will only accept publishing when current time is less than this value. Applicable for RTMP and WebRTC streams
duration
long
The duration of the stream in milliseconds
endPointList
array
The list of endpoints such as Facebook, Twitter or custom RTMP endpoints. See Endpoint model
playListItemList
array
The list of broadcasts in the playlist. This list has values when the broadcast type is playlist
publicStream
boolean
default:"true"
Identifier of whether stream is public or not
is360
boolean
default:"false"
Identifier of whether stream is 360 degree video or not
listenerHookURL
string
The URL that will be notified when stream is published, ended and muxing finished. Receives POST requests with parameters: id, action (liveStreamStarted, liveStreamEnded, vodReady), vodName, streamName, category
category
string
The category of the stream
ipAddr
string
The IP address of the IP camera or publisher
username
string
The username of the IP camera
password
string
The password of the IP camera
quality
string
The quality of the incoming stream during publishing
speed
double
The speed of the incoming stream. For better quality and performance it should be around 1.00
streamUrl
string
The stream URL for fetching stream. Should be defined for IP cameras or cloud streams
originAdress
string
The origin address server broadcasting
mp4Enabled
integer
default:"0"
MP4 muxing enabled status. Values: 1 (enabled), -1 (disabled), 0 (no settings for the stream)
webMEnabled
integer
default:"0"
WebM muxing enabled status. Values: 1 (enabled), -1 (disabled), 0 (no settings for the stream)
seekTimeInMs
long
default:"0"
Initial time to start playing in milliseconds. Can be used in VoD files or stream sources with seek support
subtracksLimit
integer
default:"-1"
Number of subtracks allowed to be created for the broadcast. Useful for limiting conference attendees. Value of -1 means no limit
expireDurationMS
integer
The expire time in milliseconds. If this value is 10000, the broadcast should be started within 10 seconds after creation. Value of 0 means stream will never expire
rtmpURL
string
The RTMP URL where to publish live stream to
zombi
boolean
default:"false"
True when a broadcast is created directly through streaming without being created earlier through REST service. False by default

Viewer Statistics

hlsViewerCount
integer
default:"0"
The number of HLS viewers of the stream
dashViewerCount
integer
default:"0"
The number of DASH viewers of the stream
webRTCViewerCount
integer
default:"0"
The number of WebRTC viewers of the stream
rtmpViewerCount
integer
default:"0"
The number of RTMP viewers of the stream

Viewer Limits

webRTCViewerLimit
integer
default:"-1"
Number of allowed maximum WebRTC viewers for the broadcast. Value of -1 means no limit
hlsViewerLimit
integer
default:"-1"
Number of allowed maximum HLS viewers for the broadcast. Value of -1 means no limit
dashViewerLimit
integer
default:"-1"
Number of allowed maximum DASH viewers for the broadcast. Value of -1 means no limit

Stream Quality Metrics

startTime
long
default:"0"
Publishing start time of the stream in unix timestamp milliseconds
receivedBytes
long
default:"0"
The total bytes received until now
bitrate
long
default:"0"
The received bitrate per second
width
integer
default:"0"
Width of the incoming stream in pixels
height
integer
default:"0"
Height of the incoming stream in pixels
pendingPacketSize
integer
default:"0"
Number of packets ingested and waiting for processing. Generally applies to RTMP, SRT ingest and Stream Source pull. This number should be low (less than 10)
encoderQueueSize
integer
default:"0"
Number of frames ingested and waiting for encoding. This number should be low (less than 10)
dropPacketCountInIngestion
integer
Number of dropped packets in total while ingesting. Packets can be dropped if server is loaded or WebRTC connectivity is not healthy. Should be zero in perfect scenario
dropFrameCountInEncoding
integer
Number of dropped frames in total while transcoding. If there is adaptive bitrate and server is loaded, encoder may not transcode in real-time and frames can be dropped to prevent memory crash

WebRTC Quality Metrics

packetLostRatio
double
Lost packets’ ratio in WebRTC ingest. This value should be around 0.01 (1%)
packetsLost
integer
Number of packets lost in WebRTC ingest
jitterMs
integer
Jitter in milliseconds for WebRTC ingest. This value should be less than 50ms. Lower is better
rttMs
integer
Round Trip Time in milliseconds for WebRTC ingest. This value should be less than 50ms. Lower is better

Additional Metadata

userAgent
string
default:"N/A"
User-Agent of the publisher
remoteIp
string
Remote IP address of the stream publisher
latitude
string
Latitude of the broadcasting location
longitude
string
Longitude of the broadcasting location
altitude
string
Altitude of the broadcasting location

Multi-track Support

mainTrackStreamId
string
If this broadcast is a track of a WebRTC stream, this variable holds the ID of that main stream
absoluteStartTimeMs
long
Absolute start time in milliseconds (unix timestamp). Used for measuring absolute latency

Playlist Configuration

currentPlayIndex
integer
default:"0"
Current playing index for playlist types
playlistLoopEnabled
boolean
default:"true"
Identifier of playlist loop status. If true, playlist loops infinitely. If false, playlist plays once and finishes

Advanced Configuration

subFolder
string
Name of the subfolder that will contain stream files
metaData
string
Metadata field for custom usage
role
string
Broadcast role for selective playback
hlsParameters
object
The HLS parameters of the broadcast
autoStartStopEnabled
boolean
default:"false"
Identifier of whether stream should start/stop automatically. Effective for Stream Sources/IP Cameras. If there is no viewer after certain amount of seconds, it will stop. If a user wants to watch, it will start automatically
encoderSettingsList
array
The list of encoder settings for adaptive bitrate streaming
maxIdleTime
integer
default:"0"
Maximum idle time in seconds without updating the broadcast. If broadcast is not updated for this duration, webhook is fired

Example JSON

{
  "streamId": "test-stream-123",
  "status": "broadcasting",
  "type": "liveStream",
  "publishType": "WebRTC",
  "name": "My Live Stream",
  "description": "Example broadcast stream",
  "publish": true,
  "date": 1709539200000,
  "duration": 0,
  "publicStream": true,
  "is360": false,
  "listenerHookURL": "https://example.com/webhook",
  "category": "Entertainment",
  "mp4Enabled": 1,
  "webMEnabled": 0,
  "hlsViewerCount": 45,
  "dashViewerCount": 12,
  "webRTCViewerCount": 8,
  "rtmpViewerCount": 3,
  "webRTCViewerLimit": -1,
  "hlsViewerLimit": -1,
  "dashViewerLimit": -1,
  "startTime": 1709539200000,
  "receivedBytes": 15728640,
  "bitrate": 2500000,
  "width": 1920,
  "height": 1080,
  "pendingPacketSize": 3,
  "encoderQueueSize": 2,
  "userAgent": "Mozilla/5.0",
  "remoteIp": "192.168.1.100",
  "absoluteStartTimeMs": 1709539200000,
  "metaData": "{\"custom\":\"data\"}",
  "zombi": false,
  "playlistLoopEnabled": true,
  "autoStartStopEnabled": false,
  "endPointList": [],
  "playListItemList": []
}

Build docs developers (and LLMs) love