process method
Future<ConvertEntity<VideoEncodingResultEntity> >
process(
- Map<
String, List< transformers, {VideoTransformation> > - bool? storeMode,
Run a processing job
transformers
is a Map with video id
and list of VideoTransformation
When storeMode
is set to false
, the outputs will only be available for 24 hours.
Example:
...
final videoEncoding = ApiVideoEncoding(options);
final result = await videoEncoding.process({
'video-id-1': [
CutTransformation(
const const Duration(seconds: 10),
length: const Duration(
seconds: 30,
),
)
],
'video-id-2': [
VideoResizeTransformation(const Size(512, 384)),
VideoThumbsGenerateTransformation(10),
]
})
...
Implementation
@override
Future<ConvertEntity<VideoEncodingResultEntity>> process(
Map<String, List<VideoTransformation>> transformers, {
bool? storeMode,
}) async {
final request = createRequest('POST', buildUri('$apiUrl/convert/video/'))
..body = jsonEncode({
'paths': transformToPaths(transformers),
'store': resolveStoreModeParam(storeMode),
});
return ConvertEntity.fromJson(
await resolveStreamedResponse(request.send()),
VideoEncodingResultEntity.fromJson,
);
}