whats the best configuration I can do for high qua...
# ask-ai
r
whats the best configuration I can do for high quality screensharing? e.g. when using javascript sdk in the browser. What codec, video encoding setting etc.
t
Thanks for reaching out, Goku. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
For high-quality screensharing using the LiveKit JavaScript SDK in the browser, here are the recommended configurations: Codec Selection: • VP9: Recommended for the highest visual quality. It offers better perceptual quality at the same bitrate compared to VP8, but has higher CPU usage for encoding and decoding. • H264: Recommended if you have limited CPU resources, as encoding and decoding are typically done in hardware. High-Quality Screenshare Configuration:
Copy code
{
  dynacast: true,
  publishDefaults: {
    simulcast: true,
    videoCodec: 'vp9', // or 'h264' for hardware acceleration
    screenshareEncoding: VideoPresets.h1080.encoding,
    screenshareSimulcastLayers: [VideoPresets.h720, VideoPresets.h360],
  }
}
Available Screenshare Presets: • h1080fps30: 1920x1080, 5,000,000 bitrate, 30fps - Best for high-quality screensharing • h1080fps15: 1920x1080, 2,500,000 bitrate, 15fps - Good balance of quality and bandwidth • h720fps30: 1280x720, 2,000,000 bitrate, 30fps • h720fps15: 1280x720, 1,500,000 bitrate, 15fps • original: No resizing, 7,000,000 bitrate, 30fps - Highest quality but highest bandwidth VP9 SVC Configuration: When using VP9, the configuration changes significantly:
Copy code
{
  dynacast: true,
  publishDefaults: {
    videoCodec: 'vp9',
    scalabilityMode: 'L1T3', // Special mode for screenshare with VP9
    screenshareEncoding: VideoPresets.h1080.encoding,
    // Note: screenshareSimulcastLayers not used with VP9 SVC
  }
}
Key Recommendations: • Enable dynacast to optimize bandwidth usage by dynamically disabling unused simulcast layers. • Use VP9 for best quality if CPU resources allow, or H264 for hardware acceleration. • Start with the h1080fps30 preset for high-quality screensharing. • Configure simulcast layers (e.g., h720, h360) for adaptive quality based on network conditions. • For VP9, use L1T3 scalability mode specifically for screenshare content. This configuration provides the optimal balance of high visual quality, adaptive streaming capabilities, and efficient bandwidth usage for screensharing applications. Sources: Configuring the Client SDK for Optimal Video Quality | src/room/track/utils.ts