``` track = rtc.LocalVideoTrack.create_vide...
# ask-ai
e
Copy code
track = rtc.LocalVideoTrack.create_video_track("screen", self.video_source)
        options = rtc.TrackPublishOptions(
            source=rtc.TrackSource.SOURCE_SCREENSHARE,
            video_encoding=rtc.VideoEncoding(
                max_framerate=self.fps, max_bitrate=3_000_000
            ),
        )
        await self.room.local_participant.publish_track(track, options)
        self._task = asyncio.create_task(self._capture_loop())
will this require livekit egress service ?
✅ 1
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether that snippet (creating and publishing a local screenshare track) requires LiveKit’s egress service. Short answer: no. What your code does • Creates a local video track from a custom source (screenshare). • Sets publishing options (source =
SOURCE_SCREENSHARE
, encoding). • Publishes the track to the room with
publish_track()
. Why egress is not required • Publishing a track to the room is a client-side action handled by the LiveKit client SDK and the SFU. Other participants in the room will receive the screen share without any egress configuration. • The LiveKit egress service is only needed when you want to export media out of the room (record to files like MP4, stream to RTMP, or export tracks for external processing). Since your snippet only publishes into the room, egress is not involved. If you plan to record or stream that screenshare later, tell me: • Whether you want per-participant recordings, a composite room recording, or RTMP streaming. I can then explain the egress options and show the server-side call examples. Sources: Universal Egress | LiveKit, with interactive elements