forked from livekit/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivekit_egress.proto
325 lines (286 loc) · 9.28 KB
/
livekit_egress.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
syntax = "proto3";
package livekit;
import "livekit_models.proto";
option go_package = "github.com/livekit/protocol/livekit";
option csharp_namespace = "LiveKit.Proto";
option ruby_package = "LiveKit::Proto";
service Egress {
// start recording or streaming a room, participant, or tracks
rpc StartRoomCompositeEgress(RoomCompositeEgressRequest) returns (EgressInfo);
rpc StartTrackCompositeEgress(TrackCompositeEgressRequest) returns (EgressInfo);
rpc StartTrackEgress(TrackEgressRequest) returns (EgressInfo);
rpc StartWebEgress(WebEgressRequest) returns (EgressInfo);
// update web composite layout
rpc UpdateLayout(UpdateLayoutRequest) returns (EgressInfo);
// add or remove stream endpoints
rpc UpdateStream(UpdateStreamRequest) returns (EgressInfo);
// list available egress
rpc ListEgress(ListEgressRequest) returns (ListEgressResponse);
// stop a recording or stream
rpc StopEgress(StopEgressRequest) returns (EgressInfo);
}
// composite using a web browser
message RoomCompositeEgressRequest {
string room_name = 1; // required
string layout = 2; // (optional)
bool audio_only = 3; // (default false)
bool video_only = 4; // (default false)
string custom_base_url = 5; // template base url (default https://recorder.livekit.io)
oneof output { // deprecated (use _output fields)
EncodedFileOutput file = 6 [deprecated = true];
StreamOutput stream = 7 [deprecated = true];
SegmentedFileOutput segments = 10 [deprecated = true];
}
oneof options {
EncodingOptionsPreset preset = 8; // (default H264_720P_30)
EncodingOptions advanced = 9; // (optional)
}
repeated EncodedFileOutput file_outputs = 11;
repeated StreamOutput stream_outputs = 12;
repeated SegmentedFileOutput segment_outputs = 13;
}
// record any website
message WebEgressRequest {
string url = 1;
bool audio_only = 2;
bool video_only = 3;
oneof output { // deprecated (use _output fields)
EncodedFileOutput file = 4 [deprecated = true];
StreamOutput stream = 5 [deprecated = true];
SegmentedFileOutput segments = 6 [deprecated = true];
}
oneof options {
EncodingOptionsPreset preset = 7;
EncodingOptions advanced = 8;
}
repeated EncodedFileOutput file_outputs = 9;
repeated StreamOutput stream_outputs = 10;
repeated SegmentedFileOutput segment_outputs = 11;
}
// containerize up to one audio and one video track
message TrackCompositeEgressRequest {
string room_name = 1; // required
string audio_track_id = 2; // (optional)
string video_track_id = 3; // (optional)
oneof output { // deprecated (use _output fields)
EncodedFileOutput file = 4 [deprecated = true];
StreamOutput stream = 5 [deprecated = true];
SegmentedFileOutput segments = 8 [deprecated = true];
}
oneof options {
EncodingOptionsPreset preset = 6; // (default H264_720P_30)
EncodingOptions advanced = 7; // (optional)
}
repeated EncodedFileOutput file_outputs = 11;
repeated StreamOutput stream_outputs = 12;
repeated SegmentedFileOutput segment_outputs = 13;
}
// record tracks individually, without transcoding
message TrackEgressRequest {
string room_name = 1; // required
string track_id = 2; // required
oneof output { // required
DirectFileOutput file = 3;
string websocket_url = 4;
}
}
enum EncodedFileType {
DEFAULT_FILETYPE = 0; // file type chosen based on codecs
MP4 = 1;
OGG = 2;
}
message EncodedFileOutput {
EncodedFileType file_type = 1; // (optional)
string filepath = 2; // see egress docs for templating (default {room_name}-{time})
bool disable_manifest = 6; // disable upload of manifest file (default false)
oneof output {
S3Upload s3 = 3;
GCPUpload gcp = 4;
AzureBlobUpload azure = 5;
AliOSSUpload aliOSS = 7;
}
}
enum SegmentedFileProtocol {
DEFAULT_SEGMENTED_FILE_PROTOCOL = 0;
HLS_PROTOCOL = 1;
}
enum SegmentedFileSuffix {
INDEX = 0;
TIMESTAMP = 1;
}
// Used to generate HLS segments or other kind of segmented output
message SegmentedFileOutput {
SegmentedFileProtocol protocol = 1; // (optional)
string filename_prefix = 2; // (optional)
string playlist_name = 3; // (optional)
uint32 segment_duration = 4; // in seconds (optional)
SegmentedFileSuffix filename_suffix = 10; // (optional, default INDEX)
bool disable_manifest = 8; // disable upload of manifest file (default false)
oneof output { // required
S3Upload s3 = 5;
GCPUpload gcp = 6;
AzureBlobUpload azure = 7;
AliOSSUpload aliOSS = 9;
}
}
message DirectFileOutput {
string filepath = 1; // see egress docs for templating (default {track_id}-{time})
bool disable_manifest = 5; // disable upload of manifest file (default false)
oneof output {
S3Upload s3 = 2;
GCPUpload gcp = 3;
AzureBlobUpload azure = 4;
AliOSSUpload aliOSS = 6;
}
}
message S3Upload {
string access_key = 1;
string secret = 2;
string region = 3;
string endpoint = 4;
string bucket = 5;
bool force_path_style = 6;
map<string, string> metadata = 7;
string tagging = 8;
}
message GCPUpload {
string credentials = 1;
string bucket = 2;
}
message AzureBlobUpload {
string account_name = 1;
string account_key = 2;
string container_name = 3;
}
message AliOSSUpload {
string access_key = 1;
string secret = 2;
string region = 3;
string endpoint = 4;
string bucket = 5;
}
enum StreamProtocol {
DEFAULT_PROTOCOL = 0; // protocol chosen based on urls
RTMP = 1;
}
message StreamOutput {
StreamProtocol protocol = 1; // required
repeated string urls = 2; // required
}
message EncodingOptions {
int32 width = 1; // (default 1920)
int32 height = 2; // (default 1080)
int32 depth = 3; // (default 24)
int32 framerate = 4; // (default 30)
AudioCodec audio_codec = 5; // (default OPUS)
int32 audio_bitrate = 6; // (default 128)
int32 audio_frequency = 7; // (default 44100)
VideoCodec video_codec = 8; // (default H264_MAIN)
int32 video_bitrate = 9; // (default 4500)
double key_frame_interval = 10; // in seconds (default 4s for streaming, segment duration for segmented output, encoder default for files)
}
enum EncodingOptionsPreset {
H264_720P_30 = 0; // 1280x720, 30fps, 3000kpbs, H.264_MAIN / OPUS
H264_720P_60 = 1; // 1280x720, 60fps, 4500kbps, H.264_MAIN / OPUS
H264_1080P_30 = 2; // 1920x1080, 30fps, 4500kbps, H.264_MAIN / OPUS
H264_1080P_60 = 3; // 1920x1080, 60fps, 6000kbps, H.264_MAIN / OPUS
PORTRAIT_H264_720P_30 = 4; // 720x1280, 30fps, 3000kpbs, H.264_MAIN / OPUS
PORTRAIT_H264_720P_60 = 5; // 720x1280, 60fps, 4500kbps, H.264_MAIN / OPUS
PORTRAIT_H264_1080P_30 = 6; // 1080x1920, 30fps, 4500kbps, H.264_MAIN / OPUS
PORTRAIT_H264_1080P_60 = 7; // 1080x1920, 60fps, 6000kbps, H.264_MAIN / OPUS
}
message UpdateLayoutRequest {
string egress_id = 1;
string layout = 2;
}
message UpdateStreamRequest {
string egress_id = 1;
repeated string add_output_urls = 2;
repeated string remove_output_urls = 3;
}
message ListEgressRequest {
string room_name = 1; // (optional, filter by room name)
string egress_id = 2; // (optional, filter by egress ID)
bool active = 3; // (optional, list active egress only)
}
message ListEgressResponse {
repeated EgressInfo items = 1;
}
message StopEgressRequest {
string egress_id = 1;
}
enum EgressStatus {
EGRESS_STARTING = 0;
EGRESS_ACTIVE = 1;
EGRESS_ENDING = 2;
EGRESS_COMPLETE = 3;
EGRESS_FAILED = 4;
EGRESS_ABORTED = 5;
EGRESS_LIMIT_REACHED = 6;
}
message EgressInfo {
string egress_id = 1;
string room_id = 2;
string room_name = 13;
EgressStatus status = 3;
int64 started_at = 10;
int64 ended_at = 11;
string error = 9;
oneof request {
RoomCompositeEgressRequest room_composite = 4;
TrackCompositeEgressRequest track_composite = 5;
TrackEgressRequest track = 6;
WebEgressRequest web = 14;
}
oneof result { // deprecated (use _result fields)
StreamInfoList stream = 7 [deprecated = true];
FileInfo file = 8 [deprecated = true];
SegmentsInfo segments = 12 [deprecated = true];
}
repeated StreamInfo stream_results = 15;
repeated FileInfo file_results = 16;
repeated SegmentsInfo segment_results = 17;
}
message StreamInfoList {
option deprecated = true;
repeated StreamInfo info = 1;
}
message StreamInfo {
enum Status {
ACTIVE = 0;
FINISHED = 1;
FAILED = 2;
}
string url = 1;
int64 started_at = 2;
int64 ended_at = 3;
int64 duration = 4;
Status status = 5;
string error = 6;
}
message FileInfo {
string filename = 1;
int64 started_at = 2;
int64 ended_at = 3;
int64 duration = 6;
int64 size = 4;
string location = 5;
}
message SegmentsInfo {
string playlist_name = 1;
int64 duration = 2;
int64 size = 3;
string playlist_location = 4;
int64 segment_count = 5;
int64 started_at = 6;
int64 ended_at = 7;
}
message AutoTrackEgress {
string filepath = 1; // see docs for templating (default {track_id}-{time})
bool disable_manifest = 5; // disables upload of json manifest file (default false)
oneof output {
S3Upload s3 = 2;
GCPUpload gcp = 3;
AzureBlobUpload azure = 4;
}
}