feat(transcode): add hardware-accelerated video transcoding support (#352)

* feat(transcode): add hardware-accelerated video transcoding support

* feat(transcode): use encoder quality modes and source-capped maxrate for video transcode

* fix(transcode): scale max bitrate for downsampled preview framerates

* fix(transcode): propagate videoBitRate in getMediaInfoActivity and update auto description
This commit is contained in:
Yiling-J
2026-08-26 16:28:14 +08:00
committed by GitHub
parent 7b1428bf51
commit 8f55ba1d37
29 changed files with 1272 additions and 11 deletions
+1
View File
@@ -190,6 +190,7 @@ describe('UploadService', () => {
projectId: projectId,
transcode: {
videoStrategy: 'best_match',
hardwareAcceleration: 'off',
sprite: true,
poster: true,
},
+2
View File
@@ -303,9 +303,11 @@ export class UploadService {
const settings = team.settings as PrismaJson.Settings | null
if (isVideo) {
const strategy = settings?.transcode?.videoStrategy || 'best_match'
const hardwareAcceleration = settings?.transcode?.hardwareAcceleration || 'off'
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await new VideoTranscoder(tx as any, asset.id, team.id, projectId)
.setStrategy(strategy)
.setHardwareAcceleration(hardwareAcceleration)
.withSprite()
.withPoster()
.submit()