egressClient how skip saving json file, only store...
# ask-ai
c
egressClient how skip saving json file, only store ogg, mp4 files
t
Thanks for reaching out, Cao. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To configure the
egressClient
to skip saving the JSON file and only store OGG and MP4 files, follow these steps: 1. Disable the JSON Manifest: Set the
disable_manifest
field to
true
in your
EncodedFileOutput
configuration. This prevents the generation of the JSON manifest file.
Copy code
fileOutput := &livekit.EncodedFileOutput{
    FileType: livekit.EncodedFileType_OGG,  // or livekit.EncodedFileType_MP4 for MP4
    Filepath: "path/to/your/file.{ext}",    // Replace {ext} with the appropriate extension
    DisableManifest: true,                  // This disables the JSON manifest
    Output: &livekit.EncodedFileOutput_S3{  // Replace with the appropriate storage output
        S3: &livekit.S3Upload{
            AccessKey: "your_access_key",
            Secret:    "your_secret_key",
            Bucket:    "your_bucket_name",
            Region:    "your_region",
        },
    },
}
2. Specify File Types: Use
EncodedFileType
to specify the type of file you want to store: ◦ For OGG files:
livekit.EncodedFileType_OGG
◦ For MP4 files:
livekit.EncodedFileType_MP4
1. Configure the Egress Request: Include your file output configuration in the egress request. For example, when using `StartTrackCompositeEgress`:
Copy code
info, err := egressClient.StartTrackCompositeEgress(ctx, &livekit.TrackCompositeEgressRequest{
    RoomName:     roomName,
    AudioTrackId: audioTrack.Sid,
    VideoTrackId: videoTrack.Sid,
    Output: &livekit.TrackCompositeEgressRequest_File{
        File: fileOutput,  // Replace with your EncodedFileOutput instance
    },
})
Let me know if you need further assistance!