Context: subscribers using @livekit/rtc-node server-side need to request a specific simulcast layer for a RemoteTrackPublication. The Rust FFI supports this via SetRemoteTrackPublicationQualityRequest, but the JS-side RemoteTrackPublication class does not expose a public method to invoke it.
Current workaround (broken): reaching into the @internal ffiHandle and dispatching livekitFfiRequest directly:
import { FfiRequest, SetRemoteTrackPublicationQualityRequest, VideoQuality, livekitFfiRequest } from "@livekit/rtc-ffi-bindings";
const handle = (pub as unknown as { ffiHandle: { handle: bigint } }).ffiHandle.handle;
const req = new FfiRequest({
message: {
case: "setRemoteTrackPublicationQuality",
value: new SetRemoteTrackPublicationQualityRequest({ trackPublicationHandle: handle, quality: VideoQuality.HIGH }),
},
});
livekitFfiRequest(req.toBinary());
This throws at runtime: failed to handle request: invalid request: handle not found. The handle from pub.ffiHandle.handle does not match what the Rust handler expects in the publication-handle HashMap.
Request: expose a public method RemoteTrackPublication.setVideoQuality(quality: VideoQuality) that performs the correct FFI dispatch using the right handle. Mirror what Room.LocalParticipant and similar classes already expose.
Use case: hidden server-side subscribers (recorders, transcoders, RTMP republishers) need to request HIGH simulcast layer for downstream encoding instead of accepting LiveKit's default LOW.
Workaround until landed: publish only the high simulcast layer from publishers (disable simulcast). Acceptable for single-subscriber recorder setups; not ideal for multi-bitrate fan-out.
Affected version: @livekit/rtc-node@0.13.27 + @livekit/rtc-ffi-bindings@0.12.52-patch.0
Platform: Cloud Run Linux x64
Context: subscribers using
@livekit/rtc-nodeserver-side need to request a specific simulcast layer for aRemoteTrackPublication. The Rust FFI supports this viaSetRemoteTrackPublicationQualityRequest, but the JS-sideRemoteTrackPublicationclass does not expose a public method to invoke it.Current workaround (broken): reaching into the @internal
ffiHandleand dispatchinglivekitFfiRequestdirectly:This throws at runtime:
failed to handle request: invalid request: handle not found. The handle frompub.ffiHandle.handledoes not match what the Rust handler expects in the publication-handle HashMap.Request: expose a public method
RemoteTrackPublication.setVideoQuality(quality: VideoQuality)that performs the correct FFI dispatch using the right handle. Mirror whatRoom.LocalParticipantand similar classes already expose.Use case: hidden server-side subscribers (recorders, transcoders, RTMP republishers) need to request HIGH simulcast layer for downstream encoding instead of accepting LiveKit's default LOW.
Workaround until landed: publish only the high simulcast layer from publishers (disable simulcast). Acceptable for single-subscriber recorder setups; not ideal for multi-bitrate fan-out.
Affected version: @livekit/rtc-node@0.13.27 + @livekit/rtc-ffi-bindings@0.12.52-patch.0
Platform: Cloud Run Linux x64