INFO livekit.pub rtc/participant.go:1676 pending t...
# ask-ai
a
INFO livekit.pub rtc/participant.go:1676 pending track added {"room": "0ceacb42d41b4bd89eb941be1c60698c", "roomID": "RM_HzcrDUrw9LKK", "participant": "f0053cb5d4304acfb2c569b848e3fd67", "pID": "PA_Fv6ssKQSfE2C", "remote": false, "trackID": "TR_VSgoRHJ2SurTQy", "track": {"sid": "TR_VSgoRHJ2SurTQy", "type": 1, "width": 3840, "height": 2160, "source": 3, "layers": [{"width": 1280, "height": 720, "bitrate": 1700000}, {"quality": 1, "width": 1920, "height": 1080, "bitrate": 3000000}, {"quality": 2, "width": 3840, "height": 2160, "bitrate": 5000000}], "codecs": [{"mimeType": "video/AV1", "cid": "a1386ba2-4a43-441c-82bf-ab0ada67cd49"}, {"mimeType": "video/vp8"}], "stream": "screen"}, "request": {"cid": "a1386ba2-4a43-441c-82bf-ab0ada67cd49", "type": 1, "width": 3840, "height": 2160, "source": 3, "layers": [{"width": 1280, "height": 720, "bitrate": 1700000}, {"quality": 1, "width": 1920, "height": 1080, "bitrate": 3000000}, {"quality": 2, "width": 3840, "height": 2160, "bitrate": 5000000}], "simulcastCodecs": [{"codec": "AV1", "cid": "a1386ba2-4a43-441c-82bf-ab0ada67cd49"}, {"codec": "vp8"}]}}这是livekit的日志,上面的2160分辨率是用户电脑的分辨率打印,还是实际推流到room的流就是2160分辨率?
t
Thanks for reaching out, 徐旭. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The resolution shown in the "pending track added" log represents the actual stream resolution being sent to the room, not the user's computer resolution. Specifically, it reflects the publishing resolution of the video track, which corresponds to the highest quality layer when simulcast is enabled. This is the resolution being encoded and sent to the room, as defined in the track's publishing settings. Sources: livekit/src/room/options.rs | pkg/rtc/participant.go | Codecs and more | LiveKit Docs | An introduction to WebRTC Simulcast
a
screenShareSimulcastLayers: [VideoPresets.h720, VideoPresets.h1080], screenShareEncoding: ScreenSharePresets.h1080fps30.encoding,即使我设置了这个配置,它依然会将2160分辨率推送到room吗?
t
Hey there! Let me break down how screen sharing resolution works in LiveKit in a way that's super easy to understand. Here's the scoop: • Primary Layer: Think of
screenShareEncoding
like choosing the main quality of your screen share. Set it to 1080p, and that'll be your top-tier resolution. • Simulcast Layers: With
screenShareSimulcastLayers
, you're basically creating backup versions of your screen share at different quality levels. It's like having a few different snapshots, from basic to more detailed. • No Automatic Upscaling: The cool thing is, LiveKit totally respects what you want. If you set your limits, it won't try to be a hero and push a higher resolution than you've specified. So bottom line: if you configure things for 1080p, that's exactly what you'll get – no surprise 4K streams popping up! Sources: src/room/track/options.ts | livekit/src/room/options.rs | An introduction to WebRTC Simulcast
a
INFO livekit.pub rtc/participant.go:1676 pending track added {"room": "d15e7ca0d1a04da68dff162bf17eb2f9", "roomID": "RM_NDuUJadnMDry", "participant": "c62937856829415f834b14707f0d001f", "pID": "PA_gjMhdJqrdzxL", "remote": false, "trackID": "TR_VSURg7uXAJP8CV", "track": {"sid": "TR_VSURg7uXAJP8CV", "type": 1, "width": 3600, "height": 2338, "source": 3, "layers": [{"width": 1109, "height": 720, "bitrate": 1700000}, {"quality": 1, "width": 1663, "height": 1080, "bitrate": 3000000}, {"quality": 2, "width": 3600, "height": 2338, "bitrate": 5000000}], "codecs": [{"mimeType": "video/h264", "cid": "63b7275b-15dc-4b25-bec0-4993e4b4247b"}, {"mimeType": "video/vp8"}], "stream": "screen"}, "request": {"cid": "63b7275b-15dc-4b25-bec0-4993e4b4247b", "type": 1, "width": 3600, "height": 2338, "source": 3, "layers": [{"width": 1109, "height": 720, "bitrate": 1700000}, {"quality": 1, "width": 1663, "height": 1080, "bitrate": 3000000}, {"quality": 2, "width": 3600, "height": 2338, "bitrate": 5000000}], "simulcastCodecs": [{"codec": "h264", "cid": "63b7275b-15dc-4b25-bec0-4993e4b4247b"}, {"codec": "vp8"}]}}为什么livekit日志的分辨率打印和我设置的分辨率不同?实际推流到房间的分辨率是日志中的分辨率吗
t
Hey there! Let me break down something you might have noticed about LiveKit's video resolution – it can look a bit different from what you initially set up, and that's totally normal. Here's the scoop on why this happens: • Adaptive Stream: Think of LiveKit like a smart video buddy that adjusts your stream's resolution on the fly. It looks at things like your video window size, whether the video is even visible, and how your network is doing. • Simulcast Layers: Imagine LiveKit creating multiple "versions" of your video – like high, medium, and low quality. It then picks the best one for each viewer based on their specific situation. • Bandwidth Optimization: It's basically making sure your video looks great without eating up tons of data. If your video window is small or your internet is being a bit sluggish, it'll dial back the resolution to keep things smooth. Bottom line: The resolution in the logs is the real deal – it shows exactly what's being sent to the room, just tweaked to give you the best possible streaming experience. Pretty cool, right? Sources: Bringing Zoom's end-to-end optimizations to WebRTC | Subscribing to tracks | LiveKit Docs | Subscribing to tracks | LiveKit Docs | src/room/track/options.ts | An introduction to WebRTC Simulcast