mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 20:34:28 +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:
@@ -105,6 +105,7 @@ export const assetInfoSchema = z.object({
|
||||
width: z.number(),
|
||||
height: z.number(),
|
||||
size: z.number(),
|
||||
resolution: z.string().optional(),
|
||||
hdr: z.boolean().optional(),
|
||||
}),
|
||||
)
|
||||
@@ -357,6 +358,7 @@ export interface VideoTranscode {
|
||||
width: number
|
||||
height: number
|
||||
size: number
|
||||
resolution?: string
|
||||
hdr?: boolean
|
||||
}
|
||||
|
||||
|
||||
@@ -69,11 +69,30 @@ export const listMembersQuerySchema = z.object({
|
||||
export const VideoTranscodeStrategy = {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
best_match: 'best_match',
|
||||
multi: 'multi',
|
||||
all: 'all',
|
||||
} as const
|
||||
export type VideoTranscodeStrategy =
|
||||
(typeof VideoTranscodeStrategy)[keyof typeof VideoTranscodeStrategy]
|
||||
|
||||
export const VideoResolutionLadder = {
|
||||
r480p: '480p',
|
||||
r720p: '720p',
|
||||
r1080p: '1080p',
|
||||
r1440p: '1440p',
|
||||
r2160p: '2160p',
|
||||
} as const
|
||||
export type VideoResolutionLadder =
|
||||
(typeof VideoResolutionLadder)[keyof typeof VideoResolutionLadder]
|
||||
|
||||
export const DEFAULT_VIDEO_RESOLUTIONS: VideoResolutionLadder[] = [
|
||||
'480p',
|
||||
'720p',
|
||||
'1080p',
|
||||
'1440p',
|
||||
'2160p',
|
||||
]
|
||||
|
||||
export const HardwareAcceleration = {
|
||||
off: 'off',
|
||||
auto: 'auto',
|
||||
@@ -96,6 +115,10 @@ export const updateTeamSettingsRequestSchema = z.union([
|
||||
key: z.literal('transcode.videoStrategy'),
|
||||
value: z.nativeEnum(VideoTranscodeStrategy),
|
||||
}),
|
||||
z.object({
|
||||
key: z.literal('transcode.videoResolutions'),
|
||||
value: z.array(z.nativeEnum(VideoResolutionLadder)),
|
||||
}),
|
||||
z.object({
|
||||
key: z.literal('transcode.hardwareAcceleration'),
|
||||
value: z.nativeEnum(HardwareAcceleration),
|
||||
@@ -126,6 +149,7 @@ export interface TeamAppearanceSettings {
|
||||
export interface TeamSettingsResponse {
|
||||
transcode?: {
|
||||
videoStrategy?: VideoTranscodeStrategy
|
||||
videoResolutions?: VideoResolutionLadder[]
|
||||
hardwareAcceleration?: HardwareAcceleration
|
||||
threads?: number
|
||||
hlsEnabled?: boolean
|
||||
|
||||
Reference in New Issue
Block a user