github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/livekit_ingress.proto (about) 1 syntax = "proto3"; 2 3 package livekit; 4 5 import "livekit_models.proto"; 6 7 option go_package = "github.com/livekit/protocol/livekit"; 8 option csharp_namespace = "LiveKit.Proto"; 9 option ruby_package = "LiveKit::Proto"; 10 11 service Ingress { 12 // Create a new Ingress 13 rpc CreateIngress(CreateIngressRequest) returns (IngressInfo); 14 // Update an existing Ingress. Ingress can only be updated when it's in ENDPOINT_WAITING state. 15 rpc UpdateIngress(UpdateIngressRequest) returns (IngressInfo); 16 rpc ListIngress(ListIngressRequest) returns (ListIngressResponse); 17 rpc DeleteIngress(DeleteIngressRequest) returns (IngressInfo); 18 } 19 20 message CreateIngressRequest { 21 IngressInput input_type = 1; 22 // User provided identifier for the ingress 23 string name = 2; 24 // room to publish to 25 string room_name = 3; 26 // publish as participant 27 string participant_identity = 4; 28 // name of publishing participant (used for display only) 29 string participant_name = 5; 30 IngressAudioOptions audio = 6; 31 IngressVideoOptions video = 7; 32 } 33 34 enum IngressInput { 35 RTMP_INPUT = 0; 36 WHIP_INPUT = 1; 37 // FILE_INPUT = 2; 38 // SRT_INPUT = 3; 39 // URL_INPUT = 4; 40 } 41 42 message IngressAudioOptions { 43 string name = 1; 44 TrackSource source = 2; 45 oneof encoding_options { 46 IngressAudioEncodingPreset preset = 3; 47 IngressAudioEncodingOptions options = 4; 48 } 49 } 50 51 message IngressVideoOptions { 52 string name = 1; 53 TrackSource source = 2; 54 oneof encoding_options { 55 IngressVideoEncodingPreset preset = 3; 56 IngressVideoEncodingOptions options = 4; 57 } 58 } 59 60 enum IngressAudioEncodingPreset { 61 OPUS_STEREO_96KBPS = 0; // OPUS, 2 channels, 96kbps 62 OPUS_MONO_64KBS = 1; // OPUS, 1 channel, 64kbps 63 } 64 65 enum IngressVideoEncodingPreset { 66 H264_720P_30FPS_3_LAYERS = 0; // 1280x720, 30fps, 1700kbps main layer, 3 layers total 67 H264_1080P_30FPS_3_LAYERS = 1; // 1980x1080, 30fps, 3000kbps main layer, 3 layers total 68 H264_540P_25FPS_2_LAYERS = 2; // 960x540, 25fps, 600kbps main layer, 2 layers total 69 H264_720P_30FPS_1_LAYER = 3; // 1280x720, 30fps, 1700kbps, no simulcast 70 H264_1080P_30FPS_1_LAYER = 4; // 1980x1080, 30fps, 3000kbps, no simulcast 71 } 72 73 message IngressAudioEncodingOptions { 74 // desired audio codec to publish to room 75 AudioCodec audio_codec = 1; 76 uint32 bitrate = 2; 77 bool disable_dtx = 3; 78 uint32 channels = 4; 79 } 80 81 message IngressVideoEncodingOptions { 82 // desired codec to publish to room 83 VideoCodec video_codec = 1; 84 double frame_rate = 2; 85 // simulcast layers to publish, when empty, should usually be set to layers at 1/2 and 1/4 of the dimensions 86 repeated VideoLayer layers = 3; 87 } 88 89 message IngressInfo { 90 string ingress_id = 1; 91 string name = 2; 92 string stream_key = 3; 93 string url = 4; 94 // for RTMP input, it'll be a rtmp:// URL 95 // for FILE input, it'll be a http:// URL 96 // for SRT input, it'll be a srt:// URL 97 IngressInput input_type = 5; 98 IngressAudioOptions audio = 6; 99 IngressVideoOptions video = 7; 100 string room_name = 8; 101 string participant_identity = 9; 102 string participant_name = 10; 103 bool reusable = 11; 104 IngressState state = 12; // Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth) 105 106 // NEXT_ID: 13 107 } 108 109 message IngressState { 110 enum Status { 111 ENDPOINT_INACTIVE = 0; 112 ENDPOINT_BUFFERING = 1; 113 ENDPOINT_PUBLISHING = 2; 114 ENDPOINT_ERROR = 3; 115 } 116 117 Status status = 1; 118 string error = 2; // Error/non compliance description if any 119 InputVideoState video = 3; 120 InputAudioState audio = 4; 121 string room_id = 5; // ID of the current/previous room published to 122 int64 started_at = 7; 123 int64 ended_at = 8; 124 repeated TrackInfo tracks = 6; 125 } 126 127 message InputVideoState { 128 string mime_type = 1; 129 // uint32 bitrate = 2; 130 uint32 width = 3; 131 uint32 height = 4; 132 uint32 framerate = 5; 133 } 134 135 message InputAudioState { 136 string mime_type = 1; 137 // uint32 bitrate = 2; 138 uint32 channels = 3; 139 uint32 sample_rate = 4; 140 } 141 142 message UpdateIngressRequest { 143 string ingress_id = 1; 144 string name = 2; 145 string room_name = 3; 146 string participant_identity = 4; 147 string participant_name = 5; 148 IngressAudioOptions audio = 6; 149 IngressVideoOptions video = 7; 150 } 151 152 message ListIngressRequest { 153 // when blank, lists all ingress endpoints 154 string room_name = 1; 155 } 156 157 message ListIngressResponse { 158 repeated IngressInfo items = 1; 159 } 160 161 message DeleteIngressRequest { 162 string ingress_id = 1; 163 }