use of com.aws.iot.edgeconnectorforkvs.videouploader.VideoUploader in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class EdgeConnectorForKVSService method startHistoricalVideoUploading.
private void startHistoricalVideoUploading(EdgeConnectorForKVSConfiguration configuration, long startTime, long endTime) throws InterruptedException {
log.info("Start uploading video between " + startTime + " and " + endTime + " for stream " + configuration.getKinesisVideoStreamName());
VideoUploader videoUploader = generateVideoUploader(configuration);
Date dStartTime = new Date(startTime);
Date dEndTime = new Date(endTime);
boolean isUploadingFinished = false;
do {
try {
videoUploader.uploadHistoricalVideo(dStartTime, dEndTime, new StatusChangedCallBack(), new UploadCallBack(dStartTime, configuration));
isUploadingFinished = true;
} catch (Exception ex) {
// Log error and retry historical uploading process
log.error("Failed to upload historical videos: {}", ex.getMessage());
}
} while (retryOnFail && !isUploadingFinished);
}
Aggregations