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
I have found an answer to my question.
Here's what worked for me:
I downgraded my dependencies for
"livekit-client": "^1.15.4",
&"livekit-server-sdk": "^1.2.7",
. Additionally, I importedlivekit-server-sdk/dist
after the downgrade.This approach has effectively resolved the error. I will now attempt to update to the latest versions to see if that resolves the issue permanently. Please give me a few minutes to try this out.