github.com/livekit/protocol@v1.16.1-0.20240517185851-47e4c6bba773/protobufs/livekit_ingress.proto (about)

     1  // Copyright 2023 LiveKit, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package livekit;
    18  
    19  import "livekit_models.proto";
    20  
    21  option go_package = "github.com/livekit/protocol/livekit";
    22  option csharp_namespace = "LiveKit.Proto";
    23  option ruby_package = "LiveKit::Proto";
    24  
    25  service Ingress {
    26    // Create a new Ingress
    27    rpc CreateIngress(CreateIngressRequest) returns (IngressInfo);
    28    // Update an existing Ingress. Ingress can only be updated when it's in ENDPOINT_WAITING state.
    29    rpc UpdateIngress(UpdateIngressRequest) returns (IngressInfo);
    30    rpc ListIngress(ListIngressRequest) returns (ListIngressResponse);
    31    rpc DeleteIngress(DeleteIngressRequest) returns (IngressInfo);
    32  }
    33  
    34  message CreateIngressRequest {
    35    IngressInput input_type = 1;
    36    // Where to pull media from, only for URL input type
    37    string url = 9;
    38    // User provided identifier for the ingress
    39    string name = 2;
    40    // room to publish to
    41    string room_name = 3;
    42    // publish as participant
    43    string participant_identity = 4;
    44    // name of publishing participant (used for display only)
    45    string participant_name = 5;
    46    // metadata associated with the publishing participant
    47    string participant_metadata = 10;
    48    // [depreacted ] whether to pass through the incoming media without transcoding, only compatible with some input types. Use `enable_transcoding` instead.
    49    bool bypass_transcoding = 8 [deprecated = true];
    50    // Whether to transcode the ingested media. Only WHIP supports disabling transcoding currently. WHIP will default to transcoding disabled. Replaces `bypass_transcoding. 
    51    optional bool enable_transcoding = 11;
    52    IngressAudioOptions audio = 6;
    53    IngressVideoOptions video = 7;
    54  
    55     // NEXT_ID: 12
    56  }
    57  
    58  enum IngressInput {
    59    RTMP_INPUT = 0;
    60    WHIP_INPUT = 1;
    61    URL_INPUT = 2; // Pull from the provided URL. Only HTTP url are supported, serving either a single media file or a HLS stream
    62    //  FILE_INPUT = 3;
    63    //  SRT_INPUT = 4;
    64  }
    65  
    66  message IngressAudioOptions {
    67    string name = 1;
    68    TrackSource source = 2;
    69    oneof encoding_options {
    70      IngressAudioEncodingPreset preset = 3;
    71      IngressAudioEncodingOptions options = 4;
    72    }
    73  }
    74  
    75  message IngressVideoOptions {
    76    string name = 1;
    77    TrackSource source = 2;
    78    oneof encoding_options {
    79      IngressVideoEncodingPreset preset = 3;
    80      IngressVideoEncodingOptions options = 4;
    81    }
    82  }
    83  
    84  enum IngressAudioEncodingPreset {
    85    OPUS_STEREO_96KBPS = 0;    // OPUS, 2 channels, 96kbps
    86    OPUS_MONO_64KBS = 1;       // OPUS, 1 channel, 64kbps
    87  }
    88  
    89  enum IngressVideoEncodingPreset {
    90    H264_720P_30FPS_3_LAYERS = 0;                 // 1280x720,  30fps, 1900kbps main layer, 3 layers total
    91    H264_1080P_30FPS_3_LAYERS = 1;                // 1980x1080, 30fps, 3500kbps main layer, 3 layers total
    92    H264_540P_25FPS_2_LAYERS = 2;                 //  960x540,  25fps, 1000kbps  main layer, 2 layers total
    93    H264_720P_30FPS_1_LAYER = 3;                  // 1280x720,  30fps, 1900kbps, no simulcast
    94    H264_1080P_30FPS_1_LAYER = 4;                 // 1980x1080, 30fps, 3500kbps, no simulcast
    95    H264_720P_30FPS_3_LAYERS_HIGH_MOTION = 5;     // 1280x720,  30fps, 2500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content
    96    H264_1080P_30FPS_3_LAYERS_HIGH_MOTION = 6;    // 1980x1080, 30fps, 4500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content
    97    H264_540P_25FPS_2_LAYERS_HIGH_MOTION = 7;     //  960x540,  25fps, 1300kbps  main layer, 2 layers total, higher bitrate for high motion, harder to encode content
    98    H264_720P_30FPS_1_LAYER_HIGH_MOTION = 8;      // 1280x720,  30fps, 2500kbps, no simulcast, higher bitrate for high motion, harder to encode content
    99    H264_1080P_30FPS_1_LAYER_HIGH_MOTION = 9;     // 1980x1080, 30fps, 4500kbps, no simulcast, higher bitrate for high motion, harder to encode content
   100  }
   101  
   102  message IngressAudioEncodingOptions {
   103    // desired audio codec to publish to room
   104    AudioCodec audio_codec = 1;
   105    uint32 bitrate = 2;
   106    bool disable_dtx = 3;
   107    uint32 channels = 4;
   108  }
   109  
   110  message IngressVideoEncodingOptions {
   111    // desired codec to publish to room
   112    VideoCodec video_codec = 1;
   113    double frame_rate = 2; 
   114    // simulcast layers to publish, when empty, should usually be set to layers at 1/2 and 1/4 of the dimensions
   115    repeated VideoLayer layers = 3;
   116  }
   117  
   118  message IngressInfo {
   119    string ingress_id = 1;
   120    string name = 2;
   121    string stream_key = 3;
   122    string url = 4; // URL to point the encoder to for push (RTMP, WHIP), or location to pull media from for pull (URL)
   123    // for RTMP input, it'll be a rtmp:// URL
   124    // for FILE input, it'll be a http:// URL
   125    // for SRT input, it'll be a srt:// URL
   126    IngressInput input_type = 5;
   127    bool bypass_transcoding = 13 [deprecated = true];
   128    optional bool enable_transcoding = 15;
   129    IngressAudioOptions audio = 6;
   130    IngressVideoOptions video = 7;
   131    string room_name = 8;
   132    string participant_identity = 9;
   133    string participant_name = 10;
   134    string participant_metadata = 14;
   135    bool reusable = 11;
   136    IngressState state = 12; // Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth)
   137  
   138    // NEXT_ID: 16
   139  }
   140  
   141  message IngressState {
   142    enum Status {
   143      ENDPOINT_INACTIVE = 0;
   144      ENDPOINT_BUFFERING = 1;
   145      ENDPOINT_PUBLISHING = 2;
   146      ENDPOINT_ERROR = 3;
   147      ENDPOINT_COMPLETE = 4;
   148    }
   149  
   150    Status status = 1;
   151    string error = 2; // Error/non compliance description if any
   152    InputVideoState video = 3;
   153    InputAudioState audio = 4;
   154    string room_id = 5; // ID of the current/previous room published to
   155    int64 started_at = 7;
   156    int64 ended_at = 8;
   157    int64 updated_at = 10;
   158    string resource_id = 9;
   159    repeated TrackInfo tracks = 6;
   160  
   161    // next ID: 11
   162  }
   163  
   164  message InputVideoState {
   165    string mime_type = 1;
   166    uint32 average_bitrate = 2;
   167    uint32 width = 3;
   168    uint32 height = 4;
   169    double framerate = 5;
   170  }
   171  
   172  message InputAudioState {
   173    string mime_type = 1;
   174    uint32 average_bitrate = 2;
   175    uint32 channels = 3;
   176    uint32 sample_rate = 4;
   177  }
   178  
   179  message UpdateIngressRequest {
   180    string ingress_id = 1;
   181    string name = 2;
   182    string room_name = 3;
   183    string participant_identity = 4;
   184    string participant_name = 5;
   185    string participant_metadata = 9;
   186    optional bool bypass_transcoding = 8 [deprecated = true];
   187    optional bool enable_transcoding = 10;
   188    IngressAudioOptions audio = 6;
   189    IngressVideoOptions video = 7;
   190  
   191    // NEXT_ID: 11
   192  }
   193  
   194  message ListIngressRequest {
   195    // when blank, lists all ingress endpoints
   196    string room_name = 1;  // (optional, filter by room name)
   197    string ingress_id = 2; // (optional, filter by ingress ID)
   198  }
   199  
   200  message ListIngressResponse {
   201    repeated IngressInfo items = 1;
   202  }
   203  
   204  message DeleteIngressRequest {
   205    string ingress_id = 1;
   206  }