forked from livekit/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivekit_ingress.proto
162 lines (140 loc) · 4.3 KB
/
livekit_ingress.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
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 Ingress {
// Create a new Ingress
rpc CreateIngress(CreateIngressRequest) returns (IngressInfo);
// Update an existing Ingress. Ingress can only be updated when it's in ENDPOINT_WAITING state.
rpc UpdateIngress(UpdateIngressRequest) returns (IngressInfo);
rpc ListIngress(ListIngressRequest) returns (ListIngressResponse);
rpc DeleteIngress(DeleteIngressRequest) returns (IngressInfo);
}
message CreateIngressRequest {
IngressInput input_type = 1;
// User provided identifier for the ingress
string name = 2;
// room to publish to
string room_name = 3;
// publish as participant
string participant_identity = 4;
// name of publishing participant (used for display only)
string participant_name = 5;
IngressAudioOptions audio = 6;
IngressVideoOptions video = 7;
}
enum IngressInput {
RTMP_INPUT = 0;
// FILE_INPUT = 1;
// SRT_INPUT = 2;
// URL_INPUT = 3;
}
message IngressAudioOptions {
string name = 1;
TrackSource source = 2;
oneof encoding_options {
IngressAudioEncodingPreset preset = 3;
IngressAudioEncodingOptions options = 4;
}
}
message IngressVideoOptions {
string name = 1;
TrackSource source = 2;
oneof encoding_options {
IngressVideoEncodingPreset preset = 3;
IngressVideoEncodingOptions options = 4;
}
}
enum IngressAudioEncodingPreset {
OPUS_STEREO_96KBPS = 0; // OPUS, 2 channels, 96kbps
OPUS_MONO_64KBS = 1; // OPUS, 1 channel, 64kbps
}
enum IngressVideoEncodingPreset {
H264_720P_30FPS_3_LAYERS = 0; // 1280x720, 30fps, 1700kbps main layer, 3 layers total
H264_1080P_30FPS_3_LAYERS = 1; // 1980x1080, 30fps, 3000kbps main layer, 3 layers total
H264_540P_25FPS_2_LAYERS = 2; // 960x540, 25fps, 600kbps main layer, 2 layers total
H264_720P_30FPS_1_LAYER = 3; // 1280x720, 30fps, 1700kbps, no simulcast
H264_1080P_30FPS_1_LAYER = 4; // 1980x1080, 30fps, 3000kbps, no simulcast
}
message IngressAudioEncodingOptions {
// desired audio codec to publish to room
AudioCodec audio_codec = 1;
uint32 bitrate = 2;
bool disable_dtx = 3;
uint32 channels = 4;
}
message IngressVideoEncodingOptions {
// desired codec to publish to room
VideoCodec video_codec = 1;
double frame_rate = 2;
// simulcast layers to publish, when empty, should usually be set to layers at 1/2 and 1/4 of the dimensions
repeated VideoLayer layers = 3;
}
message IngressInfo {
string ingress_id = 1;
string name = 2;
string stream_key = 3;
string url = 4;
// for RTMP input, it'll be a rtmp:// URL
// for FILE input, it'll be a http:// URL
// for SRT input, it'll be a srt:// URL
IngressInput input_type = 5;
IngressAudioOptions audio = 6;
IngressVideoOptions video = 7;
string room_name = 8;
string participant_identity = 9;
string participant_name = 10;
bool reusable = 11;
IngressState state = 12; // Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth)
// NEXT_ID: 13
}
message IngressState {
enum Status {
ENDPOINT_INACTIVE = 0;
ENDPOINT_BUFFERING = 1;
ENDPOINT_PUBLISHING = 2;
ENDPOINT_ERROR = 3;
}
Status status = 1;
string error = 2; // Error/non compliance description if any
InputVideoState video = 3;
InputAudioState audio = 4;
string room_id = 5; // ID of the current/previous room published to
int64 started_at = 7;
int64 ended_at = 8;
repeated TrackInfo tracks = 6;
}
message InputVideoState {
string mime_type = 1;
// uint32 bitrate = 2;
uint32 width = 3;
uint32 height = 4;
uint32 framerate = 5;
}
message InputAudioState {
string mime_type = 1;
// uint32 bitrate = 2;
uint32 channels = 3;
uint32 sample_rate = 4;
}
message UpdateIngressRequest {
string ingress_id = 1;
string name = 2;
string room_name = 3;
string participant_identity = 4;
string participant_name = 5;
IngressAudioOptions audio = 6;
IngressVideoOptions video = 7;
}
message ListIngressRequest {
// when blank, lists all ingress endpoints
string room_name = 1;
}
message ListIngressResponse {
repeated IngressInfo items = 1;
}
message DeleteIngressRequest {
string ingress_id = 1;
}