Skip to content
Console

rtmp_push

Encode and push to one or more RTMP URLs (YouTube, Twitch, SRS, etc.).

Terminal window
curl -X POST "https://api.avflow.dev/v1/jobs" \
-H "Authorization: Bearer ${AVFLOW_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "youtube-live",
"sources": [{
"name": "room_src",
"type": "livekit",
"config": {
"serverUrl": "wss://your-project.livekit.cloud",
"token": "<token>"
}
}],
"nodes": [{
"name": "mix",
"type": "video_mixer",
"inputs": ["room_src"],
"config": {
"canvas": { "width": 1920, "height": 1080, "fps": 30 },
"layout": { "mode": "speaker" }
}
}],
"sinks": [{
"name": "yt",
"type": "rtmp_push",
"inputs": ["mix"],
"config": {
"urls": [
"rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx",
"rtmp://live.twitch.tv/app/live_xxxx"
],
"encoding": { "videoCodec": "h264" }
}
}]
}'
FieldTypeDefaultDescription
urlsstring[]requiredOne or more RTMP publish URLs.
encodingobjectVideo/audio codec and bitrates. See shared encoding. H.264 + AAC recommended for RTMP.

Supports in-band text metadata for ASR captions, audio levels, and layout info. avflow embeds each JSON DataEvent in the encoded video access unit: H.264/H.265 use user_data_unregistered SEI and AV1 uses an ITU-T T.35 Metadata OBU. VP8/VP9 drop in-band text metadata.

RTMP captions require an encoded video input. AVFlow does not generate an implicit black stream. For an audio-only workload, add an explicit video_generator source and connect it through a video_encoder. Without video, use segment for an independent HLS WebVTT caption rendition.

All in-band payloads use the same UUID, 4156464c-4f57-5445-5854-4d4554410001 (AVFLOWTEXTMETA). This is a fixed private avflow text-metadata namespace; event routing is inside the JSON body: { "type": "avflow.asrText" | "avflow.voiceAgentText" | "avflow.audioLevels" | "avflow.videoMixerLayout", "data": { ... } }.

Multiple URLs on the same sink share one encoder. Encoding is billed once. Egress is the sum of bytes successfully written to each destination:

successful_bytes(url_1) + ... + successful_bytes(url_n)

Failed writes are excluded; no url_count multiplier is applied after collection. See Sink pricing.

Encoding tier by resolution and codec, plus successful transport egress. Sink pricing.