feat(transcode): optimize video operations using ffmpeg http range requests (#393)

* feat(transcode): optimize video operations using ffmpeg http range requests

* fix(transcode): preserve non-retryable errors and ensure mapConcurrent settles on rejection
This commit is contained in:
Yiling-J
2026-09-08 10:17:15 +08:00
committed by GitHub
parent f62df9555a
commit b35c824a27
16 changed files with 675 additions and 151 deletions
+13
View File
@@ -118,6 +118,7 @@ export interface S3Service {
request: S3SignRequest,
) => Promise<{ url: string }>
abortMultipartUpload: (bucket: string, key: string, uploadId: string) => Promise<void>
resolveInput: (bucket: string, key: string) => Promise<string>
}
export class S3StorageService implements S3Service {
@@ -459,6 +460,10 @@ export class S3StorageService implements S3Service {
}),
)
}
async resolveInput(bucket: string, key: string): Promise<string> {
return this.presign(bucket, key, 'GET')
}
}
export class LocalStorageService implements S3Service {
@@ -717,6 +722,14 @@ export class LocalStorageService implements S3Service {
): Promise<void> {
await this.deleteObject(bucket, key)
}
async resolveInput(bucket: string, key: string): Promise<string> {
const filePath = this.getFilePath(bucket, key)
if (fs.existsSync(filePath)) {
return filePath
}
return this.presign(bucket, key, 'GET')
}
}
export function getStorageBackend(): 's3' | 'local' {