ancient-keyboard-27225
12/08/2025, 6:50 AMtall-airline-16756
12/08/2025, 6:50 AMtall-airline-16756
12/08/2025, 6:51 AMancient-keyboard-27225
12/08/2025, 6:51 AMtall-airline-16756
12/08/2025, 6:52 AMancient-keyboard-27225
12/08/2025, 6:54 AMtall-airline-16756
12/08/2025, 6:55 AMscreen_share track; forcing contentHint to motion with SVC codecs) and that helps. Let’s narrow this down with a few quick checks and a targeted workaround.
Please try these in order and tell me which step changes anything:
1. Confirm the publisher’s Chrome flags/extensions
◦ Disable all Chrome extensions (or test in an Incognito window with extensions off).
◦ In chrome://flags ensure no experimental media flags are enabled that affect capture.
1. Test a direct native getDisplayMedia capture
◦ In the same browser tab, run this in the console to confirm the raw capture is not blank:
navigator.mediaDevices.getDisplayMedia({video:true})
.then(s => { const v = document.createElement('video'); v.autoplay = true; v.srcObject = s; document.body.appendChild(v); })
.catch(e => console.error(e));
• If this is blank, it’s a browser/OS capture issue. If it shows correctly, the problem is after capture (publisher/encoder).
1. Check encoder / SVC interaction
◦ The log shows you force contentHint to motion and mention SVC codecs. Temporarily disable SVC or any custom codec selection in your publisher settings (use default codec negotiation). See if the share renders.
1. Verify track and element wiring
◦ Confirm the received track has a non-empty readyState and that the remote video element’s srcObject is set to the track’s MediaStream. Example checks in console on the receiver:
▪︎ Inspect received track object: track.enabled, track.muted, track.readyState
▪︎ Inspect element: videoElem.srcObject contains tracks and videoElem.play() resolves.
1. Compare SDP/RTCPeerConnection behavior
◦ Capture the publisher and receiver SDP/track info (logs you already have are helpful). If possible paste the lines showing codec negotiation or SVC mentions — I can scan for mismatches.
1. Quick platform checks
◦ Ensure Chrome is updated on both sides.
◦ If the publisher is on a GPU-accelerated device, try disabling hardware acceleration in Chrome temporarily.
Tell me the outcome of step 2 and step 3 first. If capture itself is fine but disabling SVC/fallback codec fixes it, I’ll provide exact code changes to stop forcing SVC or to change the contentHint/codec selection.
Sources: Screen sharing | LiveKit docsancient-keyboard-27225
12/10/2025, 4:41 AMtall-airline-16756
12/10/2025, 4:42 AMLocalVideoTrack shows: source: "screen_share", codec: "vp9", active stream, encodings with scalabilityMode: "L1T3", and currentBitrate: 0. That tells me capture is active but no encoded frames are being sent/decoded (blank on subscribers). Let’s troubleshoot with focused checks and a quick workaround.
Please try these steps in order and tell me results for each:
1. Quick local-preview check (publisher)
• Run in publisher console to confirm capture contains visible frames:
const v = document.createElement('video');
v.autoplay = true;
v.muted = true;
v.srcObject = localVideoTrack.mediaStream;
document.body.appendChild(v);
If this is blank, the problem is capture/Chrome; if it shows video, the problem is post-capture (encoding/transport/subscriber).
1. Disable VP9 / SVC (quick workaround)
• Your track uses VP9 + L1T3 SVC. Force H.264 (no SVC) for the screenshare and retest:
await room.localParticipant.setScreenShareEnabled(true, {
video: { codec: 'h264' }
});
If subscribers see the share after this, it’s a VP9 decode/SVC compatibility issue.
1. Test getDisplayMedia directly (isolates Chrome capture)
• In publisher console:
navigator.mediaDevices.getDisplayMedia({ video: true })
.then(s => { const v = document.createElement('video'); v.autoplay = true; v.srcObject = s; document.body.appendChild(v); })
.catch(console.error);
If this is blank, disable extensions / try Incognito / update Chrome / disable hardware acceleration.
1. Check sender RTCRtpSender stats & currentBitrate
• In publisher console, check sender bytes to confirm frames are encoded:
const sender = localVideoTrack._sender;
sender.getStats().then(s => console.log(s));
Look for outbound-rtp bytesSent/frameRate. If bytesSent stays zero, encoder isn’t producing output.
1. Subscriber-side checks
• On a subscriber that sees blank, confirm the remote track.readyState, and that the video element srcObject contains the track and video.play() resolves. Also inspect chrome://webrtc-internals for inbound-rtp frames received and decoder stats.
1. Short-term mitigations
• If capture preview is fine but subscribers are blank and switching to H.264 fixes it, keep H.264 for screenshare.
• If getDisplayMedia is blank, test Entire Screen vs Tab vs Window: Chrome can black out certain tabs (DRM/enterprise policy).
Tell me results of steps 1 and 2 first (local preview and H.264 test). If you share the sender getStats() outbound-rtp summary or a snippet of any decoder errors from the subscriber console, I’ll recommend the exact code/config change to fix it.
Sources: Screen sharing | LiveKit docs | Managing Video Quality During Network Congestion | WebRTC Codecs Guide - LiveKitancient-keyboard-27225
12/17/2025, 4:55 PMtall-airline-16756
12/17/2025, 4:56 PMawait room.localParticipant.setScreenShareEnabled(true);
This applies LiveKit’s screen-optimized defaults (codec, simulcast, encodings, dynacast) and usually fixes slowness.
2) Prefer H.264 for screen content
• VP9 can be CPU-heavy and SVC may add latency. Force H.264 when publishing if you must create a track:
const localVideoTrack = new LocalVideoTrack(videoTrack, { videoCodec: 'h264' });
await room.localParticipant.publishTrack(localVideoTrack, { simulcast: true });
3) Ensure appropriate encoding params
• Increase bitrate / framerate for screenshare:
await room.localParticipant.publishTrack(localVideoTrack, {
simulcast: true,
videoEncoding: { maxBitrate: 3_000_000, maxFramerate: 30 }
});
Or configure publish defaults on Room to apply globally.
4) Verify capture vs publish
• Confirm capture is fine locally:
const v = document.createElement('video');
v.autoplay = true; v.muted = true; v.srcObject = stream;
document.body.appendChild(v);
If this is smooth, issue is encoding/transport. If this is slow/jerky, it’s a capture/Chrome problem.
5) Reduce CPU/GPU pressure
• Disable VP9/SVC, enable H.264 to use hardware encode.
• Disable other heavy tabs/apps and Chrome extensions.
• Try disabling Chrome hardware acceleration toggle (test both ways).
6) Enable Dynacast / adaptive streaming
• Ensure adaptiveStream: true and Dynacast is enabled so LiveKit only sends needed layers, reducing upstream load.
7) Check sender stats to confirm encoding output
• In publisher console:
const sender = localVideoTrack._sender;
sender.getStats().then(s => console.log(s));
Look for outbound-rtp bytesSent and framesPerSecond. If bytesSent≈0 or fps very low, encoder settings need adjustment.
Tell me the results of:
• Switching to setScreenShareEnabled(true) (step 1), and
• The local preview check (step 4).
If slowness remains, paste the relevant sender.getStats() outbound-rtp lines and I’ll recommend exact encoding values or a config change.
Sources: Screen sharing | LiveKit docs | Codecs and more | LiveKit docs | Configuring the Client SDK for Optimal Video Quality | Bringing Zoom's end-to-end optimizations to WebRTCancient-keyboard-27225
12/18/2025, 12:31 AMtall-airline-16756
12/18/2025, 12:31 AMsetScreenShareEnabled(true) is slow, the bottleneck is in encoding/transport or LiveKit publish settings. Try these targeted tuning steps in order and report which change helps.
1) Force H.264 (hardware encode)
• H.264 is usually hardware-accelerated and lowers CPU/latency vs VP9.
await room.localParticipant.setScreenShareEnabled(true, {
video: { codec: 'h264' }
});
2) Increase encoder bitrate & framerate for screenshare
• Raise max bitrate and framerate so encoder isn’t throttled:
await room.localParticipant.setScreenShareEnabled(true, {
video: { maxBitrate: 3_000_000, maxFramerate: 30 }
});
3) Adjust simulcast / SVC behavior
• If SVC (scalabilityMode) is used and causes encoder overhead, disable SVC by preferring H.264 and enable simulcast instead:
await room.localParticipant.setScreenShareEnabled(true, {
video: { codec: 'h264' },
publishOptions: { simulcast: true }
});
4) Enable Dynacast + adaptiveStream (reduce upstream load)
• Ensure room options use dynacast/adaptive so only active layers are sent:
const room = new Room({ dynacast: true, adaptiveStream: true });
(or enable these in your server/room config if controlled there)
5) Verify sender encoding actually sending frames
• Check outbound stats after publishing:
const sender = localVideoTrack._sender;
sender.getStats().then(s => console.log(s));
Look for outbound-rtp bytesSent, framesPerSecond, and packetsSent. If bytesSent is low, encoder params are still limiting output.
6) Lower CPU load on publisher
• Close other heavy tabs/apps, disable extensions, and test with hardware acceleration toggled in Chrome (try both on/off).
7) If you use custom publish defaults, ensure they aren’t overriding screen defaults
• Check publishDefaults for restrictive encodings/codecs that could throttle screenshare.
8) Short experiment to isolate encoder vs transport
• Publish with very high bitrate/framerate and H.264 to see if perceived slowness goes away. If it improves, reduce to find the lowest acceptable settings.
Tell me results for steps 1–3 and the outbound-rtp `bytesSent`/`framesPerSecond` from step 5. I’ll suggest exact values or a fallback config based on those stats.ancient-keyboard-27225
12/18/2025, 12:34 AMtall-airline-16756
12/18/2025, 12:34 AMsetScreenShareEnabled, here are concise, actionable steps to optimize your manual publish flow (focus: make publish as fast as the local preview).
1) Force H.264 and hardware encoder when creating the LocalVideoTrack
const localVideoTrack = new LocalVideoTrack(videoTrack, { videoCodec: 'h264' });
await room.localParticipant.publishTrack(localVideoTrack, { simulcast: true });
2) Supply explicit video encoding params on publish
await room.localParticipant.publishTrack(localVideoTrack, {
simulcast: true,
videoEncoding: { maxBitrate: 3_000_000, maxFramerate: 30 }
});
3) Disable VP9/SVC temporal layers if present
• If your encodings contain scalabilityMode (e.g. "L1T3"), prefer H.264 and simulcast instead to reduce encoder CPU.
4) Use Dynacast / adaptiveStream so only needed layers are sent
• Ensure room/connection options enable them:
const room = new Room({ dynacast: true, adaptiveStream: true });
5) Confirm sender is encoding and sending frames (diagnose)
• After publish, run:
const sender = localVideoTrack._sender;
sender.getStats().then(stats => console.log(stats));
Look for outbound-rtp: bytesSent increasing and framesPerSecond > 0. If bytesSent ≈ 0, encoder is not producing output.
6) Quick capture-vs-encode test
• If local preview (video element) is smooth but publish is slow:
◦ Try creating a new LocalVideoTrack with same MediaStreamTrack but H.264 and higher bitrate (steps 1–2).
◦ Temporarily close other heavy tabs/apps and test hardware acceleration toggle in Chrome.
7) If you must keep VP9, reduce SVC load
• Lower scalabilityMode (e.g., remove or set to a simpler mode) and increase maxBitrate so encoder can output required frames.
If you want, paste the sender.getStats() outbound-rtp lines (bytesSent, framesPerSecond, packetsSent) after publishing and I’ll recommend exact codec/bitrate/encoding values.