@seydx/rtsp / TrackInfo
Interface: TrackInfo
Defined in: types.ts:87
Metadata describing a single elementary stream of the upstream source.
Each track corresponds to one demuxed stream (a video, audio, or data channel) and carries just enough information for the relay to route packets and for sinks to reproduce the stream. Codec specifics are kept opaque so the relay core stays format-agnostic; AV-backed sinks read the native handle when they need to attach the stream to a muxer.
Example
import { Source, StreamInfo } from '@seydx/rtsp';
const info: StreamInfo = await source.open();
for (const track of info.tracks) {
console.log(track.index, track.kind, track.codec);
}See
- StreamInfo For the full set of tracks a source carries
- MediaPacket For the units of media that flow per track
Properties
codec
codec:
string
Defined in: types.ts:110
Lower-case codec name of the track.
Examples include h264, hevc, aac, opus, and pcm_alaw. Reported in the canonical FFmpeg short-name form.
index
index:
number
Defined in: types.ts:94
Stream index as reported by the source.
Matches MediaPacket.streamIndex for every packet belonging to this track, allowing sinks to correlate packets with their describing track.
kind
kind:
TrackKind
Defined in: types.ts:102
High-level category of this track.
One of video, audio, or data, letting consumers branch on stream type without parsing the codec name.
native?
optionalnative?:Stream
Defined in: types.ts:119
Source-native stream handle.
For AV-backed sources this is the underlying node-av Stream, which AV-backed sinks pass to addStream() when configuring a muxer. The relay core never inspects it; it is absent for sources that are not AV-backed.
timeBase?
optionaltimeBase?:IRational
Defined in: types.ts:128
Stream time base as a node-av IRational ({ num, den }).
Present for AV-backed sources and describes the unit of the packet timestamps in seconds (num / den). Used by sinks that need to rescale or interpret PTS/DTS values.