From 3d859a5bf06ce85575d213168df98e6566e45889 Mon Sep 17 00:00:00 2001 From: Milos Pesic Date: Mon, 22 Sep 2025 11:51:39 +0200 Subject: [PATCH] Extending models to support MP3 audio encoding in egress (#1220) Extending models to support MP3 audio encoding in egress --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- livekit/livekit_egress.pb.go | 8 +++- livekit/livekit_egress.twirp.go | 78 ++++++++++++++++----------------- livekit/livekit_models.pb.go | 9 +++- protobufs/livekit_egress.proto | 1 + protobufs/livekit_models.proto | 1 + 5 files changed, 54 insertions(+), 43 deletions(-) diff --git a/livekit/livekit_egress.pb.go b/livekit/livekit_egress.pb.go index a099105..e7a6a9f 100644 --- a/livekit/livekit_egress.pb.go +++ b/livekit/livekit_egress.pb.go @@ -41,6 +41,7 @@ const ( EncodedFileType_DEFAULT_FILETYPE EncodedFileType = 0 // file type chosen based on codecs EncodedFileType_MP4 EncodedFileType = 1 EncodedFileType_OGG EncodedFileType = 2 + EncodedFileType_MP3 EncodedFileType = 3 ) // Enum value maps for EncodedFileType. @@ -49,11 +50,13 @@ var ( 0: "DEFAULT_FILETYPE", 1: "MP4", 2: "OGG", + 3: "MP3", } EncodedFileType_value = map[string]int32{ "DEFAULT_FILETYPE": 0, "MP4": 1, "OGG": 2, + "MP3": 3, } ) @@ -4168,11 +4171,12 @@ const file_livekit_egress_proto_rawDesc = "" + "\x03gcp\x18\x03 \x01(\v2\x12.livekit.GCPUploadH\x00R\x03gcp\x120\n" + "\x05azure\x18\x04 \x01(\v2\x18.livekit.AzureBlobUploadH\x00R\x05azure\x12/\n" + "\x06aliOSS\x18\x06 \x01(\v2\x15.livekit.AliOSSUploadH\x00R\x06aliOSSB\b\n" + - "\x06output*9\n" + + "\x06output*B\n" + "\x0fEncodedFileType\x12\x14\n" + "\x10DEFAULT_FILETYPE\x10\x00\x12\a\n" + "\x03MP4\x10\x01\x12\a\n" + - "\x03OGG\x10\x02*N\n" + + "\x03OGG\x10\x02\x12\a\n" + + "\x03MP3\x10\x03*N\n" + "\x15SegmentedFileProtocol\x12#\n" + "\x1fDEFAULT_SEGMENTED_FILE_PROTOCOL\x10\x00\x12\x10\n" + "\fHLS_PROTOCOL\x10\x01*/\n" + diff --git a/livekit/livekit_egress.twirp.go b/livekit/livekit_egress.twirp.go index e47cfc0..11e3956 100644 --- a/livekit/livekit_egress.twirp.go +++ b/livekit/livekit_egress.twirp.go @@ -2754,7 +2754,7 @@ func (s *egressServer) PathPrefix() string { } var twirpFileDescriptor1 = []byte{ - // 3274 bytes of a gzipped FileDescriptorProto + // 3278 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xc9, 0x73, 0x1b, 0xc7, 0xd5, 0xe7, 0x60, 0xc7, 0xc3, 0xc2, 0x61, 0x93, 0xa2, 0x20, 0xca, 0x9f, 0x25, 0x43, 0x5e, 0x64, 0xda, 0xa6, 0xf8, 0x89, 0xb2, 0x2c, 0xcb, 0x9f, 0xfd, 0x05, 0x24, 0x87, 0x24, 0x6c, 0x90, 0x40, @@ -2922,42 +2922,42 @@ var twirpFileDescriptor1 = []byte{ 0x2e, 0x01, 0x9a, 0xea, 0x2f, 0x12, 0x70, 0xa3, 0x36, 0xa2, 0xce, 0x54, 0xe2, 0x09, 0xbd, 0xcc, 0x28, 0xd7, 0x78, 0x7d, 0x4c, 0x5c, 0xe3, 0xf5, 0x31, 0x79, 0xb9, 0x97, 0x99, 0x98, 0xb7, 0x95, 0xd4, 0xe5, 0xdf, 0x56, 0xc2, 0x4f, 0x1c, 0x3f, 0x4b, 0xc0, 0x2c, 0x5b, 0x9c, 0x50, 0x0e, 0xfc, - 0x8f, 0xef, 0x43, 0x2e, 0x7f, 0x2a, 0x0b, 0xc6, 0xe0, 0x89, 0x03, 0x2d, 0x80, 0xba, 0xa9, 0x6d, - 0xd5, 0xf6, 0x1b, 0x1d, 0x63, 0xab, 0xde, 0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0xc4, 0x44, 0x0f, + 0x26, 0xde, 0x84, 0x06, 0x10, 0xb4, 0x2f, 0x50, 0x90, 0x35, 0xa7, 0x5a, 0x27, 0x4b, 0xb7, 0x63, + 0x79, 0xb2, 0xdf, 0xf1, 0x39, 0xbb, 0x98, 0x7b, 0x4d, 0x0c, 0x14, 0xbe, 0x20, 0x47, 0x3a, 0x1b, + 0xb1, 0x5e, 0xac, 0x6f, 0xfd, 0xf0, 0xde, 0x91, 0x45, 0x8f, 0x47, 0x07, 0x2b, 0x5d, 0x67, 0xf0, + 0x40, 0x0a, 0x3c, 0xf0, 0x5a, 0x90, 0x1e, 0xe1, 0xb7, 0x89, 0x52, 0xc3, 0x3a, 0xc5, 0x5f, 0x89, + 0xbe, 0x32, 0x75, 0xfe, 0x9a, 0x28, 0xcb, 0xf1, 0xd3, 0xa7, 0x9c, 0x70, 0x90, 0xe1, 0x2a, 0x6b, + 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xa9, 0x24, 0x1b, 0x02, 0x2c, 0x00, 0x00, } diff --git a/livekit/livekit_models.pb.go b/livekit/livekit_models.pb.go index 00733a0..d3730e3 100644 --- a/livekit/livekit_models.pb.go +++ b/livekit/livekit_models.pb.go @@ -42,6 +42,7 @@ const ( AudioCodec_DEFAULT_AC AudioCodec = 0 AudioCodec_OPUS AudioCodec = 1 AudioCodec_AAC AudioCodec = 2 + AudioCodec_AC_MP3 AudioCodec = 3 ) // Enum value maps for AudioCodec. @@ -50,11 +51,13 @@ var ( 0: "DEFAULT_AC", 1: "OPUS", 2: "AAC", + 3: "AC_MP3", } AudioCodec_value = map[string]int32{ "DEFAULT_AC": 0, "OPUS": 1, "AAC": 2, + "AC_MP3": 3, } ) @@ -6198,13 +6201,15 @@ const file_livekit_models_proto_rawDesc = "" + "signingKey\"F\n" + "\x14SubscribedAudioCodec\x12\x14\n" + "\x05codec\x18\x01 \x01(\tR\x05codec\x12\x18\n" + - "\aenabled\x18\x02 \x01(\bR\aenabled*/\n" + + "\aenabled\x18\x02 \x01(\bR\aenabled*;\n" + "\n" + "AudioCodec\x12\x0e\n" + "\n" + "DEFAULT_AC\x10\x00\x12\b\n" + "\x04OPUS\x10\x01\x12\a\n" + - "\x03AAC\x10\x02*V\n" + + "\x03AAC\x10\x02\x12\n" + + "\n" + + "\x06AC_MP3\x10\x03*V\n" + "\n" + "VideoCodec\x12\x0e\n" + "\n" + diff --git a/protobufs/livekit_egress.proto b/protobufs/livekit_egress.proto index bebfda3..1630b6e 100644 --- a/protobufs/livekit_egress.proto +++ b/protobufs/livekit_egress.proto @@ -157,6 +157,7 @@ enum EncodedFileType { DEFAULT_FILETYPE = 0; // file type chosen based on codecs MP4 = 1; OGG = 2; + MP3 = 3; } message EncodedFileOutput { diff --git a/protobufs/livekit_models.proto b/protobufs/livekit_models.proto index 74b0f0e..d32f77e 100644 --- a/protobufs/livekit_models.proto +++ b/protobufs/livekit_models.proto @@ -68,6 +68,7 @@ enum AudioCodec { DEFAULT_AC = 0; OPUS = 1; AAC = 2; + AC_MP3 = 3; } enum VideoCodec {