Skip to main content

publish_open

Function publish_open 

Source
pub fn publish_open(
    tracks: &[PublishTrack],
) -> Result<Vec<PublishMessage>, RtmpError>
Expand description

The ordered messages a publisher sends between publish and its first frame: the @setDataFrame/onMetaData stream description, then every track’s sequence header, each at timestamp 0.

The metadata message states OnMetadata’s properties in the publisher’s RTMP form (OnMetadata::publish_body), where an FLV file writes OnMetadata::script_body; a live stream gives no duration, because there is no length to claim.

§Errors

RtmpError::Malformed when tracks holds neither an AVC video nor an AAC audio track, and RtmpError::FieldOverflow when a property key exceeds its AMF0 length prefix.