Stream auf 60 FPS + 8 Mbps Bitrate angehoben
- getDisplayMedia: frameRate ideal 60, 1920x1080 - WebRTC Sender: maxFramerate 60, maxBitrate 8 Mbps pro Viewer-PC Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3f9b446f27
commit
2ee36789b2
3 changed files with 45 additions and 33 deletions
File diff suppressed because one or more lines are too long
2
web/dist/index.html
vendored
2
web/dist/index.html
vendored
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gaming Hub</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎮</text></svg>" />
|
||||
<script type="module" crossorigin src="/assets/index-BW2laH1p.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-C3FFX5uU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CcoMcI3c.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -197,6 +197,18 @@ export default function StreamingTab({ data }: { data: any }) {
|
|||
}
|
||||
};
|
||||
|
||||
// Boost encoding: 60 fps + higher bitrate for smooth video
|
||||
const videoSender = pc.getSenders().find(s => s.track?.kind === 'video');
|
||||
if (videoSender) {
|
||||
const params = videoSender.getParameters();
|
||||
if (!params.encodings || params.encodings.length === 0) {
|
||||
params.encodings = [{}];
|
||||
}
|
||||
params.encodings[0].maxFramerate = 60;
|
||||
params.encodings[0].maxBitrate = 8_000_000; // 8 Mbps
|
||||
videoSender.setParameters(params).catch(() => {});
|
||||
}
|
||||
|
||||
// Single offer (no onnegotiationneeded — tracks already added above)
|
||||
pc.createOffer()
|
||||
.then(offer => pc.setLocalDescription(offer))
|
||||
|
|
@ -350,7 +362,7 @@ export default function StreamingTab({ data }: { data: any }) {
|
|||
|
||||
try {
|
||||
const stream = await navigator.mediaDevices.getDisplayMedia({
|
||||
video: true,
|
||||
video: { frameRate: { ideal: 60 }, width: { ideal: 1920 }, height: { ideal: 1080 } },
|
||||
audio: true,
|
||||
});
|
||||
localStreamRef.current = stream;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue