edit the codec in livekit cloud
# ask-ai
r
edit the codec in livekit cloud
t
Thanks for reaching out, Rahul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're interested in editing the codec in LiveKit Cloud! You can easily set your preferred video codec by configuring the
RoomOptions
when connecting to a room. Just set the
videoCodec
parameter within
publishDefaults
to one of the supported codecs: VP8, H.264, VP9, or AV1. Here's a friendly example using the LiveKit JavaScript SDK to help you get started:
Copy code
const roomOpts: RoomOptions = {
  publishDefaults: {
    videoCodec: 'vp9', // Options: 'vp8', 'h264', 'vp9', 'av1'
    scalabilityMode: 'L3T3_KEY', // Required for VP9 and AV1 with SVC
    simulcast: true,
    videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360], // Ignored for VP9/AV1
  },
  dynacast: true,
};

// Connect to the room with these options
await room.connect(url, token, roomOpts);
If you'd like, I can also provide code examples for mobile SDKs like Swift or Android, or even guide you on how to detect codec support at runtime. Just let me know what would be most helpful for you! Sources: Configuring the Client SDK for Optimal Video Quality | WebRTC Codecs Guide - LiveKit | pkg/clientconfiguration/conf.go | Codecs and more | LiveKit Docs | Web Applications & Integration Examples | livekit/livekit_composite | DeepW...
r
I want to disable and enable audio codec
t
Thanks for reaching out! To make sure I fully understand and can assist you better, could you please clarify a few things about your needs for enabling or disabling audio codecs? • Are you aiming to set codecs globally for your LiveKit Cloud project, just for certain rooms, or for individual client connections? • Is your goal to disable specific codecs for compatibility reasons, to improve audio quality, or to manage bandwidth? • Are you working within the LiveKit Cloud dashboard, using server-side API calls, or configuring through the client SDK? Your answers will really help me guide you in the best way possible. Looking forward to your response! Sources: lib/src/options.dart | Codecs and more | LiveKit Docs | livekit/livekit_models.pb.go | pkg/rtc/mediaengine.go