The Stream API provides functionality to access media stream information and create decoders/encoders.
const stream = new ffmpeg.Stream(handle)handle(ArrayBuffer): Internal stream handle
Returns: A new Stream instance
Streams are typically obtained from format contexts:
const stream = format.streams[0]
Gets or sets the stream ID.
Returns: number
Gets the stream index.
Returns: number
Gets the codec for this stream.
Returns: Codec instance
Gets the codec parameters for this stream.
Returns: CodecParameters instance
Gets the side data associated with the stream.
Returns: Array<SideData>
Gets or sets the time base for the stream.
Returns: Rational instance
Gets or sets the average framerate for video streams.
Returns: Rational instance
Example:
const fps = stream.avgFramerate.toNumber()Gets or sets the duration of the stream in time base units.
Returns: number - Duration in time base units, or 0 if unknown
Creates a decoder for this stream.
Returns: CodecContext instance
Creates an encoder for this stream.
Returns: CodecContext instance