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
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;
}