cuddly-crowd-48028
08/26/2025, 1:18 PMtall-airline-16756
08/26/2025, 1:18 PMtall-airline-16756
08/26/2025, 1:18 PMoutput field in RoomCompositeEgressRequest is a oneof field, which means you can only set one of its options (file, stream, or segments) at a time. You can’t assign a value directly to the output field itself.
To fix this, just pick one of these specific output fields to set:
• For File Output: Use the file field and fill in details like file type and path.
• For Stream Output: Use the stream field and provide the streaming protocol and URLs.
• For Segmented File Output: Use the segments field, which works well for HLS or similar setups.
Or, if you want to include multiple outputs in one request, you can use the newer file_outputs, stream_outputs, or segment_outputs fields.
If you’d like, I’m happy to share some examples or help you troubleshoot further—just let me know! Sources: livekit-protocol/livekit/protocol/egress.pyi | livekit/livekit_egress.pb.go | Universal Egresscuddly-crowd-48028
08/26/2025, 2:12 PMtall-airline-16756
08/26/2025, 2:13 PMSTART_RECORDING console signal that’s needed. When you call the StartRoomCompositeEgress API, the egress recorder opens a headless Chrome instance with a URL that includes things like the LiveKit server URL and an access token. But the recording will only kick off once the template page logs START_RECORDING to the console.
Here’s how you can fix it:
1. Make sure your custom template calls EgressHelper.startRecording() so it sends out that START_RECORDING console log.
2. Try using the test-template subcommand in the LiveKit CLI to preview and debug your egress template before you start recording.
3. Double-check that the headless Chrome instance can actually load the page at the URL it’s given, including all the parameters like server URL, token, and layout.
4. Take a look at the egress logs and metrics for any connection hiccups, page load problems, or errors during track subscription that might stop the page from loading and sending that important signal.
If you do see the START_RECORDING signal but recording still isn’t starting, it’s a good idea to confirm that the egress service is connected to the LiveKit room and has subscribed to the media tracks. Feel free to reach out if you want me to help you troubleshoot further! Sources: Custom Recording Template | LiveKit Docs | cmd/lk/egress.go | Egress & Recording | livekit/livekit_composite | DeepWikicuddly-crowd-48028
08/26/2025, 3:53 PMtall-airline-16756
08/26/2025, 3:54 PMoutput field in RoomCompositeEgressRequest is deprecated and shouldn’t be used anymore. Instead, try using the plural fields like file_outputs, stream_outputs, or segment_outputs to set up your output.
Here’s the right way to create a recording request with the Python SDK:
from livekit import api
req = api.RoomCompositeEgressRequest(
room_name=ctx.room.name,
audio_only=True,
file_outputs=[api.EncodedFileOutput(
file_type=api.EncodedFileType.OGG,
filepath="livekit/my-room-test.ogg",
s3=api.S3Upload(
bucket="your-s3-bucket",
region="your-s3-region",
access_key="your-access-key",
secret="your-secret-key",
),
)]
)
Make sure you’re using the latest version of the Python SDK to keep things running smoothly. If you have any more questions or need a hand, just let me know! Sources: Universal Egress | livekit/livekit_egress.pb.go | Session recording and transcripts | LiveKit Docs | Session recording and transcripts | LiveKit Docscuddly-crowd-48028
08/26/2025, 4:13 PMtall-airline-16756
08/26/2025, 4:14 PMcuddly-crowd-48028
08/26/2025, 4:16 PMfile_outputs field and the LiveKit Egress service expecting the deprecated output field <cite/>.
## The Root Issue
The LiveKit protocol supports both the new file_outputs array field and the deprecated singular `file`/`output` field for backward compatibility [1](#0-0) . However, your Egress service appears to be running an older version that only recognizes the deprecated fields.
## How the Field Migration Works
The Egress service handles both field formats through backward compatibility logic [2](#0-1) . When file_outputs is empty, it falls back to checking the deprecated file field via the EncodedOutputDeprecated interface.
The protocol definition shows that the old file field is marked as deprecated with [deprecated=true] [3](#0-2) .
## Solutions
### 1. Update Your Egress Service
Your Docker Compose setup is likely running an outdated Egress service version. Update to a newer version that supports the file_outputs field.
### 2. Use Both Fields (Temporary Workaround)
Several SDKs use both the new and deprecated fields simultaneously for compatibility [4](#0-3) . You can set both file_outputs=[file_output] and the deprecated file=file_output field.
### 3. Rust SDK Approach
The Rust SDK explicitly sets the deprecated output field to None while using the new fields [5](#0-4) , indicating this is the intended migration path.
## Version Compatibility
The test cases show that both field formats should work [6](#0-5) , but your service version predates the file_outputs support.
Notes
The error "missing or invalid field: output" suggests your Egress service is validating against an older protobuf schema. The solution is primarily updating your service version rather than changing your Python code, as the SDK is correctly using the current API format.
livekit/livekit_composite
livekit/python-sdks/livekit-protocol/livekit/protocol/egress.pyi
segments: SegmentedFileOutput
preset: EncodingOptionsPreset
advanced: EncodingOptions
file_outputs: _containers.RepeatedCompositeFieldContainer[EncodedFileOutput]
stream_outputs: _containers.RepeatedCompositeFieldContainer[StreamOutput]
segment_outputs: _containers.RepeatedCompositeFieldContainer[SegmentedFileOutput]
image_outputs: _containers.RepeatedCompositeFieldContainer[ImageOutput]
webhooks: _containers.RepeatedCompositeFieldContainer[_models.WebhookConfig]
def __init__(self, room_name: _Optional[str] = ..., layout: _Optional[str] = ..., audio_only: bool = ..., audio_mixing: _Optional[_Union[AudioMixing, str]] = ..., video_only: bool = ..., custom_base_url: _Optional[str] = ..., file: _Optional[_Union[EncodedFileOutput, _Mapping]] = ..., stream: _Optional[_Union[StreamOutput, _Mapping]] = ..., segments: _Optional[_Union[SegmentedFileOutput, _Mapping]] = ..., preset: _Optional[_Union[EncodingOptionsPreset, str]] = ..., advanced: _Optional[_Union[EncodingOptions, _Mapping]] = ..., file_outputs: _Optional[_Iterable[_Union[EncodedFileOutput, _Mapping]]] = ..., stream_outputs: _Optional[_Iterable[_Union[StreamOutput, _Mapping]]] = ..., segment_outputs: _Optional[_Iterable[_Union[SegmentedFileOutput, _Mapping]]] = ..., image_outputs: _Optional[ ... (truncated)
class WebEgressRequest(_message.Message):
slots = ("url", "audio_only", "video_only", "await_start_signal", "file", "stream", "segments", "preset", "advanced", "file_outputs", "stream_outputs", "segment_outputs", "image_outputs", "webhooks")
livekit/livekit_composite
livekit/egress/pkg/config/output.go
segments := req.GetSegmentOutputs()
images := req.GetImageOutputs()
// file output
var file *livekit.EncodedFileOutput
switch len(files) {
case 0:
if r, ok := req.(egress.EncodedOutputDeprecated); ok {
file = r.GetFile()
}
case 1:
file = files[0]
default:
return errors.ErrInvalidInput("multiple file outputs")
}
if file != nil {
conf, err := p.getEncodedFileConfig(file)
if err != nil {
livekit/livekit_composite
livekit/python-sdks/livekit-protocol/livekit/protocol/egress.py
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
_globals['DESCRIPTOR']._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto'
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['file']._options = None
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['file']._serialized_options = b'\030\001'
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['stream']._options = None
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['stream']._serialized_options = b'\030\001'
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['segments']._options = None
_globals['_ROOMCOMPOSITEEGRESSREQUEST'].fields_by_name['segments']._serialized_options = b'\030\001'
_globals['_WEBEGRESSREQUEST'].fields_by_name['file']._options = None
_globals['_WEBEGRESSREQUEST'].fields_by_name['file']._serialized_options = b'\030\001'
_globals['_WEBEGRESSREQUEST'].fields_by_name['stream']._options = None
livekit/livekit_composite
livekit/server-sdk-kotlin/src/main/kotlin/io/livekit/server/EgressServiceClient.kt
audioMixing: AudioMixing = AudioMixing.DEFAULT_MIXING
): Call<LivekitEgress.EgressInfo> {
@Suppress("DEPRECATION")
val requestBuilder = LivekitEgress.RoomCompositeEgressRequest.newBuilder()
.setFile(output)
.addFileOutputs(output)
return startRoomCompositeEgressImpl(
requestBuilder,
roomName,
livekit/livekit_composite
livekit/rust-sdks/livekit-api/src/services/egress.rs
options.encoding.into(),
)),
custom_base_url: options.custom_base_url,
file_outputs,
stream_outputs,
segment_outputs,
image_outputs,
output: None, // Deprecated
..Default::default()
},
self.base
.auth_header(VideoGrants { room_record: true, ..Default::default() }, None)?,
)
livekit/livekit_composite
livekit/protocol/egress/types_test.go
)
func TestGetOutputType(t *testing.T) {
roomReq := &livekit.RoomCompositeEgressRequest{
FileOutputs: []*livekit.EncodedFileOutput{
&livekit.EncodedFileOutput{},
},
}
ot := GetOutputType(roomReq)
require.Equal(t, OutputTypeFile, ot)
roomReq = &livekit.RoomCompositeEgressRequest{
Output: &livekit.RoomCompositeEgressRequest_File{
File: &livekit.EncodedFileOutput{},
},
}
ot = GetOutputType(roomReq)
require.Equal(t, OutputTypeFile, ot)
trackReq := &livekit.TrackCompositeEgressRequest{
SegmentOutputs: []*livekit.SegmentedFileOutput{cuddly-crowd-48028
08/26/2025, 4:38 PM