Set new DTLS certificates. Should be called before any Endpoint is established.
Get local DTLS fingerprint for this Media Server.
Returns String
Close async handlers so nodejs can exit nicely Only call it once!
Enable or disable log level traces
flag
Boolean
Enable or disable debug level traces
flag
Boolean
Set UDP port range for encpoints
minPort
Integer Min UDP portmaxPort
Integer Max UDP port [Optional]
Set node uv loop cpu affinity
cpu
Integer CPU core number
Returns boolean true if operation was successful
Set node uv loop thread name.
Useful for debugging or tracing. Currently only supported on Linux, fails on other platforms. Length is limited to 16 bytes.
name
String thread name to set
Returns boolean true if operation was successful
Enable or disable ultra debug level traces
flag
Boolean
Create a new endpoint object
-
ip
String External IP address of server, to be used when announcing the local ICE candidate -
params
Object Creation parametersparams.packetPoolSize
Number Packet pool size
Returns Endpoint The new created endpoing
Helper that creates an offer from capabilities It generates a random ICE username and password and gets media server dtls fingerprint
capabilities
Object Media capabilities as required by SDPInfo.create
Returns SDPInfo SDP offer
Create a new MP4 recorder
-
filename
String Path and filename of the recorded mp4 file -
params
Object Recording parameters (Optional)params.refresh
Number Periodically refresh an intra on all video tracks (in ms)params.waitForIntra
Boolean Wait until first video iframe is received to start recording mediaparams.timeShift
Number Buffer time in ms. Recording must be splicity started with flush() callparams.disableHints
Boolean Disable recording hint tracks. Note that this file won't be playable with the Player object;
Returns Recorder
Create a new MP4 player
filename
String Path and filename of the mp4 file
Returns Player
Create a new RTP streamer
Returns Streamer
Create a new Active Speaker Detecrtor
Create a new stream refresher
period
type Intra refresh period
Create a new incoming track reader
intraOnly
type Intra frames onlyminPeriod
type Minimum period between frames
Create a new emulated transport from pcap file
pcap
filename
String PCAP filename and path
Get the default media server capabilities for each supported media type
Returns Object Object containing the capabilities by media ("audio","video")
Extends Emitter
SDPManager
Get current SDP offer/answer state
Returns String one of "initial","local-offer","remote-offer","stabable".
Returns the Transport object created by the SDP O/A
Returns Transport
Stop manager and associated tranports
SDPManager stopped event
transport
SDPManager
Extends Emitter
ActiveSpeakerMultiplexer multiplex multiple incoming audio tracks into fewer outgoing tracks based on voice activity.
Set minimum period between active speaker changes
minChangePeriod
Number
Maximux activity score accumulated by an speaker
maxAcummulatedScore
Number
Minimum db level to not be considered as muted
noiseGatingThreshold
Number
Set minimum activation score to be electible as active speaker
minActivationScore
Number
Add incoming track for speaker detection
track
IncomingStreamTrack
Remove track from speaker detection
track
IncomingStreamTrack
Stop this transponder, will dettach the OutgoingStreamTrack
ActiveSpeakerMultiplexer new active speaker detected event
incomingStreamTrack
IncomingStreamTrack Track that has been voice activatedoutgoingStreamTrack
IncomingStreamTrack Track that has been multiplexed into
ActiveSpeakerMultiplexer active speaker removed event
outgoingStreamTrack
IncomingStreamTrack Track with no active speaker
ActiveSpeakerMultiplexer stopped event
ActiveSpeakerMultiplexer
ActiveSpeakerMultiplexer
Extends Emitter
Track of the recorder associated to an incoming strem track
Get recorder track id
Get incoming stream track
Returns IncomingStreamTrack
Check if the track is muted or not
Returns boolean muted
Mute/Unmute track This operation will not change the muted state of the stream this track belongs too.
muting
boolean if we want to mute or unmute
Stop recording this track
RecorderTrack stopped event
recorderTrack
RecorderTrack
Extends Emitter
Periodically request an I frame on all incoming stream or tracks
Restart refreshing interval
period
timeout
Number Refresh pedior in ms
Add stream or track to request
streamOrTrack
(IncomintgStream | IncomingStreamTrack)
Remove stream or track to request
streamOrTrack
(IncomintgStream | IncomingStreamTrack)
Stop refresher
Refresher event to indicate that refesh is taking place
refreser
Refresher
Refresher stopped event
refresher
Refresher
Extends Emitter
An streamer allows to send and receive plain RTP over udp sockets. This allows both to bridge legacy enpoints or integrate streaming/broadcasting services.
Creates a new streaming session from a media description
-
media
MediaInfo Media codec description info -
params
Object Network parameters [Optional]
Returns StreamerSession The new streaming session
Stop all streaming sessions and frees resources
Streamer stopped event
streamer
Streamer
Extends Emitter
ActiveSpeakerDetector accumulate received voice activity and fires an event when it changes
Set minimum period between active speaker changes
minChangePeriod
Number
Maximux activity score accumulated by an speaker
maxAcummulatedScore
Number
Minimum db level to not be considered as muted
noiseGatingThreshold
Number
Set minimum activation score to be electible as active speaker
minActivationScore
Number
Add incoming track for speaker detection
track
IncomingStreamTrack
Remove track from speaker detection
track
IncomingStreamTrakc
Stop this transponder, will dettach the OutgoingStreamTrack
ActiveSpeakerDetector new active speaker detected event
track
IncomingStreamTrack Track that has been activated
ActiveSpeakerDetector stopped event
activeSpeakerDetector
ActiveSpeakerDetector
Extends Emitter
Transponder copies data from an incoming track to an outgoing track and allows stream modifications
Set incoming track
-
track
IncomingStreamTrack Incoming track to attach to -
layers
Object [Optional] Only applicable to video trackslayers.encodingId
String rid value of the simulcast encoding of the track (default: first encoding available)layers.spatialLayerId
Number The spatial layer id to send to the outgoing stream (default: max layer available)layers.temporalLayerId
Number The temporaral layer id to send to the outgoing stream (default: max layer available)layers.maxSpatialLayerId
Number Max spatial layer id (default: unlimited)layers.maxTemporalLayerId
Number Max temporal layer id (default: unlimited)
-
smooth
Boolean Wait until next valid frame before switching to the new encoding
Set out of band negotiated H264 parameter sets
sprop
String H264 parameters sets
Get Transponder media type
Returns String "audio"|"video"
Get attached track
Returns IncomingStreamTrack track
Get available encodings and layers
Returns Object
Get available encodings and layers
Returns Object
Check if the track is muted or not
Returns boolean muted
Mute/Unmute track This operation will not change the muted state of the stream this track belongs too.
muting
boolean if we want to mute or unmute
Set intra frame forwarding mode
intraOnlyForwarding
boolean true if you want to forward only intra frames, false otherwise
Select encoding and temporal and spatial layers based on the desired bitrate. This operation will unmute the transponder if it was mutted and it is possible to select an encoding and layer based on the target bitrate and options.
-
target
-
options
Object Options for configuring algorithm to select best encoding/layers [Optional]options.traversal
Object Traversal algorithm "default", "spatial-temporal", "zig-zag-spatial-temporal", "temporal-spatial", "zig-zag-temporal-spatial" [Default: "default"]options.strict
Object If there is not a layer with a bitrate lower thatn target, stop sending media [Default: false]options.smooth
Object When going to a lower simulcast layer, keep the higher one visible [Default: true]
-
bitrate
Number
Returns Number Current bitrate of the selected encoding and layers, it aslo incudes the selected layer indexes and available layers as properties of the Number object.
Select encoding and temporal and spatial layers based on the desired bitrate. This operation will unmute the transponder if it was mutted and it is possible to select an encoding and layer based on the target bitrate and options.
-
target
-
options
Object Options for configuring algorithm to select best encoding/layers [Optional]options.traversal
Object Traversal algorithm "default", "spatial-temporal", "zig-zag-spatial-temporal", "temporal-spatial", "zig-zag-temporal-spatial" [Default: "default"]options.strict
Object If there is not a layer with a bitrate lower thatn target, stop sending media [Default: false]options.smooth
Object When going to a lower simulcast layer, keep the higher one visible [Default: true]
-
bitrate
Number
Returns any Promise<{Number}> Current bitrate of the selected encoding and layers, it aslo incudes the selected layer indexes and available layers as properties of the Number object.
Select the simulcast encoding layer and svc layers
-
layers
Object [Optional] Only applicable to video trackslayers.encodingId
String rid value of the simulcast encoding of the track (default: the current one)layers.spatialLayerId
Number The spatial layer id to send to the outgoing stream (default: max layer available)layers.temporalLayerId
Number The temporaral layer id to send to the outgoing stream (default: max layer available)layers.maxSpatialLayerId
Number Max spatial layer id (default: unlimited)layers.maxTemporalLayerId
Number Max temporal layer id (default: unlimited)
-
smooth
Boolean Wait until next valid frame before switching to the new encoding
Return the encoding that is being forwarded
Returns String encodingId
Return the spatial layer id that is being forwarded
Returns Number spatial layer id
Return the temporal layer id that is being forwarded
Returns Number temporal layer id
Get current selected layer info
Returns Object
Get current selected layer info
Returns Object
Select SVC temporatl and spatial layers. Only available for VP9 media.
spatialLayerId
Number The spatial layer id to send to the outgoing streamtemporalLayerId
Number The temporaral layer id to send to the outgoing stream
Set maximum statial and temporal layers to be forwrarded. Base layer is always enabled.
Stop this transponder, will dettach the OutgoingStreamTrack
Transponder muted event
transponder
Transponder
Transponder muted event
transponder
Transponder
Transponder stopped event
transponder
Transponder
Extends Emitter
MP4 recorder that allows to record several streams/tracks on a single mp4 file
Get recording filename
Returns String
Get recording filename
Returns Date
Is the recording time shifted?
Returns Boolean
Start recording time shiftt buffer.
filename
String Override filename [Optional]
Start recording and incoming
incomingStreamOrTrack
(IncomingStream | IncomingStreamTrack) Incomining stream or track to be recordedsoptions
Returns Array<RecorderTrack>
Mute/Unmute all tracks This operation will not change the muted state of the stream this track belongs too.
muting
boolean if we want to mute or unmute
Stop recording and close file. NOTE: File will be flsuh async,
Returns undefined TODO: return promise when flush is ended
Recorder started event. This event will be triggered when the first media frame is being recorded.
Recorder stopped event
recorder
Recorder
Extends Emitter
MP4 recorder that allows to record several streams/tracks on a single mp4 file
Get all the tracks
Returns Array<IncomingStreamTrack> Array of tracks
Get an array of the media stream audio tracks
Returns Array<IncomingStreamTrack> Array of tracks
Get an array of the media stream video tracks
Returns Array<IncomingStreamTrack> Array of tracks
Starts playback
Resume playback
Pause playback
Start playback from given time
time
Number in miliseconds
Stop playing and close file
Playback ended event
player
Player
Player stopped event
player
Player
Extends Emitter
Represent the connection between a local udp port and a remote one. It sends and/or receive plain RTP data.
Get the local rtp/udp port
Returns Number port number
Set the rempte rtp/udp ip and port
ip
port
Returns the incoming stream track associated with this streaming session
Returns IncomingStreamTrack
Returns the outgoing stream track associated with this streaming session
Returns OutgoingStreamTrack
Closes udp socket and frees resources
StreamerSession stopped event
session
StreamerSession
Add event listener
Returns Transport
Add event listener once
Returns IncomingStream
Remove event listener
Returns Transport
Extends Emitter
The incoming streams represent the recived media stream from a remote peer.
The media stream id as announced on the SDP
Returns String
Get the stream info object for signaling the ssrcs and stream info on the SDP from the remote peer
Returns StreamInfo The stream info object
Get statistics for all tracks in the stream
See IncomingStreamTrack.getStats for information about the stats returned by each track.
Get statistics for all tracks in the stream
See IncomingStreamTrack.getStats for information about the stats returned by each track.
Returns any Promise<{Map,Object}> Map with stats by trackId
Check if the stream is muted or not
Returns boolean muted
Get track by id
trackId
String The track id
Returns IncomingStreamTrack requested track or null
Get all the tracks
type
String The media type (Optional)
Returns Array<IncomingStreamTrack> Array of tracks
Get an array of the media stream audio tracks
Returns Array<IncomingStreamTrack> Array of tracks
Get an array of the media stream video tracks
Returns Array<IncomingStreamTrack> Array of tracks
Create new track from a TrackInfo object and add it to this stream
trackInfo
TrackInfo Track info object
Returns IncomingStreamTrack
Reset ssrc state of all tracks
Return if the stream is attached or not
Removes the media strem from the transport and also detaches from any attached incoming stream
IncomingStream stopped event
muted
boolean
IncomingStream attached event
incomingStream
IncomingStream
IncomingStream attached event
incomingStream
IncomingStream
IncomingStream detached event
incomingStream
IncomingStream
IncomingStreamTrack added to stream
incomingStream
IncomingStreamincomingStreamTrack
IncomingStreamTrack
IncomingStream stopped event
incomingStream
IncomingStreamlast
Objects stats before closing
Extends Emitter
Mirror incoming stream from another endpoint. Used to avoid inter-thread synchronization when attaching multiple output streams.
Get stats for all encodings from the original track
Returns Map<String, Object> Map with stats by encodingId
Get stats for all encodings from the original track
Returns Map<String, Object> Map with stats by encodingId
Get active encodings and layers ordered by bitrate of the original track
Returns Object Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get active encodings and layers ordered by bitrate of the original track
Returns Object Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get track id as signaled on the SDP
Get track media id (mid)
Get track info object
Returns TrackInfo Track info
Return ssrcs associated to this track
Returns Object
Get track media type
Returns String "audio"|"video"
Get all track encodings Internal use, you'd beter know what you are doing before calling this method
Returns Array<Object> encodings *
Get encoding by id Internal use, you'd beter know what you are doing before calling this method
encodingId
String encoding Id,
Returns Object encoding *
Get default encoding Internal use, you'd beter know what you are doing before calling this method
Returns Object encoding *
Return if the track is attached or not
Signal that this track has been attached. Internal use, you'd beter know what you are doing before calling this method
Request an intra refres on all sources
Signal that this track has been detached. Internal use, you'd beter know what you are doing before calling this method
Check if the track is muted or not
Returns boolean muted
Removes the track from the incoming stream and also detaches any attached outgoing track or recorder
IncomingStreamTrackMirrored attached event
incomingStreamTrack
IncomingStreamTrackMirrored
IncomingStreamTrackMirrored attached event
incomingStreamTrack
IncomingStreamTrackMirrored
IncomingStreamTrackMirrored dettached event
incomingStreamTrack
IncomingStreamTrackMirrored
IncomingStreamTrackMirrored dettached event
incomingStreamTrack
IncomingStreamTrackMirrored
IncomingStreamTrack stopped event
incomingStreamTrack
IncomingStreamTrackMirrored
IncomingStreamTrack stopped event
incomingStreamTrack
IncomingStreamTrackMirrored
Extends Emitter
The incoming streams represent the media stream sent to a remote peer.
Get statistics for all tracks in the stream
See OutgoingStreamTrack.getStats for information about the stats returned by each track.
Get statistics for all tracks in the stream
See OutgoingStreamTrack.getStats for information about the stats returned by each track.
Check if the stream is muted or not
Returns boolean muted
Listen media from the incoming stream and send it to the remote peer of the associated transport.
-
incomingStream
IncomingStream The incoming stream to listen media for -
layers
Object [Optional] Only applicable to video trackslayers.encodingId
String rid value of the simulcast encoding of the track (default: first encoding available)layers.spatialLayerId
Number The spatial layer id to send to the outgoing stream (default: max layer available)layers.temporalLayerId
Number The temporaral layer id to send to the outgoing stream (default: max layer available)layers.maxSpatialLayerId
Number Max spatial layer id (default: unlimited)layers.maxTemporalLayerId
Number Max temporal layer id (default: unlimited)
Returns Array<Transponder> Track transponders array
Stop listening for media
Get the stream info object for signaling the ssrcs and stream info on the SDP to the remote peer
Returns StreamInfo The stream info object
The media stream id as announced on the SDP
Returns String
Get all the tracks
type
String The media type (Optional)
Returns Array<OutgoingStreamTrack> Array of tracks
Get track by id
trackId
String The track id
Returns IncomingStreamTrack requested track or null
Get an array of the media stream audio tracks
Returns (Array | OutgoingStreamTracks) Array of tracks
Get an array of the media stream video tracks
Returns (Array | OutgoingStreamTrack) Array of tracks
Create new track from a TrackInfo object and add it to this stream
-
params
(Object | TrackInfo | String) Params plain object, StreamInfo object or media type -
trackInfo
TrackInfo Track info object
Returns OutgoingStream The new outgoing stream
Returns OugoingStreamTrack
OutgoingStreamTrack stopped event
muted
boolean
OutgingStreamTrack created
outgoingStreamTrack
OutgingStreamTrack
OutgoingStream stopped event
outgoingStream
OutgoingStreamlast
Objects stats before closing
Extends Emitter
Manager of remote peer connecion clients
Stop the peerconnection server, will not stop the transport created by it
New managed transport has been created by a remote peer connection client
transport
Transport An initialized transport
PeerConnectionServer stopped event
peerConnectionServer
PeerConnectionServer
Extends Emitter
An emulated transport reads data from a unencrypted pcap file (typically from a transport dump), and acts like if it was a live transport from a remote peer. You must create the incoming streams as signaled on the remote SDP as any incoming RTP with an unknown ssrc will be ignored. The emulated transport does not allow creating outgoing streams.
Set remote RTP properties
-
rtp
(Object | SDPInfo) Object param containing media information for audio and videortp.audio
MediaInfo Audio media infortp.video
MediaInfo Video media info
Create an incoming stream object from the media stream info objet
info
StreamInfo Contains the ids and ssrcs of the stream to be created
Returns IncomingStream The newly created incoming stream object
Starts playback
Resume playback
Pause playback
Start playback from given time
time
Number in miliseconds
Stop transport and all the associated incoming and outgoing streams
Transport stopped event
transport
EmulatedTransport
Extends Emitter
An endpoint represent an UDP server socket. The endpoint will process STUN requests in order to be able to associate the remote ip:port with the registered transport and forward any further data comming from that transport. Being a server it is ICE-lite.
Set cpu affinity for udp send/recv thread.
cpu
Number CPU core or -1 to reset affinity.
Returns boolean true if operation was successful
setDefaultSRTProtectionProfiles
srtpProtectionProfiles
profiles
String Colon delimited list of SRTP protection profile names
[EXPERIMENTAL] See TypeScript typings for usage.
options
Set name for udp send/recv thread.
Useful for debugging or tracing. Currently only supported on Linux, fails on other platforms. Length is limited to 16 bytes.
name
String thread name to set
Returns boolean true if operation was successful
Set thread priority for udp send/recv thread. NOTE: User needs to have the appropiate rights to increase the thread priority in ulimit
priority
Number 0:Normal -19:RealTime
Returns boolean true if operation was successful
Set ICE timeout for outgoing ICE binding requests
timeout
Number Ammount of time in milliseconds between ICE binding requests
Get port at which UDP socket is bound
Create a new transport object and register it with the remote ICE username and password
-
remoteInfo
(Object | SDPInfo) Remote ICE and DTLS properties -
localInfo
Object Local ICE and DTLS properties (optional)localInfo.ice
ICEInfo Local ICE info, containing the username and password. Local ICE candidates list is not really used at all.localInfo.dtls
DTLSInfo Local DTLS infolocalInfo.candidates
Array.CandidateInfo Local candidate info
-
options
Object Dictionary with transport propertiesoptions.disableSTUNKeepAlive
boolean Disable ICE/STUN keep alives, required for server to server transportsoptions.srtpProtectionProfiles
String Colon delimited list of SRTP protection profile namesoptions.overrideBWE
boolean Override BWE reported by REMBoptions.disableREMB
boolean Disable REMB BWE calculation.options.prefferDTLSSetupActive
boolean Preffer setting local DTLS setup to 'active' if remote is 'actpass'.
Returns Transport New transport object
Get local ICE candidates for this endpoint. It will be shared by all the transport associated to this endpoint.
Returns Array.CandidateInfo
Get local DTLS fingerprint for this endpoint. It will be shared by all the transport associated to this endpoint.
Returns String
Helper that creates an offer from capabilities It generates a random ICE username and password and gets endpoint fingerprint
capabilities
Object Media capabilities as required by SDPInfo.create
Returns SDPInfo SDP offer
Create new peer connection server to manage remote peer connection clients
tm
TransactionManagercapabilities
Object Same as SDPInfo.answer capabilites
Returns PeerConnectionServer
Create new active speaker multiplexer for given outgoing tracks
streamOrTracks
(OutgoingStream | Array.OutgoingStreamTrack) Outgoing stream or outgoing stream track array to be multiplexed
Returns ActiveSpeakerMultiplexer
Mirror incoming stream from another endpoint. Used to avoid inter-thread synchronization when attaching multiple output streams. The endpoint will cache the cucrrent mirrored streams and return an already existing object if calling this method twice with same stream.
incomingStream
IncomingStream stream to mirror
Returns IncomingStream mirrored stream.
Mirror incoming stream track from another endpoint. Used to avoid inter-thread synchronization when attaching multiple output tracks. The endpoint will cache the cucrrent mirrored tracks and return an already existing object if calling this method twice with same track.
incomingStreamTrack
IncomingStreamTrack track to mirror
Returns IncomingStreamTrackMirrored mirrored track.
Create new SDP manager, this object will manage the SDP O/A for you and produce a suitable trasnport.
sdpSemantics
String Type of sdp plan "unified-plan" or "plan-b"capabilities
Object Capabilities objects
Returns SDPManager
Stop the endpoint UDP server and terminate any associated transport
Endpoint stopped event
endpoint
Endpoint
Extends Emitter
A transport represent a connection between a local ICE candidate and a remote set of ICE candidates over a single DTLS session. The transport object will internally allocate the ICE and DTLS information of the local side in order to signal it to the remote side and establish the connection. Each transport has a set of incoming and outgoing streams that allow to send or receive RTP streams to the remote peer. You must create the incoming streams as signaled on the remote SDP as any incoming RTP with an unknown ssrc will be ignored. When you create an outgoing stream, the transport will allocate internally the ssrcs for the different RTP streams in order to avoid collision. You will be able to retrieve that information from the streams object in order to be able to announce them on the SDP sent to the remote side. In order to decide how to route your streams you must attach the outgoing streams from one transport to the incoming streams of other (or same) transport.
Dump incoming and outgoint rtp and rtcp packets into a pcap file
-
filename
String Filename of the pcap file -
options
Object Dump parameters (optional)options.incoming
Boolean Dump incomoning RTP dataoptions.outgoing
Boolean Dump outgoing RTP dataoptions.rtcp
Boolean Dump rtcp RTP dataoptions.rtpHeadersOnly
Boolean Dump only rtp headers and first 16 bytes of payload for rtp packetsoptions.bwe
Boolean Dump bwe stats to a different file (.pcap->.csv)
Stop dumping transport rtp and rtcp packets
Get transport stats
- senderSideEstimationBitrate : Sneder side estimation bitrate (if available)
- ice : ICE related stats
- requestsSent : Number of ice requests sent
- requestsReceived : Number of ice requests received
- responsesSent : Number of ice responses sent
- responsesReceived : Number of ice responses received
Returns Object stats
Restart ICE on transport object
remoteICE
(Object | ICEInfo) Remote ICE info, containing the username and password.localICE
(Object | ICEInfo) Local ICE info, containing the username and password [Optional]
Returns ICEInfo Local ICE info
Get available outgoing bitrate in bps.
Returns Nummber
Get bandwidth estimation in bps.
Returns Nummber
Get current sent bitrate
Returns Nummber
Enable bitrate probing. This will send padding only RTX packets to allow bandwidth estimation algortithm to probe bitrate beyonf current sent values. The ammoung of probing bitrate would be limited by the sender bitrate estimation and the limit set on the setMaxProbing Bitrate. Note that this will only work on browsers that supports RTX and transport wide cc.
probe
Boolen
Set the maximum bitrate to be used if probing is enabled.
bitrate
Number
Enable or disable calculation of sender side estimation if transport wide cc has been negotiated
enabled
Boolean
Override the bitrate sent by REMB to the remote sender. The transport must be constructed with teh override bwe option, and transport wide cc must not be offered.
bitrate
Number
Do not allow probing to increase sent bitrate above certain limit
bitrate
Number limit
Set local RTP properties
-
rtp
(Object | SDPInfo) Object param containing media information for audio and videortp.audio
MediaInfo Audio media infortp.video
MediaInfo Video media info
Set remote RTP properties
-
rtp
(Object | SDPInfo) Object param containing media information for audio and videortp.audio
MediaInfo Audio media infortp.video
MediaInfo Video media info
Get current dtls state for transport
Returns String DTLS connection state as per the w3c spec "new", "connecting", "connected", "closed", "failed"
Get transport local DTLS info
Returns DTLSInfo DTLS info object
Get transport local ICE info
Returns ICEInfo ICE info object
Get local ICE candidates for this transport
Returns Array.CandidateInfo
Get transport remote DTLS info
Returns DTLSInfo DTLS info object
Get transport remote ICE info
Returns ICEInfo ICE info object
Get remote ICE candidates for this transport
Returns Array.CandidateInfo
Register a remote candidate info. Only needed for ice-lite to ice-lite endpoints
candidate
CandidateInfo
Returns boolean Wheter the remote ice candidate was alrady presnet or not
Register an array remote candidate info. Only needed for ice-lite to ice-lite endpoints
candidates
Array.CandidateInfo
Create new outgoing stream in this transport
-
params
(Object | StreamInfo | String) Params plain object, StreamInfo object or stream id
Returns OutgoingStream The new outgoing stream
Create new outgoing stream in this transport
Returns OutgoingStreamTrack The new outgoing stream track
Create an incoming stream object from the media stream info objet
Returns IncomingStream The newly created incoming stream object
Get all the incoming streams in the transport
Returns Array<IncomingStreams>
Get incoming stream
streamId
String the stream ID
Returns IncomingStream
Get all the outgoing streams in the transport
Returns Array<OutgoingStreams>
Get incoming stream
streamId
String the stream ID
Returns IncomingStream
Create new incoming stream in this transport. TODO: Simulcast is still not supported
Returns IncomingStreamTrack The new incoming stream track
Create new outgoing stream and attach to the incoming stream
incomingStream
IncomingStream the incoming stream to be published in this transport
Returns OutgoingStream The new outgoing stream
Stop transport and all the associated incoming and outgoing streams
ICE timoute event. Fired when no ICE request ar received for 30 seconds.
transport
Transport
DTLS State change event
dtlsstate
String DTLS connection state as per the w3c spec "new", "connecting", "connected", "closed", "failed"transport
Transport
ICE remote candidate activation event. This event fires when ICE candidate has correctly being checked out and we start using it for sending.
candidate
CandidateInfo The ip and port of the remote ICE candidate that is in use by the transporttransport
Transport
Transport sender side estimation bitrate target udpate
targetBitrate
IntegerbandwidthEstimation
IntegertotalBitrate
Integertransport
Transport
New outgoing stream track added to transport
track
OutgoingStreamTrackstream
OutgoingStream?
New incoming stream track added to transport
track
IncomingStreamTrackstream
IncomingStream
Transport stopped event
transport
Transport
parse a dot-separated IPv4 into a normalized address as u32be
ip
AudioDecoder stopped event
frame
Objectreader
IncomingStreamTrackReader
AudioDecoder stopped event
reader
IncomingStreamTrackReader
parse a CIDR into a normalized [address as u32be, prefix length] tuple
cidr
Extends Emitter
Audio or Video track of a media stream sent to a remote peer
Get track id as signaled on the SDP
Get track media id (mid)
Get track media type
Returns String "audio"|"video"
Get track info object
Returns TrackInfo Track info
Get stats for all encodings
You will get stats for media and rtx sources (if used):
- timestmap : timestamp on when this stats where created
- media : mediaStats,
- rtx : rtxStats,
- remb : remote estimated bitate (if remb is in use)
- numPackets : number of rtp packets sent
- numPacketsDelta : number of rtp packets sent during last second
- bitrate : Bitrate for media stream only in bps
- total : Accumulated bitrate for media and rtx streams in bps
The stats objects will privide the follwing info for each source
- numFrames : total recevied frames
- numFramesDelta : recevied frames during last second
- numPackets : number of rtp packets sent
- numPacketsDelta : number of rtp packets sent during last second
- numRTCPPackets : number of rtcp packsets sent
- totalBytes : total rtp sent bytes
- totalRTCPBytes : total rtp sent bytes
- bitrate : average bitrate sent during last second in bps
- reportCount : number of RTCP receiver reports received
- reportCountDelta : number of RTCP receiver reports received during last second
- reportedLostCount : total packet loses reported
- reportedLostCountDelta : packet losses reported in last second
- reportedFractionLost : fraction loss media reported during last second
- reportedJitter : last reported jitter buffer value
Returns Map<String, Object> Map with stats by encodingId
Get stats for all encodings
You will get stats for media and rtx sources (if used):
- timestmap : timestamp on when this stats where created
- media : mediaStats,
- rtx : rtxStats,
- remb : remote estimated bitate (if remb is in use)
- numPackets : number of rtp packets sent
- numPacketsDelta : number of rtp packets sent during last second
- bitrate : Bitrate for media stream only in bps
- total : Accumulated bitrate for media and rtx streams in bps
The stats objects will privide the follwing info for each source
- numFrames : total recevied frames
- numFramesDelta : recevied frames during last second
- numPackets : number of rtp packets sent
- numPacketsDelta : number of rtp packets sent during last second
- numRTCPPackets : number of rtcp packsets sent
- totalBytes : total rtp sent bytes
- totalRTCPBytes : total rtp sent bytes
- bitrate : average bitrate sent during last second in bps
- reportCount : number of RTCP receiver reports received
- reportCountDelta : number of RTCP receiver reports received during last second
- reportedLostCount : total packet loses reported
- reportedLostCountDelta : packet losses reported in last second
- reportedFractionLost : fraction loss media reported during last second
- reportedJitter : last reported jitter buffer value
Returns Map<String, Object> Map with stats by encodingId
Return ssrcs associated to this track
Returns Object
Check if the track is muted or not
Returns boolean muted
Check if this outgoing stream track is alredy attached to an incoming stream track.
Returns Boolean true if attached, false otherwise
Create a transponder if not already attached or return current one.
Returns Transponder Track transponder object
Listen media from the incoming stream track and send it to the remote peer of the associated transport. This will stop any previous transpoder created by a previous attach.
-
incomingStreamTrack
IncomingStreamTrack The incoming stream to listen media for -
layers
Object [Optional] Only applicable to video trackslayers.encodingId
String rid value of the simulcast encoding of the track (default: first encoding available)layers.spatialLayerId
Number The spatial layer id to send to the outgoing stream (default: max layer available)layers.temporalLayerId
Number The temporaral layer id to send to the outgoing stream (default: max layer available)layers.maxSpatialLayerId
Number Max spatial layer id (default: unlimited)layers.maxTemporalLayerId
Number Max temporal layer id (default: unlimited)
Returns Transponder Track transponder object
Stop forwarding any previous attached track. This will set the transponder inconming track to null
Get attached transpoder for this track
Returns Transponder Attached transpoder or null if not attached
Removes the track from the outgoing stream and also detaches from any attached incoming track
OutgoingStreamTrack remb event
outgoingStreamTrack
OutgoingStreamTrackbitrate
Number estimation
OutgoingStreamTrack stopped event
muted
boolean
IncomingStreamTrack stopped event
muted
boolean
IncomingStreamTrack stopped event
muted
boolean
IncomingStreamTrack stopped event
muted
boolean
OutgoingStreamTrack stopped event
outgoingStreamTrack
OutgoingStreamTrack
Extends Emitter
Audio or Video track of a remote media stream
Get stats for all encodings
For each encoding you will get stats for media and rtx sources (if used):
- media : Stats for the media stream
- rtx : Stats for the rtx retransmission stream
- rtt : Round Trip Time in ms
- waitTime : "min","max" and "avg" packet waiting times in rtp buffer before delivering them
- bitrate : Bitrate for media stream only in bps
- total : Accumulated bitrate for media and rtx streams in bps
- remb : Estimated avialable bitrate for receving (only avaailable if not using tranport wide cc)
- timestamp: When this stats was generated, in order to save workload, stats are cached for 200ms
- simulcastIdx : Simulcast layer index based on bitrate received (-1 if it is inactive).
- lostPackets : Accumulated lost packets for media and rtx strems
- numPackets : Accumulated packets for media and rtx strems
- lostPacketsRatio : Lost packets ratio
The stats objects will provide the following info for each source
- numFrames : total recevied frames
- numFramesDelta : recevied frames during last second
- lostPackets : total lost packkets
- lostPacketsDelta : Lost/out of order packets during last second
- lostPacketsMaxGap : max total consecutieve packets lossed during last second
- lostPacketsGapCount : number of packet looses bursts during last second
- dropPackets : droppted packets by media server
- numPackets : number of rtp packets received
- numPacketsDelta : number of rtp packets received during last seconds
- numRTCPPackets : number of rtcp packsets received
- totalBytes : total rtp received bytes
- totalRTCPBytes : total rtp received bytes
- totalPLIs : total PLIs sent
- totalNACKs : total NACk packets sent
- bitrate : average bitrate received during last second in bps
- skew : difference between NTP timestamp and RTP timestamps at sender (from RTCP SR)
- drift : ratio between RTP timestamps and the NTP timestamp and at sender (from RTCP SR)
- clockRate : RTP clockrate
- frameDelay : Average frame delay during the last second
- frameDelayMax : Max frame delay during the last second
- frameCaptureDelay : Average bewtween local reception time and sender capture one (Absolute capture time must be negotiated)
- frameCaptureDelayMax : Max bewtween local reception time and sender capture one (Absolute capture time must be negotiated)
- width : video width
- height : video height
- layers : Information about each spatial/temporal layer (if present)
- spatialLayerId : Spatial layer id
- temporalLayerId : Temporatl layer id
- totalBytes : total rtp received bytes for this layer
- numPackets : number of rtp packets received for this layer
- bitrate : average bitrate received during last second for this layer
- targetBitrate : Signaled target bitrate on the VideoLayersAllocation header
- targetWidth : Signaled target width on the VideoLayersAllocation header
- targetHeight : Signaled target height on the VideoLayersAllocation header
- targetFps : Signaled target fps on the VideoLayersAllocation header
Returns any Promise<{Map<String,Object>}> Promise resolving to a map with stats by encodingId
Get stats for all encodings
For each encoding you will get stats for media and rtx sources (if used):
- media : Stats for the media stream
- rtx : Stats for the rtx retransmission stream
- rtt : Round Trip Time in ms
- waitTime : "min","max" and "avg" packet waiting times in rtp buffer before delivering them
- bitrate : Bitrate for media stream only in bps
- total : Accumulated bitrate for media and rtx streams in bps
- remb : Estimated avialable bitrate for receving (only avaailable if not using tranport wide cc)
- timestamp: When this stats was generated, in order to save workload, stats are cached for 200ms
- simulcastIdx : Simulcast layer index based on bitrate received (-1 if it is inactive).
- lostPackets : Accumulated lost packets for media and rtx strems
- numPackets : Accumulated packets for media and rtx strems
- lostPacketsRatio : Lost packets ratio
The stats objects will provide the following info for each source
- numFrames : total recevied frames
- numFramesDelta : recevied frames during last second
- lostPackets : total lost packkets
- lostPacketsDelta : Lost/out of order packets during last second
- lostPacketsMaxGap : max total consecutieve packets lossed during last second
- lostPacketsGapCount : number of packet looses bursts during last second
- dropPackets : droppted packets by media server
- numPackets : number of rtp packets received
- numPacketsDelta : number of rtp packets received during last seconds
- numRTCPPackets : number of rtcp packsets received
- totalBytes : total rtp received bytes
- totalRTCPBytes : total rtp received bytes
- totalPLIs : total PLIs sent
- totalNACKs : total NACk packets sent
- bitrate : average bitrate received during last second in bps
- skew : difference between NTP timestamp and RTP timestamps at sender (from RTCP SR)
- drift : ratio between RTP timestamps and the NTP timestamp and at sender (from RTCP SR)
- clockRate : RTP clockrate
- frameDelay : Average frame delay during the last second
- frameDelayMax : Max frame delay during the last second
- frameCaptureDelay : Average bewtween local reception time and sender capture one (Absolute capture time must be negotiated)
- frameCaptureDelayMax : Max bewtween local reception time and sender capture one (Absolute capture time must be negotiated)
- width : video width
- height : video height
- layers : Information about each spatial/temporal layer (if present)
- spatialLayerId : Spatial layer id
- temporalLayerId : Temporatl layer id
- totalBytes : total rtp received bytes for this layer
- numPackets : number of rtp packets received for this layer
- bitrate : average bitrate received during last second for this layer
Returns Map<String, Object> Map with stats by encodingId
Get active encodings and layers ordered by bitrate
Returns Object Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get active encodings and layers ordered by bitrate
Returns any Promise<{Object}> Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get track id as signaled on the SDP
Get track media id
Get track info object
Returns TrackInfo Track info
Return ssrcs associated to this track
Returns Object
Get track media type
Returns String "audio"|"video"
Get all track encodings Internal use, you'd beter know what you are doing before calling this method
Returns Array<Object> encodings *
Get encoding by id Internal use, you'd beter know what you are doing before calling this method
encodingId
String encoding Id,
Returns Object encoding *
Get default encoding Internal use, you'd beter know what you are doing before calling this method
Returns Object encoding *
Signal that this track has been attached. Internal use, you'd beter know what you are doing before calling this method
Request an intra refres on all sources
Reset state of incoming sources
Check if the track is muted or not
Returns boolean muted
Return if the track is attached or not
Signal that this track has been detached. Internal use, you'd beter know what you are doing before calling this method
Store out of band h264 properties for this track
sprop
String Base64 encoded parameters from SDP
Check if track has out of band h264 properties
Returns Boolean
Get out of band h264 parameters from this track
Returns Boolean
Override the maximum period of time to wait for an out of order or rtx packet
maxWaitTime
Number max wait time in ms (default: 0 if rtx is not supported or rtt based)
Remove override for the maximum period of time to wait for an out of order or rtx packet
Removes the track from the incoming stream and also detaches any attached outgoing track or recorder
IncomingStreamTrack new encoding event
incomingStreamTrack
IncomingStreamTrackencoding
Object
IncomingStreamTrack new encoding event
incomingStreamTrack
IncomingStreamTrackencoding
Object
IncomingStreamTrack attached event
incomingStreamTrack
IncomingStreamTrack
IncomingStreamTrack detached event
incomingStreamTrack
IncomingStreamTrack
IncomingStreamTrack stopped event
incomingStreamTrack
IncomingStreamTrack
Create a dedicated socket on each query, no caching... it's inefficient but more robust, we don't need to give user a way to invalidate the cache, we don't need to be careful when managing refs, subscriptions...
callback
Extends Emitter
Bundle multiple video track as if they were a single simulcast video track
Add video track to the simulcast adapter
encodingId
String Id used as base for encodings idincomingStreamTrack
IncomingStreamTrack Incoming video stream track
Remove video track to the simulcast adapter
incomingStreamTrack
IncomingStreamTrack Incoming video stream track
Get stats for all encodings from the original track
Returns Map<String, Object> Map with stats by encodingId
Get stats for all encodings from the original track
Returns any Promise<{Map<String,Object>}> Map with stats by encodingId
Get active encodings and layers ordered by bitrate of the original track
Returns Object Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get active encodings and layers ordered by bitrate of the original track
Returns Object Active layers object containing an array of active and inactive encodings and an array of all available layer info
Get track id as signaled on the SDP
Get track media id (mid)
Get track info object
Returns TrackInfo Track info
Return ssrcs associated to this track
Returns Object
Get track media type
Returns String "audio"|"video"
Get all track encodings Internal use, you'd beter know what you are doing before calling this method
Returns Array<Object> encodings *
Get encoding by id Internal use, you'd beter know what you are doing before calling this method
encodingId
String encoding Id,
Returns Object encoding *
Get default encoding Internal use, you'd beter know what you are doing before calling this method
Returns Object encoding *
Check if the track is muted or not
Returns boolean muted
Return if the track is attached or not
Signal that this track has been attached. Internal use, you'd beter know what you are doing before calling this method
Request an intra refres on all sources
Signal that this track has been detached. Internal use, you'd beter know what you are doing before calling this method
Removes the track from the incoming stream and also detaches any attached outgoing track or recorder
list
name
Continuation of collectRoutingInfo once a route has been selected (split to allow reusal from getInterfaceRawConfig).