I want to upload a spatial video to S3 and should be able to view that on VisionPro. Now I tried to upload a MOV format file that has spatial video metadata and opens in spatial view. But when I used the S3 link and opened that video, it just opens as a normal MOV and lost it’s spatial capabilities. Now, I need a script that can upload the video as it is to S3, so when fetched it holds all of it’s properties.
Here is a small snippet of what I tried:
if (!videoExists) {
console.log('Uploading video to S3 with uploadId:', uploadId);
const uploadParams = {
Bucket: S3_BUCKET_NAME as string,
Key: fileName,
Body: (file as any).stream(),
ContentType: file.type,
};
const upload = new Upload({
client: s3Client,
params: uploadParams,
leavePartsOnError: false,
queueSize: 4,
partSize: 5 * 1024 * 1024,
});
upload.on('httpUploadProgress', (progress) => {
const loaded = progress.loaded ?? 0;
const total = progress.total ?? 1;
const percentCompleted = Math.round((loaded * 100) / total);
uploadProgress[uploadId] = percentCompleted;
console.log(`Progress for uploadId ${uploadId}: ${percentCompleted}%`);
});
await upload.done();
console.log('Video uploaded to S3 successfully with uploadId:', uploadId);
delete uploadProgress[uploadId];
} else {
console.log('Video already exists in S3, skipping upload');
}