I'm working with the LiveKit Server SDK and trying to set the video encoding preset for an Ingress. However, I'm encountering the error:
Object literal may only specify known properties, and 'preset' does not exist in type 'IngressVideoOptions'.
Here's the relevant code snippet:
import {
IngressVideoEncodingPreset,
// ... other imports
} from "livekit-server-sdk";
// ...
options.video = {
source: TrackSource.CAMERA,
preset: IngressVideoEncodingPreset.H264_1080P_30FPS_3_LAYERS,
};
I've verified that the livekit-server-sdk package is up-to-date and the IngressVideoEncodingPreset import seems correct. I have also tried to update my typescript and upated npm install livekit-server-sdk, still the issue persists. Any suggestions on how to fix this error?
Update: It is working with the old version but the new version has these error: on
`if (ingressType === IngressInput.WHIP_INPUT) {
options.bypassTranscoding = true;
} else {
options.video = {
source: TrackSource.CAMERA,
encodingOptions: {
value: IngressVideoEncodingPreset.H264_1080P_30FPS_3_LAYERS,
case: "preset",
},
}
}`
error: Type
'{ source: TrackSource; encodingOptions: { value: IngressVideoEncodingPreset.H264_1080P_30FPS_3_LAYERS; case: "preset"; }; }'
is missing the following properties from type 'IngressVideoOptions': name, equals, clone, fromBinary, and 7 more.
I have tried to add name and it does work, but the other properties seem to be non existing in dependency.
Documentation: https://docs.livekit.io/server-sdk-js/classes/IngressVideoOptions.html
The docs showed an outdated version for livekit-server-sdk 1.x.
The latest major version is 2.x and constructing those options has changed a bit: