Can I set the startBitrate for a video track when ...
# ask-ai
l
Can I set the startBitrate for a video track when publishing it using js sdk?
t
Thanks for reaching out, Pratham. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The LiveKit JS SDK does not provide a direct option to set a custom
startBitrate
when publishing a video track. However, for SVC codecs like VP9 and AV1, LiveKit automatically sets the start bitrate to 70% of the target bitrate. This helps avoid the issue where the bitrate starts very low and increases slowly over time. For other codecs or if you need custom control over the start bitrate, this feature is not explicitly supported in the SDK's current video encoding options. The configurable parameters include
maxBitrate
,
maxFramerate
, and
degradationPreference
. If you need further assistance or have a specific use case, let me know, and I can escalate this to a specialist for more detailed guidance. Sources: src/room/track/LocalVideoTrack.ts
l
and what about VP8 codec?
t
Hey there! I totally understand you're looking to fine-tune the video bitrate in the LiveKit JS SDK. Right now, the SDK doesn't offer a direct way to set a custom
startBitrate
for VP8 specifically. Their automatic optimization is mainly focused on SVC codecs like VP9 and AV1, where they set the start bitrate to about 70% of the target to help with initial video quality. With VP8, you've got some flexibility with
maxBitrate
and
maxFramerate
, but setting the exact
startBitrate
isn't something you can do directly in the SDK right now. If you're looking for more specific advice or want to explore some workarounds, I'm totally here to help! I can definitely reach out to our tech specialists and get you some more detailed guidance. Just let me know what you're trying to achieve, and we'll figure it out together! Sources: src/room/track/LocalVideoTrack.ts
l
If I'm using a VP8 codec and set a max bitrate of 4 mbps. How does LiveKit handles the start bitrate?
t
Hey there! Let me break down something cool about video quality that might help you. When you're using advanced video codecs like VP9 or AV1, LiveKit has a smart trick to make sure your video looks great right from the start. Here's the deal: If you set a maximum bitrate of 4 Mbps, we automatically bump up the initial video quality. Instead of starting super blurry and slowly improving, we jump in with a clearer picture. • Start bitrate = 4 Mbps × 0.7 = 2.8 Mbps We do this using a little technical magic with the
x-google-start-bitrate
parameter, which basically means you'll get a crisp, clear video from the moment your stream begins. No more waiting for things to look good! Sources: livekit-android-test/src/test/java/io/livekit/android/room/SdpMungingTest.k... | src/room/track/LocalVideoTrack.ts | CHANGELOG.md
l
If I'm using a VP8 codec specifically and set a max bitrate of 4 mbps. How does LiveKit handles the start bitrate?
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!