Push a studio stream of any codec over RTMP, in H.264

Classic RTMP carries H.264 only, and the RTMP output refused a stream
encoding anything else. Since TeamSpeak streams now prefer the codecs
every client decodes before H.264, that refusal hit the usual case.

An output may now name a video codec of its own. The streamer then runs
an encoder of that codec for the layer the output takes, as it does for
a viewer that chose another codec, and hands those packets to the
outputs that asked for it only; recordings and the replay buffer keep
the stream's codec, which a studio now always encodes for them even
when every viewer chose another one. Only the output's layer gets the
extra encoder, not every simulcast layer.

Tested end to end: a VP8 studio stream pushed to FFmpeg's own RTMP
server arrives as H.264 and AAC (ffprobe), starting at a keyframe, while
a recording of the same stream stays VP8 and Opus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 19:42:02 +03:00
1 parent 7c3baf95e8
commit 49cd9a3f12
8 files changed
+266 -97

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ struct RunArgs {
#[arg(long)]
whip: Option<String>,
/// Push to this RTMP(S) server (`rtmp://host/app/key`, or the key in
/// --token). Needs --codec h264 unless H.264 is the first codec.
/// --token), in H.264: encoded besides the stream's unless --codec h264.
#[arg(long)]
rtmp: Option<String>,
/// Bearer token for --whip, stream key for --rtmp.