mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-19 14:16:29 +00:00
feat(settings): redesign video transcoding settings into dedicated cards and rename team AI settings (#441)
* feat(settings): redesign video transcoding settings into dedicated cards and rename team AI settings * feat(settings): rename Video Strategy to MP4 Transcoding with sub-description
This commit is contained in:
+8
-11
@@ -8,23 +8,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
|
||||
### Added
|
||||
|
||||
- **transcode**: Add configurable target resolution ladders (480p, 720p, 1080p, 1440p, 2160p) for MP4 Multi Resolutions transcoding in team settings, with unified resolution matching and lowest-resolution fallback for both MP4 and HLS
|
||||
- **transcode**: Add HLS live streaming support with fMP4/CMAF adaptive bitrate ladders (480p, 720p, 1080p, 1440p, 2160p), configurable in Transcode Settings, with seamless adaptive streaming, auto quality switching, manual resolution selection in the video viewer, and full watermarking support for shared links
|
||||
- **transcode**: Add basic camera RAW image support for popular camera formats (including Sony ARW, Canon CR2/CR3, Nikon NEF, Adobe DNG, Fujifilm RAF, and Panasonic RW2), extracting high-quality embedded JPEG previews and automatically applying camera orientation for fast thumbnail and proxy generation
|
||||
* **transcode**: Add configurable target resolution ladders (480p, 720p, 1080p, 1440p, 2160p) for MP4 Multi Resolutions transcoding in team settings, with unified resolution matching and lowest-resolution fallback for both MP4 and HLS
|
||||
* **transcode**: Add HLS live streaming with fMP4/CMAF adaptive bitrate ladders (480p, 720p, 1080p, 1440p, 2160p), configurable in Transcode Settings, with automatic quality switching, manual resolution selection in the video viewer, seamless rendition switching, and full watermarking support for shared links
|
||||
* **transcode**: Add basic camera RAW image support for popular camera formats (including Sony ARW, Canon CR2/CR3, Nikon NEF, Adobe DNG, Fujifilm RAF, and Panasonic RW2), extracting high-quality embedded JPEG previews and automatically applying camera orientation for fast thumbnail and proxy generation
|
||||
|
||||
### Fixed
|
||||
|
||||
- **settings**: Prevent deselecting the last resolution ladder in MP4 and HLS transcode settings, and ensure rapid consecutive toggles reliably coalesce and preserve all selections
|
||||
- **share**: Fix an issue where videos with HLS enabled could play without watermark on public share links before watermark transcoding completed
|
||||
- **webui**: Fix an issue where legacy portrait video transcodes were mislabeled in download menus and the video player (e.g. "1920p" instead of "1080p") by correctly deriving resolution labels from the long side
|
||||
- **webui**: Fix an issue where the resolution selector in the video seekbar displayed vertical video resolutions by long side (e.g. "Auto (3840p)") instead of standard short side (e.g. "Auto (2160p)")
|
||||
- **webui**: Fix an issue where 480p videos were mislabeled as 360p in the navigation bar and mobile file header download menus
|
||||
- **share**: Fix an issue where public HLS playback and watermarked streams failed to load for shared version stacks and symlinks
|
||||
- **trash**: Fix an issue where the "Empty Trash" confirmation dialog would close immediately instead of showing a loading state while files were being permanently deleted
|
||||
* **webui**: Fix inconsistent video resolution labels across download menus, mobile file headers, and the video player by correctly deriving resolutions from the video's short side, including portrait videos and 480p videos
|
||||
|
||||
* **trash**: Fix an issue where the "Empty Trash" confirmation dialog would close immediately instead of showing a loading state while files were being permanently deleted
|
||||
|
||||
### Changed
|
||||
|
||||
- **webui**: Modernize video player architecture to use native HTML5 video and Hls.js, enabling instant rendition switching when changing resolution and eliminating heavy player wrapper overhead while preserving sub-frame accurate playback and annotations
|
||||
* **settings**: Redesign team Video Transcoding settings with dedicated cards for Transcode Policy, Hardware Acceleration, and FFmpeg Threads, clearly explaining MP4 and HLS playback vs download behavior and storage implications
|
||||
* **settings**: Rename AI Settings group to Team AI Settings in settings navigation
|
||||
|
||||
## [0.4.9] - 2026-09-28
|
||||
|
||||
|
||||
@@ -1,31 +1,77 @@
|
||||
---
|
||||
title: Media Transcoding Settings
|
||||
description: Configure video transcode strategies and preview proxy generation.
|
||||
title: Video Transcoding
|
||||
description: Configure video transcode policies, MP4 and HLS streaming resolutions, hardware acceleration, and FFmpeg threads.
|
||||
---
|
||||
|
||||
High-resolution camera formats and raw media files cannot be rendered natively in web browsers. Shumai transcodes these assets into web-friendly streaming formats in the background.
|
||||
High-resolution camera formats and raw media files cannot be rendered natively in web browsers. Shumai transcodes video assets into web-friendly streaming and preview formats in the background.
|
||||
|
||||
Team Owners can customize video transcoding behavior from the **Team Settings > Video Transcoding** page.
|
||||
|
||||
Regardless of the selected transcoding strategy, Shumai's pipeline will **always** generate at least one lightweight `180p` proxy version of the raw file to ensure fast scrubbing, thumbnail generation, and instant previews.
|
||||
|
||||
---
|
||||
|
||||
## Video Transcode Strategies
|
||||
## Transcode Policy
|
||||
|
||||
Team Owners can select how the transcoding engine handles uploaded files. Shumai evaluates the original file's dimensions against its standard target resolutions (2160p, 1080p, 720p, 540p, and 360p) to determine the output.
|
||||
The **Transcode Policy** card configures both MP4 video transcoding and HLS adaptive streaming.
|
||||
|
||||
### 1. Best Match
|
||||
### Playback and Download Behavior
|
||||
|
||||
- **Behavior**: Shumai checks the longest dimension (width or height) of the uploaded file. It then finds the highest standard resolution that is equal to or smaller than the original file, preventing unnecessary upscaling. If the original video is exceptionally small, it defaults to a minimum target of `360p`.
|
||||
- **Output**: Generates exactly two web-optimized files: the universal `180p` proxy and the single calculated "best match" resolution.
|
||||
- **Use Case**: This is the recommended option. It ensures web compatibility without wasting processing time and storage space on redundant lower-resolution versions.
|
||||
Shumai uses a dual-format strategy for video delivery:
|
||||
|
||||
### 2. Transcode All
|
||||
- **When HLS is disabled**: Both in-browser video playback and file downloads will use the generated MP4 file(s).
|
||||
- **When HLS is enabled**: In-browser video playback uses HLS (HTTP Live Streaming) for smooth, adaptive bitrate playback, while file downloads will use the generated MP4 file(s).
|
||||
|
||||
- **Behavior**: Shumai calculates the "best match" resolution exactly as it does in the previous strategy. However, instead of stopping at one version, it processes the video into the best match _and_ every standard resolution smaller than it.
|
||||
- **Output**: Generates a full cascade of files. For example, if the best match for an upload is `1080p`, Shumai will generate the `180p` proxy, `1080p`, `720p`, `540p`, and `360p` versions.
|
||||
- **Use Case**: Ideal for environments requiring adaptive bitrate streaming, ensuring consistent playback performance across all client devices regardless of varying network conditions.
|
||||
<Warning>
|
||||
**Storage Usage Notice**: Enabling HLS generates multi-bitrate segment files (`.ts` / `.m4s`) and
|
||||
playlist manifests in addition to standard MP4 proxies. This can significantly increase storage
|
||||
consumption on your storage bucket.
|
||||
</Warning>
|
||||
|
||||

|
||||
### MP4 Transcoding
|
||||
|
||||
Generate web-compatible MP4 files for file downloads and standard video playback. Team Owners can select how MP4 transcodes are generated for uploaded files:
|
||||
|
||||
#### 1. Best Match
|
||||
|
||||
- **Behavior**: Shumai checks the longest dimension of the uploaded video and generates a single optimal resolution matching or smaller than the source quality, preventing unnecessary upscaling.
|
||||
- **Output**: Generates the lightweight `180p` proxy and the calculated best-match MP4 file.
|
||||
- **Use Case**: Recommended default. Minimizes processing time and storage space while ensuring universal playback and download compatibility.
|
||||
|
||||
#### 2. Multi Resolutions
|
||||
|
||||
- **Behavior**: Select specific target resolution ladders to generate: `480p`, `720p`, `1080p`, `1440p`, and `2160p`. Resolutions are only generated up to the source video resolution (content is never upscaled).
|
||||
- **Output**: Generates the `180p` proxy plus all selected resolution ladders that do not exceed the source resolution.
|
||||
- **Use Case**: Ideal when users need to download multiple specific resolutions (e.g. 720p for fast sharing and 1080p for review).
|
||||
|
||||
### HLS Streaming
|
||||
|
||||
When **HLS Streaming** is toggled on, Shumai produces an adaptive bitrate HLS package for uploaded videos:
|
||||
|
||||
- **Resolution Ladders**: Configure which resolutions to generate for HLS streaming (`480p`, `720p`, `1080p`, `1440p`, `2160p`). Ladders are only generated up to the original video resolution.
|
||||
- **Player Integration**: The web player will automatically stream via HLS when available, dynamically switching bitrates based on client network bandwidth.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Hardware Acceleration
|
||||
|
||||
To offload encoding workloads from CPUs to GPUs, Shumai supports hardware-accelerated video encoding:
|
||||
|
||||
- **Disabled (Software)**: Uses the standard CPU `libx264` software encoder with Constant Rate Factor (CRF).
|
||||
- **Auto Detect**: Automatically probes and leverages available GPU/hardware acceleration (NVIDIA NVENC, Intel QuickSync, AMD/Intel VA-API, Apple VideoToolbox, Rockchip RKMPP).
|
||||
|
||||
See the [Hardware Transcoding Guide](/configuration/hardware-transcoding) for Docker Compose configuration, GPU passthrough, and driver prerequisites.
|
||||
|
||||
---
|
||||
|
||||
## FFmpeg Threads
|
||||
|
||||
The **FFmpeg Threads** slider controls the maximum number of CPU threads used by FFmpeg during transcoding tasks:
|
||||
|
||||
- **Auto (0)**: FFmpeg automatically selects the optimal thread count based on host CPU core availability.
|
||||
- **Manual (1 - 32)**: Restricts FFmpeg to a fixed number of threads, useful for throttling CPU consumption on shared worker nodes.
|
||||
|
||||
---
|
||||
|
||||
@@ -33,10 +79,4 @@ Team Owners can select how the transcoding engine handles uploaded files. Shumai
|
||||
|
||||
Transcoding is resource-intensive. Depending on your scaling needs, your administrator can run the transcode engine on the main server (Single-Server mode) or delegate tasks to specialized transcoding worker machines (Temporal Worker mode).
|
||||
|
||||
Note: In all modes, the processing machine must have the standard system media utilities (`ffmpeg` and `ffprobe`) installed.
|
||||
|
||||
---
|
||||
|
||||
## Hardware Acceleration
|
||||
|
||||
To offload encoding workloads to GPUs (NVIDIA NVENC, Intel QuickSync, AMD/Intel VA-API, or Rockchip RKMPP), Shumai supports hardware-accelerated transcoding. See the [Hardware Transcoding Guide](/configuration/hardware-transcoding) for Docker Compose configuration, GPU passthrough, and driver prerequisites.
|
||||
In all modes, the processing machine must have system media utilities (`ffmpeg` and `ffprobe`) installed. See the [Temporal Deployment Guide](/configuration/temporal) for setting up distributed transcoding workers.
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"personal_settings": "Personal Settings",
|
||||
"team_settings": "Team Settings",
|
||||
"ai_settings": "AI Settings",
|
||||
"team_ai_settings": "Team AI Settings",
|
||||
"welcome_back": "Welcome Back",
|
||||
"create_account": "Create Account",
|
||||
"select_a_team": "Select a Team",
|
||||
@@ -246,11 +247,18 @@
|
||||
"failed_update_profile": "Failed to update profile",
|
||||
"failed_load_settings": "Failed to load settings.",
|
||||
|
||||
"media_processing": "Media Processing",
|
||||
"media_processing_description": "Manage your team's media transcoding configurations.",
|
||||
"media_processing": "Video Transcoding",
|
||||
"media_processing_description": "Manage your team's video transcoding configurations.",
|
||||
"video_transcoding": "Video Transcoding",
|
||||
"video_transcoding_description": "Manage your team's video transcoding configurations.",
|
||||
"transcode_policy": "Transcode Policy",
|
||||
"transcode_policy_description": "When HLS is disabled, both playback and download use MP4. When HLS is enabled, playback uses HLS streaming while download uses MP4. Note that enabling HLS may significantly increase storage usage.",
|
||||
"transcode_settings": "Transcode Settings",
|
||||
"transcode_description": "Manage your team's media transcoding configurations.",
|
||||
"transcode_description": "Manage your team's video transcoding configurations.",
|
||||
"transcode_strategy_note": "Strategy: We select the best resolution from your list that supports the input quality. Content is never upscaled.",
|
||||
"hardware_acceleration_section_description": "Configure hardware-accelerated video encoding to offload workloads to GPUs, or use CPU software encoding.",
|
||||
"mp4_transcoding": "MP4 Transcoding",
|
||||
"mp4_transcoding_description": "Generate web-compatible MP4 files for file downloads and standard video playback.",
|
||||
"video_strategy": "Video Strategy",
|
||||
"best_match": "Best match",
|
||||
"best_match_description": "Generates a single optimal resolution matching the source quality.",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"personal_settings": "个人设置",
|
||||
"team_settings": "团队设置",
|
||||
"ai_settings": "AI 设置",
|
||||
"team_ai_settings": "团队 AI 设置",
|
||||
"welcome_back": "欢迎回来",
|
||||
"create_account": "创建账户",
|
||||
"select_a_team": "选择团队",
|
||||
@@ -246,11 +247,18 @@
|
||||
"failed_update_profile": "更新个人资料失败",
|
||||
"failed_load_settings": "加载设置失败。",
|
||||
|
||||
"media_processing": "媒体处理",
|
||||
"media_processing_description": "管理团队的媒体转码配置。",
|
||||
"media_processing": "视频转码",
|
||||
"media_processing_description": "管理团队的视频转码配置。",
|
||||
"video_transcoding": "视频转码",
|
||||
"video_transcoding_description": "管理团队的视频转码配置。",
|
||||
"transcode_policy": "转码策略",
|
||||
"transcode_policy_description": "未启用 HLS 时,播放和下载均使用 MP4。启用 HLS 后,播放将使用 HLS 自适应流,而下载使用 MP4。请注意,启用 HLS 可能会显著增加存储空间占用。",
|
||||
"transcode_settings": "转码设置",
|
||||
"transcode_description": "管理团队的媒体转码配置。",
|
||||
"transcode_description": "管理团队的视频转码配置。",
|
||||
"transcode_strategy_note": "策略:我们会从您的列表中选择支持输入质量的最佳分辨率。内容不会被放大。",
|
||||
"hardware_acceleration_section_description": "配置硬件加速视频编码以将工作负载分流至 GPU,或使用 CPU 软件编码。",
|
||||
"mp4_transcoding": "MP4 转码",
|
||||
"mp4_transcoding_description": "生成适用于文件下载和标准视频播放的 Web 兼容 MP4 文件。",
|
||||
"video_strategy": "视频策略",
|
||||
"best_match": "最佳匹配",
|
||||
"best_match_description": "生成与源质量匹配的单一最优分辨率。",
|
||||
|
||||
@@ -593,7 +593,7 @@ export function TeamSettingsPage() {
|
||||
)}
|
||||
>
|
||||
<Film className="w-5 h-5" />
|
||||
{m.media_processing()}
|
||||
{m.video_transcoding()}
|
||||
{activeTab === 'transcode' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
@@ -653,7 +653,7 @@ export function TeamSettingsPage() {
|
||||
{me?.role === 'owner' && (
|
||||
<>
|
||||
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
|
||||
{m.ai_settings()}
|
||||
{m.team_ai_settings()}
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -763,7 +763,7 @@ export function TeamSettingsPage() {
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-foreground">
|
||||
{activeTab === 'general' && m.general_settings()}
|
||||
{activeTab === 'transcode' && m.media_processing()}
|
||||
{activeTab === 'transcode' && m.video_transcoding()}
|
||||
{activeTab === 'quotas' && m.resource_quotas()}
|
||||
{activeTab === 'appearance' && m.appearance_settings()}
|
||||
{activeTab === 'email' && m.email_notifications()}
|
||||
@@ -778,7 +778,7 @@ export function TeamSettingsPage() {
|
||||
</h2>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
{activeTab === 'general' && m.general_settings_description()}
|
||||
{activeTab === 'transcode' && m.transcode_description()}
|
||||
{activeTab === 'transcode' && m.video_transcoding_description()}
|
||||
{activeTab === 'quotas' && m.resource_quotas_description()}
|
||||
{activeTab === 'appearance' && m.appearance_settings_description()}
|
||||
{activeTab === 'email' && m.email_notifications_description()}
|
||||
@@ -926,19 +926,22 @@ export function TeamSettingsPage() {
|
||||
)}
|
||||
|
||||
{activeTab === 'transcode' && (
|
||||
<div className="h-full overflow-y-auto pr-1 pb-8">
|
||||
<div className="h-full overflow-y-auto space-y-6 pr-1 pb-8">
|
||||
{/* Transcode Policy Card */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{m.transcode_settings()}</CardTitle>
|
||||
<CardDescription>
|
||||
<span className="block mb-2">{m.transcode_description()}</span>
|
||||
<span className="block">{m.transcode_strategy_note()}</span>
|
||||
</CardDescription>
|
||||
<CardTitle>{m.transcode_policy()}</CardTitle>
|
||||
<CardDescription>{m.transcode_policy_description()}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
{/* Video Strategy */}
|
||||
<div className="space-y-3">
|
||||
<h3 className="text-lg font-medium">{m.video_strategy()}</h3>
|
||||
{/* MP4 Transcoding */}
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-0.5">
|
||||
<h3 className="text-lg font-medium">{m.mp4_transcoding()}</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{m.mp4_transcoding_description()}
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<div
|
||||
className={cn(
|
||||
@@ -1012,81 +1015,6 @@ export function TeamSettingsPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Hardware Acceleration */}
|
||||
<div className="space-y-3 pt-6 border-t border-border">
|
||||
<h3 className="text-lg font-medium">{m.hardware_acceleration()}</h3>
|
||||
<div className="space-y-3">
|
||||
<div
|
||||
className={cn(
|
||||
'cursor-pointer rounded-lg border p-4 transition-all hover:border-primary',
|
||||
currentHardwareAcceleration === HardwareAcceleration.off
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border',
|
||||
)}
|
||||
onClick={() =>
|
||||
handleHardwareAccelerationChange(HardwareAcceleration.off)
|
||||
}
|
||||
>
|
||||
<div className="font-semibold">{m.hardware_acceleration_off()}</div>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{m.hardware_acceleration_off_description()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={cn(
|
||||
'cursor-pointer rounded-lg border p-4 transition-all hover:border-primary',
|
||||
currentHardwareAcceleration === HardwareAcceleration.auto
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border',
|
||||
)}
|
||||
onClick={() =>
|
||||
handleHardwareAccelerationChange(HardwareAcceleration.auto)
|
||||
}
|
||||
>
|
||||
<div className="font-semibold">{m.hardware_acceleration_auto()}</div>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{m.hardware_acceleration_auto_description()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* FFmpeg Threads */}
|
||||
<div className="space-y-4 pt-6 border-t border-border">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-lg font-medium">{m.ffmpeg_threads()}</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{m.ffmpeg_threads_description()}
|
||||
</p>
|
||||
</div>
|
||||
<span className="font-mono text-sm font-semibold px-2.5 py-1 rounded bg-muted text-foreground border border-border">
|
||||
{currentThreads === 0
|
||||
? m.threads_auto()
|
||||
: m.threads_count({ count: currentThreads })}
|
||||
</span>
|
||||
</div>
|
||||
<div className="pt-2 px-1">
|
||||
<Slider
|
||||
value={[currentThreads]}
|
||||
min={0}
|
||||
max={32}
|
||||
step={1}
|
||||
onValueChange={([val]) => setLocalThreads(val)}
|
||||
onValueCommit={([val]) => {
|
||||
setLocalThreads(val)
|
||||
handleThreadsChange(val)
|
||||
}}
|
||||
/>
|
||||
<div className="flex justify-between text-xs text-muted-foreground mt-2">
|
||||
<span>{m.threads_auto()} (0)</span>
|
||||
<span>16</span>
|
||||
<span>32</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* HLS Streaming */}
|
||||
<div className="space-y-4 pt-6 border-t border-border">
|
||||
<div className="flex items-center justify-between">
|
||||
@@ -1139,6 +1067,86 @@ export function TeamSettingsPage() {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Hardware Acceleration Card */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{m.hardware_acceleration()}</CardTitle>
|
||||
<CardDescription>
|
||||
{m.hardware_acceleration_section_description()}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
<div
|
||||
className={cn(
|
||||
'cursor-pointer rounded-lg border p-4 transition-all hover:border-primary',
|
||||
currentHardwareAcceleration === HardwareAcceleration.off
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border',
|
||||
)}
|
||||
onClick={() => handleHardwareAccelerationChange(HardwareAcceleration.off)}
|
||||
>
|
||||
<div className="font-semibold">{m.hardware_acceleration_off()}</div>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{m.hardware_acceleration_off_description()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={cn(
|
||||
'cursor-pointer rounded-lg border p-4 transition-all hover:border-primary',
|
||||
currentHardwareAcceleration === HardwareAcceleration.auto
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border',
|
||||
)}
|
||||
onClick={() => handleHardwareAccelerationChange(HardwareAcceleration.auto)}
|
||||
>
|
||||
<div className="font-semibold">{m.hardware_acceleration_auto()}</div>
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{m.hardware_acceleration_auto_description()}
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* FFmpeg Threads Card */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<CardTitle>{m.ffmpeg_threads()}</CardTitle>
|
||||
<CardDescription className="mt-1.5">
|
||||
{m.ffmpeg_threads_description()}
|
||||
</CardDescription>
|
||||
</div>
|
||||
<span className="font-mono text-sm font-semibold px-2.5 py-1 rounded bg-muted text-foreground border border-border">
|
||||
{currentThreads === 0
|
||||
? m.threads_auto()
|
||||
: m.threads_count({ count: currentThreads })}
|
||||
</span>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="pt-2 px-1">
|
||||
<Slider
|
||||
value={[currentThreads]}
|
||||
min={0}
|
||||
max={32}
|
||||
step={1}
|
||||
onValueChange={([val]) => setLocalThreads(val)}
|
||||
onValueCommit={([val]) => {
|
||||
setLocalThreads(val)
|
||||
handleThreadsChange(val)
|
||||
}}
|
||||
/>
|
||||
<div className="flex justify-between text-xs text-muted-foreground mt-2">
|
||||
<span>{m.threads_auto()} (0)</span>
|
||||
<span>16</span>
|
||||
<span>32</span>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -519,4 +519,41 @@ describe('TeamSettingsPage Transcode Settings', () => {
|
||||
const lastPatch = patchCalls[patchCalls.length - 1]
|
||||
expect(lastPatch.json.value).toEqual(['1080p', '1440p', '2160p'])
|
||||
})
|
||||
|
||||
it('renders individual cards for Transcode Policy, Hardware Acceleration, and FFmpeg Threads with updated labels', async () => {
|
||||
render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<TeamSettingsPage />
|
||||
</QueryClientProvider>,
|
||||
)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByRole('heading', { level: 2, name: /Video Transcoding/i })).toBeDefined()
|
||||
})
|
||||
|
||||
// Sidebar navigation
|
||||
expect(screen.getByText('Team AI Settings')).toBeDefined()
|
||||
expect(screen.getByRole('button', { name: /Video Transcoding/i })).toBeDefined()
|
||||
|
||||
// Cards
|
||||
expect(screen.getByText('Transcode Policy')).toBeDefined()
|
||||
expect(
|
||||
screen.getByText(
|
||||
'When HLS is disabled, both playback and download use MP4. When HLS is enabled, playback uses HLS streaming while download uses MP4. Note that enabling HLS may significantly increase storage usage.',
|
||||
),
|
||||
).toBeDefined()
|
||||
expect(screen.getByText('Hardware Acceleration')).toBeDefined()
|
||||
expect(screen.getByText('FFmpeg Threads')).toBeDefined()
|
||||
|
||||
// MP4 Transcoding sub-section
|
||||
expect(screen.getByText('MP4 Transcoding')).toBeDefined()
|
||||
expect(
|
||||
screen.getByText(
|
||||
'Generate web-compatible MP4 files for file downloads and standard video playback.',
|
||||
),
|
||||
).toBeDefined()
|
||||
|
||||
// Redundant "Transcode Settings" card title should not be rendered
|
||||
expect(screen.queryByRole('heading', { level: 3, name: 'Transcode Settings' })).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user