We’re using LiveKit Egress for recording interview sessions. We’re seeing an issue where the recorded video is consistently longer than the actual session duration — a 5-minute session produces a ~6-minute video, with the last ~1 minute being a blank/black screen.
Expected: Recording duration matches the session duration.
Actual: Recording has an extra ~1 minute of blank screen appended at the end.
Questions:
-
Is this a known behavior with Egress? Does the recording continue for some buffer period after the room/track ends?
-
Is there a configuration to stop recording immediately when the last participant leaves or the track ends?
-
Or is this something we need to handle on our end (e.g., explicitly calling StopEgress at the right time)?
Any pointers would be helpful.
Trying deleting the room when the last participant is leaving and see if that fixes the issue you are seeing.
Tried deleting the room when the last participant leaves, but it’s still not fixing the issue.
We’re still consistently seeing around ~1 minute of extra blank/black video appended at the end of the recording. Also tried manually stopping egress, but the output still includes that extra buffer.
Any other config or recommended way to force Egress to finalize exactly when the session ends?
How are you starting the egress? Is this auto egress?
egress_api = api.LiveKitAPI()
try:
req = api.RoomCompositeEgressRequest(
room_name=ctx.room.name,
layout=“speaker”,
preset=api.EncodingOptionsPreset.H264_720P_30,
audio_only=False,
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath=f"{file_prefix}.mp4",
gcp=api.GCPUpload(
credentials=gcp_creds,
bucket=bucket_name,
# project_id=gcp_project_id, # if required
),
),
\],
)
yes