Weiche: H.264 mit der Grafikkarte (Profil Main statt Constrained Baseline, zwei Stufen ab 640x360)

Gemessen an diesem Rechner (kodierer4/5.mjs): 42e01f und Simulcast mit Stufen unter 640x360
laufen in Software (OpenH264), 42001f/4d001f mit zwei Stufen auf NVIDIA H.264 Encoder MFT.
Angebot des Sende-Anschlusses ohne 42e01f (nur wenn ein anderes H.264 bleibt); Wache in
pruef-reaktion fuer Stufengroesse, Profilstreichung und Ton-Prioritaet, je mit Gegenprobe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-04 04:33:41 +01:00
co-authored by Claude Opus 5.5
parent 510ce41ee1
commit 56fd0bf8d7
2 changed files with 93 additions and 7 deletions
+33
View File
@@ -4544,6 +4544,39 @@ melde("");
`Nachbericht: Zahlen nur für die Regie (Regie ${regie.code}/${regie.j?.da}, Saal ohne Zahlen)`);
}
/* ==== DIE WEICHE KODIERT MIT DER GRAFIKKARTE (04.11.2026) =================
Gemessen (kodierer4/5.mjs): Chrome nimmt für H.264 die Grafikkarte nur mit
Profil Baseline/Main (nicht Constrained Baseline 42e01f) und nur, wenn jede
Simulcast-Stufe mindestens 640×360 groß ist. Beides steht in saal-weiche.js
und wird hier aus der Datei abgeleitet – Kommentare vorher weg, die Funktion
wird wirklich ausgeführt. */
{
const roh = readFileSync(join(HIER, "..", "workspace", "assets", "js", "saal-weiche.js"), "utf8");
const code = roh.replace(/\/\*[\s\S]*?\*\//g, "");
ok(code.length > 5000 && code.length < roh.length, `Voraussetzung: saal-weiche.js ohne Kommentare gelesen (${code.length} Zeichen)`);
const stufen = /const SPIEL_STUFEN = (\[[^;]*\]);/.exec(code);
const liste = stufen ? JSON.parse(stufen[1].replace(/_/g, "")) : [];
const klein = (l) => l.some(([b, h]) => b < 640 || h < 360);
ok(liste.length >= 1 && !klein(liste) && klein([[320, 180, 1]]),
`jede Simulcast-Stufe fürs Spiel ist mindestens 640×360 (${JSON.stringify(liste)}) – sonst fällt Chrome auf Software zurück; Gegenprobe 320×180 erkannt`);
const a = code.indexOf("function abschnittOhneCB");
const b = code.indexOf("function hardwareProfil");
const ohne = new Function(`${code.slice(a, b)}; return ohneSoftwareProfil;`)();
const v = (mid, mitMain) => ["m=video 9 UDP/TLS/RTP/SAVPF 96 102 103" + (mitMain ? " 104 105" : ""), `a=mid:${mid}`,
"a=rtpmap:96 VP8/90000", "a=rtpmap:102 H264/90000", "a=rtcp-fb:102 nack", "a=fmtp:102 packetization-mode=1;profile-level-id=42e01f",
"a=rtpmap:103 rtx/90000", "a=fmtp:103 apt=102",
...(mitMain ? ["a=rtpmap:104 H264/90000", "a=fmtp:104 packetization-mode=1;profile-level-id=4d001f", "a=rtpmap:105 rtx/90000", "a=fmtp:105 apt=104"] : [])];
const sdp = ["v=0", "m=audio 9 X 111", "a=rtpmap:111 opus/48000/2", ...v(1, true), ...v(2, true), ""].join("\r\n");
const neu = ohne(sdp);
const nurCB = ["v=0", ...v(1, false), ""].join("\r\n");
ok(!/42e01f|a=fmtp:103|:102 /.test(neu) && (neu.match(/4d001f/g) || []).length === 2 && neu.includes("a=rtpmap:111 opus")
&& neu.split("\r\n").filter((l) => l.startsWith("m=video")).every((l) => l.endsWith("96 104 105")) && ohne(nurCB) === nurCB,
"Angebot: Constrained Baseline (42e01f) samt rtx in JEDEM Bildabschnitt gestrichen, Main bleibt; Gegenprobe: ist es das einzige H.264, bleibt alles stehen");
ok(/TON = \{ maxBitrate: 128_000, priority: 'high' \}/.test(code) && /dtx: false, red: true, forceStereo: true, audioPreset: TON/.test(code)
&& /SPIEL_OBEN = \{[^}]*priority: 'medium'/.test(code),
"Ton vor Bild: Opus 128 kbit Stereo ohne Sendepause, mit Redundanz und HÖHERER Netzpriorität als das Spiel");
}
melde(`${geprueft} Pruefungen, ${fehler} Fehler`);
melde(fehler === 0 ? "ALLES IN ORDNUNG" : "NICHT IN ORDNUNG");
process.exit(fehler === 0 ? 0 : 1);