enough-match-43171
12/17/2025, 4:56 PMtall-airline-16756
12/17/2025, 4:56 PMtall-airline-16756
12/17/2025, 4:56 PMenough-match-43171
12/17/2025, 4:59 PMreq = api.RoomCompositeEgressRequest(
room_name=self.room_name,
layout="grid",
audio_only=False,
preset=api.EncodingOptionsPreset.H264_720P_30,
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath=filepath,
s3=api.S3Upload(
bucket=os.getenv("EGRESS_AWS_BUCKET_NAME"),
region=os.getenv("EGRESS_AWS_REGION"),
access_key=os.getenv("EGRESS_AWS_ACCESS_KEY_ID"),
secret=os.getenv("EGRESS_AWS_SECRET_ACCESS_KEY"),
),
)
],
)
what is the gcp equivalent to thistall-airline-16756
12/17/2025, 4:59 PMfile_outputs with s3 for MP4. For GCP, replace the s3 block with a gcp block using GCPUpload and pass the service account JSON as a string plus the target bucket. Example Python snippet:
import json
from livekit import api
# read your GCP service account key JSON
with open("credentials.json", "r") as f:
credentials_json = f.read()
req = api.RoomCompositeEgressRequest(
room_name=self.room_name,
layout="grid",
audio_only=False,
preset=api.EncodingOptionsPreset.H264_720P_30,
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath=filepath,
gcp=api.GCPUpload(
credentials=credentials_json, # full JSON string from service account key
bucket="my-meetings-bucket",
),
)
],
)
Key points:
• credentials must contain the full service account JSON (string).
• bucket is the GCS bucket name.
• Ensure the service account has Storage Object Creator permissions for the bucket.
Would you like the equivalent REST (curl) or Go example as well?enough-match-43171
12/17/2025, 5:00 PMcredentials
So that means i need to read the credentials from the file and then stringify it first or is it expecting the file pathtall-airline-16756
12/17/2025, 5:00 PMGCPUpload.credentials field expects the full service-account JSON content as a string (not a file path). Read the JSON file and pass its contents.
Short Python example:
with open("credentials.json", "r") as f:
credentials_json = f.read()
req = api.RoomCompositeEgressRequest(
...,
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath=filepath,
gcp=api.GCPUpload(
credentials=credentials_json,
bucket="my-meetings-bucket",
),
)
],
)
Make sure the service account has Storage Object Creator permission on the target bucket. Would you like a curl or Go example too?