Repository navigation
Expand file tree
/
Copy pathmodels.go
More file actions
393 lines (368 loc) · 22.8 KB
/
Copy pathmodels.go
File metadata and controls
393 lines (368 loc) · 22.8 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
package lambda_go_sdk
type RemotionOptions struct {
EnableCancellation bool `json:"enableCancellation"`
ServeUrl string `json:"serveUrl" validate:"required"`
FunctionName string `json:"functionName" validate:"required"`
RendererFunctionName string `json:"rendererFunctionName"`
Region string `json:"region" validate:"required"`
InputProps interface{} `json:"inputProps"`
Composition string `json:"composition" validate:"required"`
Codec string `json:"codec"`
ImageFormat string `json:"imageFormat"`
Crf int `json:"crf"`
EnvVariables interface{} `json:"envVariables"`
Metadata interface{} `json:"metadata"`
JpegQuality int `json:"jpegQuality"`
MaxRetries int `json:"maxRetries"`
Privacy string `json:"privacy"`
ColorSpace string `json:"colorSpace"`
LogLevel string `json:"logLevel"`
FrameRange interface{} `json:"frameRange"`
OutName interface{} `json:"outName"`
SeparateAudioTo interface{} `json:"separateAudioTo"`
TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
ChromiumOptions interface{} `json:"chromiumOptions"`
Scale int `json:"scale"`
EveryNthFrame int `json:"everyNthFrame"`
NumberOfGifLoops int `json:"numberOfGifLoops"`
ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
Concurrency *int `json:"concurrency"`
Chunks [][2]int `json:"chunks"`
DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
Muted bool `json:"muted"`
PreferLossless bool `json:"preferLossless"`
Overwrite bool `json:"overwrite"`
ForcePathStyle bool `json:"forcePathStyle"`
AudioBitrate interface{} `json:"audioBitrate"`
VideoBitrate interface{} `json:"videoBitrate"`
EncodingBufferSize interface{} `json:"encodingBufferSize"`
EncodingMaxRate interface{} `json:"encodingMaxRate"`
Webhook interface{} `json:"webhook"`
ForceHeight interface{} `json:"forceHeight"`
ForceFps interface{} `json:"forceFps"`
ForceDurationInFrames interface{} `json:"forceDurationInFrames"`
OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`
MediaCacheSizeInBytes interface{} `json:"mediaCacheSizeInBytes"`
PreferredEffectBackend string `json:"preferredEffectBackend"`
OffthreadVideoThreads interface{} `json:"offthreadVideoThreads"`
ForceWidth interface{} `json:"forceWidth"`
ApiKey interface{} `json:"apiKey"`
LicenseKey interface{} `json:"licenseKey"`
BucketName interface{} `json:"bucketName"`
AudioCodec interface{} `json:"audioCodec"`
StorageClass interface{} `json:"storageClass"`
ForceBucketName string `json:"forceBucketName"`
Gl string `json:"gl"`
X264Preset interface{} `json:"x264Preset"`
GopSize *int `json:"gopSize"`
ProResBitsPerMacroblock *int `json:"proResBitsPerMacroblock"`
DisableSharedMemoryCapture bool `json:"disableSharedMemoryCapture"`
DeleteAfter *string `json:"deleteAfter"`
IsProduction *bool `json:"isProduction"`
SampleRate int `json:"sampleRate"`
}
// RenderFramesOptions configures a PNG or JPEG image sequence render.
type RenderFramesOptions struct {
ServeUrl string `json:"serveUrl" validate:"required"`
FunctionName string `json:"functionName" validate:"required"`
Region string `json:"region" validate:"required"`
Composition string `json:"composition" validate:"required"`
InputProps interface{} `json:"inputProps"`
ImageFormat string `json:"imageFormat"`
OutputPrefix interface{} `json:"outputPrefix"`
ImageSequencePattern string `json:"imageSequencePattern"`
JpegQuality *int `json:"jpegQuality"`
FrameRange interface{} `json:"frameRange"`
FramesPerLambda *int `json:"framesPerLambda"`
Concurrency *int `json:"concurrency"`
ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
EveryNthFrame int `json:"everyNthFrame"`
EnvVariables interface{} `json:"envVariables"`
Privacy string `json:"privacy"`
ChromiumOptions interface{} `json:"chromiumOptions"`
Scale float64 `json:"scale"`
DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
Overwrite bool `json:"overwrite"`
MaxRetries *int `json:"maxRetries"`
Webhook interface{} `json:"webhook"`
ForceWidth interface{} `json:"forceWidth"`
ForceHeight interface{} `json:"forceHeight"`
ForceFps interface{} `json:"forceFps"`
ForceDurationInFrames interface{} `json:"forceDurationInFrames"`
RendererFunctionName string `json:"rendererFunctionName"`
ForceBucketName string `json:"forceBucketName"`
ForcePathStyle bool `json:"forcePathStyle"`
StorageClass interface{} `json:"storageClass"`
IsProduction *bool `json:"isProduction"`
LicenseKey interface{} `json:"licenseKey"`
LogLevel string `json:"logLevel"`
TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
DeleteAfter *string `json:"deleteAfter"`
OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`
OffthreadVideoThreads interface{} `json:"offthreadVideoThreads"`
MediaCacheSizeInBytes interface{} `json:"mediaCacheSizeInBytes"`
PreferredEffectBackend string `json:"preferredEffectBackend"`
EnableCancellation bool `json:"enableCancellation"`
}
// ImageSequenceOutputPrefix selects a custom bucket or S3-compatible provider.
type ImageSequenceOutputPrefix struct {
BucketName string `json:"bucketName"`
KeyPrefix string `json:"keyPrefix"`
S3OutputProvider interface{} `json:"s3OutputProvider"`
}
type renderInternalOptions struct {
StreamProgress bool `json:"streamProgress"`
EnableCancellation bool `json:"enableCancellation"`
RendererFunctionName *string `json:"rendererFunctionName"`
FramesPerLambda *int `json:"framesPerLambda"`
Composition string `json:"composition" validate:"required"`
ServeUrl string `json:"serveUrl" validate:"required"`
InputProps interface{} `json:"inputProps"`
Type string `json:"type,omitempty"`
Output map[string]interface{} `json:"output"`
Codec *string `json:"codec"`
ProResProfile interface{} `json:"proResProfile"`
PixelFormat interface{} `json:"pixelFormat"`
ImageFormat string `json:"imageFormat"`
Crf *int `json:"crf"`
EnvVariables interface{} `json:"envVariables,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
JpegQuality int `json:"jpegQuality"`
MaxRetries int `json:"maxRetries"`
Privacy string `json:"privacy"`
ColorSpace *string `json:"colorSpace"`
LogLevel string `json:"logLevel"`
FrameRange interface{} `json:"frameRange"`
OutName interface{} `json:"outName"`
SeparateAudioTo interface{} `json:"separateAudioTo"`
TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
ChromiumOptions interface{} `json:"chromiumOptions"`
Scale float64 `json:"scale"`
EveryNthFrame int `json:"everyNthFrame"`
NumberOfGifLoops *int `json:"numberOfGifLoops,omitempty"`
ConcurrencyPerLambda int `json:"concurrencyPerLambda"`
Concurrency *int `json:"concurrency"`
Chunks [][2]int `json:"chunks"`
DownloadBehavior map[string]interface{} `json:"downloadBehavior"`
Muted bool `json:"muted"`
PreferLossless bool `json:"preferLossless"`
ForcePathStyle bool `json:"forcePathStyle"`
Version string `json:"version"`
Overwrite bool `json:"overwrite"`
AudioBitrate interface{} `json:"audioBitrate"`
VideoBitrate interface{} `json:"videoBitrate"`
EncodingBufferSize interface{} `json:"encodingBufferSize"`
EncodingMaxRate interface{} `json:"encodingMaxRate"`
Webhook interface{} `json:"webhook"`
OffthreadVideoCacheSizeInBytes interface{} `json:"offthreadVideoCacheSizeInBytes"`
MediaCacheSizeInBytes interface{} `json:"mediaCacheSizeInBytes"`
PreferredEffectBackend string `json:"preferredEffectBackend"`
OffthreadVideoThreads interface{} `json:"offthreadVideoThreads"`
ForceHeight interface{} `json:"forceHeight"`
ForceWidth interface{} `json:"forceWidth"`
ForceFps interface{} `json:"forceFps"`
ForceDurationInFrames interface{} `json:"forceDurationInFrames"`
ApiKey interface{} `json:"apiKey,omitempty"`
LicenseKey interface{} `json:"licenseKey"`
BucketName interface{} `json:"bucketName"`
AudioCodec interface{} `json:"audioCodec"`
StorageClass interface{} `json:"storageClass"`
ForceBucketName string `json:"forceBucketName,omitempty"`
Gl *string `json:"gl,omitempty"`
X264Preset interface{} `json:"x264Preset"`
GopSize *int `json:"gopSize"`
ProResBitsPerMacroblock *int `json:"proResBitsPerMacroblock"`
DisableSharedMemoryCapture bool `json:"disableSharedMemoryCapture"`
DeleteAfter *string `json:"deleteAfter"`
IsProduction *bool `json:"isProduction"`
SampleRate int `json:"sampleRate"`
}
type RawInvokeResponse struct {
Body string `json:"body"`
Type string `json:"type"`
}
type RemotionRenderResponse struct {
BucketName string `json:"bucketName"`
RenderId string `json:"renderId"`
Type string `json:"type"`
Message string `json:"message,omitempty"`
Stack string `json:"stack,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
}
type RenderConfig struct {
RenderId string `json:"renderId" validate:"required"`
BucketName string `json:"bucketName" validate:"required"`
LogLevel string `json:"logLevel"`
FunctionName string `json:"functionName" validate:"required"`
Region string `json:"region" validate:"required"`
DeleteAfter *string `json:"deleteAfter"`
S3OutputProvider interface{} `json:"s3OutputProvider"`
ForcePathStyle bool `json:"forcePathStyle"`
}
type CancelRenderOnLambdaInput struct {
RenderId string `json:"renderId" validate:"required"`
BucketName string `json:"bucketName" validate:"required"`
Region string `json:"region" validate:"required"`
ForcePathStyle bool `json:"forcePathStyle"`
}
type renderProgressInternalConfig struct {
RenderId string `json:"renderId" validate:"required"`
BucketName string `json:"bucketName" validate:"required"`
Type string `json:"type" validate:"required"`
Version string `json:"version" validate:"required"`
LogLevel string `json:"logLevel" validate:"required"`
}
// GetCompositionsOptions mirrors GetCompositionsOnLambdaInput in @remotion/lambda-client.
type GetCompositionsOptions struct {
ServeUrl string `json:"serveUrl" validate:"required"`
FunctionName string `json:"functionName" validate:"required"`
Region string `json:"region" validate:"required"`
InputProps interface{} `json:"inputProps"`
EnvVariables map[string]string `json:"envVariables"`
ChromiumOptions interface{} `json:"chromiumOptions"`
LogLevel string `json:"logLevel"`
TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
ForceBucketName string `json:"forceBucketName"`
ForcePathStyle bool `json:"forcePathStyle"`
OffthreadVideoCacheSizeInBytes *int `json:"offthreadVideoCacheSizeInBytes"`
MediaCacheSizeInBytes *int `json:"mediaCacheSizeInBytes"`
PreferredEffectBackend string `json:"preferredEffectBackend"`
}
// getCompositionsInternalConfig is the payload the compositions handler expects.
type getCompositionsInternalConfig struct {
Type string `json:"type" validate:"required"`
Version string `json:"version" validate:"required"`
ChromiumOptions interface{} `json:"chromiumOptions"`
LogLevel string `json:"logLevel"`
InputProps *SerializedInputProps `json:"inputProps"`
EnvVariables map[string]string `json:"envVariables"`
TimeoutInMilliseconds int `json:"timeoutInMilliseconds"`
ServeUrl string `json:"serveUrl" validate:"required"`
BucketName *string `json:"bucketName"`
OffthreadVideoCacheSizeInBytes *int `json:"offthreadVideoCacheSizeInBytes"`
MediaCacheSizeInBytes *int `json:"mediaCacheSizeInBytes"`
PreferredEffectBackend string `json:"preferredEffectBackend"`
ForcePathStyle bool `json:"forcePathStyle"`
}
// VideoConfig is one composition returned by getCompositionsOnLambda().
type VideoConfig struct {
Width int `json:"width"`
Height int `json:"height"`
Fps float64 `json:"fps"`
DurationInFrames int `json:"durationInFrames"`
ID string `json:"id"`
DefaultProps map[string]interface{} `json:"defaultProps"`
Props map[string]interface{} `json:"props"`
DefaultCodec *string `json:"defaultCodec"`
DefaultOutName *string `json:"defaultOutName"`
DefaultVideoImageFormat *string `json:"defaultVideoImageFormat"`
DefaultPixelFormat *string `json:"defaultPixelFormat"`
DefaultProResProfile *string `json:"defaultProResProfile"`
DefaultSampleRate *int `json:"defaultSampleRate"`
}
// GetCompositionsResponse is returned by getCompositionsOnLambda().
type GetCompositionsResponse struct {
Compositions []VideoConfig `json:"compositions"`
}
type FileNameAndSize struct {
Name string `json:"name"`
Size int `json:"size"`
}
type TmpDir struct {
Files []FileNameAndSize `json:"files"`
Total int `json:"total"`
}
type FunctionErrorInfo struct {
Type string `json:"type"`
Message string `json:"message"`
Name string `json:"name"`
Stack string `json:"stack"`
Frame *int `json:"frame,omitempty"`
Chunk *int `json:"chunk,omitempty"`
IsFatal bool `json:"isFatal"`
Attempt int `json:"attempt"`
WillRetry bool `json:"willRetry"`
TotalAttempts int `json:"totalAttempts"`
TmpDir *TmpDir `json:"tmpDir,omitempty"`
}
type RenderProgress struct {
OverallProgress float64 `json:"overallProgress"`
Chunks int `json:"chunks"`
Done bool `json:"done"`
EncodingStatus *EncodingStatus `json:"encodingStatus,omitempty"`
Costs *Costs `json:"costs,omitempty"`
RenderId string `json:"renderId"`
RenderMetadata *RenderMetadata `json:"renderMetadata,omitempty"`
OutputFile *string `json:"outputFile,omitempty"`
SeparateAudio *SeparateAudioOutput `json:"separateAudio"`
OutputSequence *ImageSequenceOutput `json:"outputSequence"`
FramesUploaded *int `json:"framesUploaded"`
OutKey *string `json:"outKey,omitempty"`
TimeToFinish *int `json:"timeToFinish,omitempty"`
Errors []FunctionErrorInfo `json:"errors,omitempty"`
FatalErrorEncountered bool `json:"fatalErrorEncountered"`
CurrentTime int64 `json:"currentTime"`
RenderSize int64 `json:"renderSize"`
OutputSizeInBytes *int64 `json:"outputSizeInBytes,omitempty"`
LambdasInvoked int `json:"lambdasInvoked"`
FramesRendered *int `json:"framesRendered,omitempty"`
MostExpensiveFrameRanges []FrameRange `json:"mostExpensiveFrameRanges,omitempty"`
// The error fields are only populated when the Lambda function failed.
// A successful progress response does not include a "type" field.
Type string `json:"type,omitempty"`
Message string `json:"message,omitempty"`
Stack string `json:"stack,omitempty"`
// ErrorMessage is populated from the AWS error document when the invoke
// itself failed (FunctionError is set).
ErrorMessage string `json:"errorMessage,omitempty"`
}
type SeparateAudioOutput struct {
Url string `json:"url"`
BucketName string `json:"bucketName"`
Key string `json:"key"`
SizeInBytes int64 `json:"sizeInBytes"`
}
type ImageSequenceOutput struct {
BucketName string `json:"bucketName"`
KeyPrefix string `json:"keyPrefix"`
ManifestKey string `json:"manifestKey"`
ManifestUrl string `json:"manifestUrl"`
ImageFormat string `json:"imageFormat"`
FrameCount int `json:"frameCount"`
}
type EncodingStatus struct {
FramesEncoded int `json:"framesEncoded"`
}
type Costs struct {
AccruedSoFar float64 `json:"accruedSoFar"`
Currency string `json:"currency"`
DisplayCost string `json:"displayCost"`
Disclaimer string `json:"disclaimer"`
}
type RenderMetadata struct {
TotalFrames int `json:"totalFrames"`
StartedDate int64 `json:"startedDate"`
TotalChunks int `json:"totalChunks"`
EstimatedTotalLambdaInvokations int `json:"estimatedTotalLambdaInvokations"`
EstimatedRenderLambdaInvokations int `json:"estimatedRenderLambdaInvokations"`
CompositionId string `json:"compositionId"`
Codec string `json:"codec"`
Bucket string `json:"bucket"`
}
type FrameRange struct {
Chunk int `json:"chunk"`
TimeInMilliseconds int `json:"timeInMilliseconds"`
FrameRange [2]int `json:"frameRange"`
}
// SerializedInputProps is the serialized form of inputProps sent to the Lambda
// function. When the props fit inline, Type is "payload" and Payload holds the
// JSON string. When the props exceed the inline limit they are uploaded to S3,
// Type is "bucket-url", and Hash/BucketName point to the uploaded object.
type SerializedInputProps struct {
Type string `json:"type"`
Payload string `json:"payload,omitempty"`
Hash string `json:"hash,omitempty"`
BucketName string `json:"bucketName,omitempty"`
}
// PayloadData is kept as an alias for backwards compatibility.
type PayloadData = SerializedInputProps