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
|
|
@ -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