mediaProcess.proto 1.75 KB
syntax = "proto3";

package mediaProcess;

option go_package = "./golang/avvyprotocol";
option csharp_namespace = "AvvyProtocol";

import "avvyprotocol/base.proto";

service MediaProcess {
    rpc Process(MediaProcessRequest) returns (MediaProcessResponse);
}

message MediaProcessRequest {    
    base.DataList data = 1; // list of input files bytes 
    string fileExt = 2;  // for video and images ca be different. Current realisation: image: [ "jpeg", "png", "heic", "tiff", "bmp", "jpg" ], video: [ "mp4", "webm", "flv", "mov", "3gp" ]. It is important for processing to provide real values.
    string text = 3; // some text which will be placed to the imag eor video
    Parameters parameters = 4; // video or image processing parameters
}

message MediaProcessResponse {
    oneof result {
        MediaList data = 1; // list of result files 
        string error = 2; // or error if have any error at processing
    }    
}

message Parameters {
    oneof value {
        VideoParameters videoParams = 1; 
        ImageParameters imageParams = 2;
    }
}

message VideoParameters {
    int32 width = 1; //default 640
    int32 height = 2;  //default 360
    int32 length = 3; // length (default  180)
    string scaling = 4; // scaling of output video default '16/9'
    string ext = 5; //  extension of output video file (ffmpeg param) default  'mp4'
}

message ImageParameters {
    int32 width = 1; //default 720
    int32 height = 2; //default 405
}


message MediaList { 
    repeated MediaFile files = 1; // list of result media files
}

message MediaFile {
    MediaFileExt fileExt = 1; 
    base.Data thumbnail = 2; // thumbnail for image is aimge less than in data at x times. gif for video. 
    base.Data data = 3;
}

enum MediaFileExt {
    PNG = 0;
    MP4 = 1;
}