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
@@ -104,6 +104,7 @@ export async function getMediaInfoActivity(params: {
originalHeight: info.originalHeight,
duration: info.duration,
bitRate: info.bitRate,
videoBitRate: info.videoBitRate,
frameRate: info.frameRate,
totalFrames: info.totalFrames,
startTimecode: info.startTimecode || '00:00:00:00',
@@ -220,6 +221,8 @@ export interface VideoActivityParams {
videoSpec: PrismaJson.VideoTranscode
duration: number
originalFps: number
hardwareAcceleration?: PrismaJson.HardwareAcceleration
sourceVideoBitrate?: number
}
export async function transcodeVideoActivity(
@@ -262,6 +265,8 @@ export async function transcodeVideoActivity(
height: params.videoSpec.height,
frameRate: targetFps || undefined,
disableAudio,
hardwareAcceleration: params.hardwareAcceleration,
sourceVideoBitrate: params.sourceVideoBitrate,
})
const stat = fs.statSync(outputFile)