acceptable-dream-85180
08/15/2025, 3:14 PMtall-airline-16756
08/15/2025, 3:14 PMtall-airline-16756
08/15/2025, 3:16 PMimport { EgressClient } from 'livekit-server-sdk';
const egressClient = new EgressClient('<LIVEKIT_HOST_URL>', '<API_KEY>', '<API_SECRET>');
const egressInfo = await egressClient.startRoomCompositeEgress(
'my-room',
{
file: {
filepath: 'recordings/watermarked-{room_name}-{time}.mp4',
s3: {
accessKey: '<S3_ACCESS_KEY>',
secret: '<S3_SECRET>',
region: 'us-west-2',
bucket: '<S3_BUCKET_NAME>'
}
}
},
{
layout: 'grid',
customBaseUrl: '<CUSTOM_TEMPLATE_URL>',
encodingOptions: 'H264_720P_30'
}
);
Another option is to create a custom web page with a watermark overlay and then use web egress to capture it. If you want, I’m happy to share more details or examples—just let me know! Sources: packages/livekit-server-sdk/src/EgressClient.ts | Session recording and transcripts | LiveKit Docs | livekit-api/src/services/egress.rs | README.md | Egress examples | LiveKit Docsacceptable-dream-85180
08/15/2025, 3:28 PMtall-airline-16756
08/15/2025, 3:30 PMacceptable-dream-85180
08/15/2025, 3:34 PMtall-airline-16756
08/15/2025, 3:34 PMnpm install
or pnpm install
.
1. Modify the Template:
◦ Add a watermark element inside the main container, like <img src="watermark.png" className="watermark" />
.
◦ Style the watermark with CSS to position it nicely—maybe in the bottom-right corner with a bit of opacity.
1. Prepare the Watermark Image:
◦ Pop your watermark image (for example, watermark.png
) into the public
folder of your project.
1. Test the Template Locally:
◦ Give your template a quick test using the LiveKit CLI command lk egress test-template
to see how it looks.
1. Deploy the Template:
◦ Once you’re happy, deploy your updated template to a hosting service like Vercel or AWS S3.
◦ Make sure your template is available through a public URL.
1. Configure Egress to Use the Custom Template:
◦ Finally, set the custom_base_url
to point to your deployed template URL when you start the Room Composite Egress.
If you get stuck or want a hand with any step, just let me know—I’m here to help!