Streams: an automatic bitrate up to 60 Mbit/s, and presets to match
The bitrate was a fixed 8 Mbit/s by default whatever was shared, and the share dialog offered at most 10 Mbit/s and 60 fps. Asked for: Voelin streams that can target 60 Mbit/s at up to 8K and 320 fps, with an automatic bitrate that scales with the stream's resolution and frame rate and follows it live, beyond 60 Mbit/s only when typed. - `media::auto_bitrate(width, height, fps)`: 0.12 bits per pixel and frame (7.5 Mbit/s at 1080p30, 15 at 1080p60, 27 at 1440p60) between 300 kbit/s and 60 Mbit/s, reached at 4K60 and 1080p240. - `stream.bitrate_kbps` 0 is automatic and now the default. A streamer layer with bitrate 0 works it out per picture from the size encoded and the layer's frame rate, so a new resolution or frame rate moves it at once, and tells its sink (`MediaSink::auto_bitrate`). The engine's `StreamSink` puts it into the live stream's layer, so connections start their bandwidth estimate at it and probe for it; without that the stream would have kept the bitrate announced at the start. `Streamer::bitrate_kbps()` is what to announce. - The quick share offers 15-320 fps and Auto, 2.5 to 60 Mbit/s (typed values still have no maximum; the `ui` blob keeps indices of the old lists for older versions). The studio offers 4K and 8K and 30-240 fps, takes an empty bitrate as automatic and derives its first simulcast layer from the automatic bitrate. - The studio now tells the engine its layers when it goes live and when they change (`SetStreamLayers`), and a quick share resets them: the session sends only layers it knows of, so a studio's simulcast layers never reached a viewer, and its layer kept the bitrate announced. - `voelinctl stream start` and `stream bench` default to the automatic bitrate too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4fe7263553
commit
8917f7dab2
13 files changed
+375
-85
No files matched your search
@@ -262,13 +262,15 @@ export struct SourceItem {
|
||||
export struct ShareForm {
|
||||
source: int,
|
||||
name: string,
|
||||
// Index into the frame rate choices (15, 30, 60).
|
||||
// Index into the frame rate choices (15, 30, 60, 120, 144, 240, 320).
|
||||
fps-index: int,
|
||||
// Frames per second as typed; a choice fills it in. Any number above 0.
|
||||
fps: string,
|
||||
// Index into the bitrate choices (2.5, 4.6, 8, 10 Mbit/s).
|
||||
// Index into the bitrate choices (Auto, 2.5, 4.6, 8, 10, 20, 40, 60
|
||||
// Mbit/s).
|
||||
bitrate-index: int,
|
||||
// Video bitrate in kbit/s as typed; a choice fills it in.
|
||||
// Video bitrate in kbit/s as typed; a choice fills it in. Empty with
|
||||
// Auto: from the size and frame rate shared, up to 60 Mbit/s.
|
||||
bitrate: string,
|
||||
audio: bool,
|
||||
auto-accept: bool,
|
||||
|
||||
@@ -356,10 +356,11 @@ component ShareCard inherits Modal {
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Select {
|
||||
model: [@tr("15 fps"), @tr("30 fps"), @tr("60 fps")];
|
||||
// FPS_CHOICES (settings.rs).
|
||||
model: [@tr("15 fps"), @tr("30 fps"), @tr("60 fps"), @tr("120 fps"), @tr("144 fps"), @tr("240 fps"), @tr("320 fps")];
|
||||
current-index <=> form.fps-index;
|
||||
label: @tr("Frame rate");
|
||||
selected => { form.fps = [15, 30, 60][self.current-index]; }
|
||||
selected => { form.fps = [15, 30, 60, 120, 144, 240, 320][self.current-index]; }
|
||||
}
|
||||
TextField {
|
||||
text <=> form.fps;
|
||||
@@ -377,15 +378,16 @@ component ShareCard inherits Modal {
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Select {
|
||||
model: [@tr("Low (2.5 Mbit/s)"), @tr("Standard (4.6 Mbit/s)"), @tr("High (8 Mbit/s)"), @tr("Best (10 Mbit/s)")];
|
||||
// BITRATE_CHOICES (settings.rs); Auto leaves the field empty.
|
||||
model: [@tr("Auto (up to 60 Mbit/s)"), @tr("Low (2.5 Mbit/s)"), @tr("Standard (4.6 Mbit/s)"), @tr("High (8 Mbit/s)"), @tr("10 Mbit/s"), @tr("20 Mbit/s"), @tr("40 Mbit/s"), @tr("Best (60 Mbit/s)")];
|
||||
current-index <=> form.bitrate-index;
|
||||
label: @tr("Quality");
|
||||
selected => { form.bitrate = [2500, 4608, 8000, 10000][self.current-index]; }
|
||||
selected => { form.bitrate = self.current-index == 0 ? "" : "\{[0, 2500, 4608, 8000, 10000, 20000, 40000, 60000][self.current-index]}"; }
|
||||
}
|
||||
TextField {
|
||||
text <=> form.bitrate;
|
||||
input-type: number;
|
||||
placeholder: @tr("kbit/s");
|
||||
placeholder: form.bitrate-index == 0 ? @tr("auto") : @tr("kbit/s");
|
||||
label: @tr("Bitrate in kbit/s");
|
||||
// On a phone both pairs fit side by side.
|
||||
width: Nav.narrow ? 60px : 80px;
|
||||
|
||||
@@ -1459,40 +1459,28 @@ export component StreamSettings inherits VerticalLayout {
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
Button {
|
||||
for size in [
|
||||
{ text: "720p", width: "1280", height: 720 },
|
||||
{ text: "1080p", width: "1920", height: 1080 },
|
||||
{ text: "1440p", width: "2560", height: 1440 },
|
||||
{ text: "4K", width: "3840", height: 2160 },
|
||||
{ text: "8K", width: "7680", height: 4320 },
|
||||
]: Button {
|
||||
small: true;
|
||||
text: "720p";
|
||||
text: size.text;
|
||||
horizontal-stretch: 1;
|
||||
checked: StudioBridge.status.output-height == 720;
|
||||
clicked => { StudioBridge.set-output("1280", "720", out-fps.text); }
|
||||
checked: StudioBridge.status.output-height == size.height;
|
||||
clicked => { StudioBridge.set-output(size.width, "\{size.height}", out-fps.text); }
|
||||
}
|
||||
Button {
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: Theme.space-2;
|
||||
for fps in [30, 60, 120, 144, 240] : Button {
|
||||
small: true;
|
||||
text: "1080p";
|
||||
text: "\{fps}";
|
||||
horizontal-stretch: 1;
|
||||
checked: StudioBridge.status.output-height == 1080;
|
||||
clicked => { StudioBridge.set-output("1920", "1080", out-fps.text); }
|
||||
}
|
||||
Button {
|
||||
small: true;
|
||||
text: "1440p";
|
||||
horizontal-stretch: 1;
|
||||
checked: StudioBridge.status.output-height == 1440;
|
||||
clicked => { StudioBridge.set-output("2560", "1440", out-fps.text); }
|
||||
}
|
||||
Button {
|
||||
small: true;
|
||||
text: "30";
|
||||
horizontal-stretch: 1;
|
||||
checked: StudioBridge.status.fps == 30;
|
||||
clicked => { StudioBridge.set-output(out-w.text, out-h.text, "30"); }
|
||||
}
|
||||
Button {
|
||||
small: true;
|
||||
text: "60";
|
||||
horizontal-stretch: 1;
|
||||
checked: StudioBridge.status.fps == 60;
|
||||
clicked => { StudioBridge.set-output(out-w.text, out-h.text, "60"); }
|
||||
checked: StudioBridge.status.fps == fps;
|
||||
clicked => { StudioBridge.set-output(out-w.text, out-h.text, "\{fps}"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1502,6 +1490,8 @@ export component StreamSettings inherits VerticalLayout {
|
||||
if StudioBridge.layers.length == 0: TextField {
|
||||
text: StudioBridge.form.bitrate;
|
||||
input-type: number;
|
||||
// Empty: automatic, from the output's size and frame rate.
|
||||
placeholder: @tr("Auto (up to 60 Mbit/s)");
|
||||
label: @tr("Bitrate in kbit/s");
|
||||
accepted(t) => { StudioBridge.edit-form("bitrate", t); }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user