Skip to main content

Module rtmp

Module rtmp 

Source
Expand description

Frame-push RTMP output.

RtmpOutput receives pre-decoded ff_format::VideoFrame / ff_format::AudioFrame values from the caller, encodes them with H.264/AAC, and pushes the stream to an RTMP ingest endpoint using FFmpeg’s built-in RTMP support.

§Example

use ff_stream::{RtmpOutput, StreamOutput};

let mut out = RtmpOutput::new("rtmp://ingest.example.com/live/stream_key")
    .video(1920, 1080, 30.0)
    .audio(44100, 2)
    .video_bitrate(4_000_000)
    .audio_bitrate(128_000)
    .build()?;

// for each decoded frame:
out.push_video(&video_frame)?;
out.push_audio(&audio_frame)?;

// when done:
Box::new(out).finish()?;

Structs§

RtmpOutput
Live RTMP output: encodes frames and pushes them to an RTMP ingest endpoint.