how to set video resolution in egress video record...
# ask-ai
f
how to set video resolution in egress video recording
t
Thanks for reaching out, jitendra. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To set the video resolution in egress video recording with LiveKit, you can use the following methods: • Using Presets: You can use predefined presets to set the resolution. For example:
Copy code
{
  "url": "<https://my-page.com>",
  "preset": "PORTRAIT_H264_720P_30",
  "audio_only": false,
  ...
}
This example sets the resolution to 720p in portrait mode. • Using Advanced Options: You can explicitly define the resolution and other parameters. For example:
Copy code
{
  "room_name": "my-room",
  "identity": "participant-to-record",
  "screen_share": false,
  "advanced": {
    "width": 1280,
    "height": 720,
    "framerate": 30,
    "audioCodec": "AAC",
    "audioBitrate": 128,
    "videoCodec": "H264_HIGH",
    "videoBitrate": 5000,
    "keyFrameInterval": 2
  },
  ...
}
This example sets the resolution to 1280x720 pixels. • For Image Outputs (Thumbnails): You can also specify resolution for image outputs. For example:
Copy code
{
  "image_outputs": [
    {
      "capture_interval": 5,
      "width": 1280,
      "height": 720,
      ...
    }
  ]
}
Let me know if you need further assistance! Sources: Egress examples | LiveKit Docs
f
what if i want to do this on localtracks on client side
t
Hey there! Want to control video resolution in LiveKit? No worries, I've got some super easy ways to help you out. You can use handy video presets or set up custom parameters when creating local video tracks - let me walk you through it! • Using Presets in JavaScript:
Copy code
const videoTrack = await createLocalVideoTrack({
  facingMode: 'user',
  resolution: VideoPresets.h720,
});
Check it out - this snippet sets your resolution to a crisp 1280x720 (h720). Pretty neat, right? • Configuring Video Settings When Creating a Room:
Copy code
const room = new Room({
  videoCaptureDefaults: {
    resolution: {
      width: 1280,
      height: 720,
      frameRate: 30,
    },
  }
});
This method lets you get super specific with your resolution and frame rate. Totally customizable! • For Android:
Copy code
val options = LocalVideoTrackOptions(
  captureParams = VideoPreset169.H720.capture
)
For my Android friends, you can use
captureParams
to specify video capture options like resolution using cool presets such as
VideoPreset169.H720
. Need any more help? I'm here for you - just ask! Sources: LocalVideoTrackOptions | captureParams | Codecs and more | LiveKit Docs