mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 08:19:26 +00:00
feat(transcode): add multi-resolution strategy with configurable ladders and fallback (#438)
* feat(transcode): add multi-resolution strategy with configurable ladders and fallback * feat(settings): show toast on settings update and add manual verification plan to PR template * fix(webui): preserve video resolution and fix 480p label in download dropdowns * fix(webui): display standard short-side resolution for vertical videos in seekbar * fix(webui): fix portrait transcode resolution labeling and serialize settings toggles
This commit is contained in:
@@ -203,13 +203,14 @@ describe('UploadService', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should pass custom transcode.threads from team settings to transcode task', async () => {
|
||||
it('should pass custom transcode.threads and videoResolutions from team settings to transcode task', async () => {
|
||||
await prisma.team.update({
|
||||
where: { id: teamId },
|
||||
data: {
|
||||
settings: {
|
||||
transcode: {
|
||||
videoStrategy: 'all',
|
||||
videoStrategy: 'multi',
|
||||
videoResolutions: ['720p', '1080p'],
|
||||
hardwareAcceleration: 'auto',
|
||||
threads: 12,
|
||||
},
|
||||
@@ -245,7 +246,8 @@ describe('UploadService', () => {
|
||||
expect(workflowTask?.payload).toEqual({
|
||||
projectId: projectId,
|
||||
transcode: {
|
||||
videoStrategy: 'all',
|
||||
videoStrategy: 'multi',
|
||||
videoResolutions: ['720p', '1080p'],
|
||||
hardwareAcceleration: 'auto',
|
||||
threads: 12,
|
||||
sprite: true,
|
||||
|
||||
@@ -334,12 +334,14 @@ export class UploadService {
|
||||
const threads = settings?.transcode?.threads ?? 0
|
||||
if (isVideo) {
|
||||
const strategy = settings?.transcode?.videoStrategy || 'best_match'
|
||||
const videoResolutions = settings?.transcode?.videoResolutions
|
||||
const hardwareAcceleration = settings?.transcode?.hardwareAcceleration || 'off'
|
||||
const hlsEnabled = settings?.transcode?.hlsEnabled ?? false
|
||||
const hlsResolutions = settings?.transcode?.hlsResolutions
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
await new VideoTranscoder(tx as any, asset.id, team.id, projectId)
|
||||
.setStrategy(strategy)
|
||||
.setVideoResolutions(videoResolutions)
|
||||
.setHardwareAcceleration(hardwareAcceleration)
|
||||
.setThreads(threads)
|
||||
.setHls(hlsEnabled, hlsResolutions)
|
||||
|
||||
Reference in New Issue
Block a user