Files
ArtPlayer/assets/sample/bbb-thumbnails.vtt
T
糖猫猫andrionzhao 0896841d23 feat: batch video upscaling with folder upload, directory save, and result comparison (#1051)
* feat: support batch video upscaling with folder upload and directory save

- Add multi-file selection and entire folder upload (webkitdirectory)
- Support drag & drop of both files and folders via FileSystemEntry API
- Add save directory picker using File System Access API (showDirectoryPicker)
- Process videos sequentially with per-file progress and status tracking
- Add right-side result list with click-to-compare functionality
- Add per-video duration and total batch duration display
- Add retry button for failed items with error detail display
- Remove auto-play on comparison viewer load
- Fix worker error handling: handle "error" command to reject stale promises
- Fix event listener accumulation in video comparison (AbortController)
- Fix XSS risk by escaping HTML in all innerHTML injections
- Fix URL revocation timing in download to prevent large file truncation
- Extract writeToSaveDirectory and truncateName helpers to reduce duplication
- Add Usage Guide panel explaining single/multiple/folder upload options

Files changed:
  docs/upscaler/index.html  (+1110/-181)
  docs/upscaler/upscaler.js (+110)

* fix: prevent auto-play and resource consumption during upscaling

- Set preload="metadata" on preview and comparison video elements
- Explicitly pause preview video after setting src in showVideoPreview
- Remove preview video seek sync from batch processing progress callbacks
  (was causing continuous decode during upscaling, wasting GPU resources)
- Remove preview video seek sync from retry progress callback
- All videos now require manual play; no background resource usage

* fix: improve upscaled video quality with higher bitrate and codec support

- Raise base bitrate from 2.5 Mbps (25e5) to 8 Mbps (8e6) for standard and
  firefox processors, preventing quality loss when source videos have high
  bitrates (e.g. 720p @ 16.7 Mbps was producing 1440p @ 10 Mbps, smaller
  than the original file)
- Double the bitrate for mediabunny processor (X.n1 * 2) to account for the
  4x pixel increase from 2x upscaling
- Add H.264 Level 5.1 (avc1.640033) and Level 5.2 (avc1.640034) codecs to
  the fallback lists, since Level 4.0 (avc1.640028, ~24.6 Mbps) cannot
  support the higher bitrates for 1440p+ outputs
- Add latencyMode: "quality" to VideoEncoder configs for both standard and
  firefox processors, prioritizing encoding quality over latency (suitable
  for offline processing)

* feat: add video data comparison panel for original vs upscaled metrics

- Add a comparison data table below the file info bar showing 6 metrics:
  Resolution, File Size, Duration, Est. Bitrate, Pixels, Process Time
- Display per-metric change percentage with color-coded indicators:
  green (↑) for improvements, red (↓) for regressions, gray for neutral
- Estimated bitrate calculated from file size × 8 / video duration
- Table renders after both original and upscaled video metadata loads
- Auto-hide panel on reset

* fix: make video data comparison panel full-width and responsive

- Move comparison data table from inside the left column to the full-width
  area below the left/right layout, so it is no longer constrained by the
  comparison viewer column width
- Remove table-fixed colgroup and overflow-x-auto that caused horizontal
  scrolling on smaller screens
- Table now uses w-full auto-layout, displaying all 4 columns (Metric,
  Original, Upscaled, Change) without requiring horizontal scrolling

---------

Co-authored-by: rionzhao <rionzhao@tencent.com>
2026-09-10 17:19:38 +08:00

362 lines
7.0 KiB
WebVTT

WEBVTT
00:00.000 --> 00:05.000
bbb-sprite.jpg#xywh=0,0,128,72
00:05.000 --> 00:10.000
bbb-sprite.jpg#xywh=128,0,128,72
00:10.000 --> 00:15.000
bbb-sprite.jpg#xywh=256,0,128,72
00:15.000 --> 00:20.000
bbb-sprite.jpg#xywh=384,0,128,72
00:20.000 --> 00:25.000
bbb-sprite.jpg#xywh=512,0,128,72
00:25.000 --> 00:30.000
bbb-sprite.jpg#xywh=640,0,128,72
00:30.000 --> 00:35.000
bbb-sprite.jpg#xywh=768,0,128,72
00:35.000 --> 00:40.000
bbb-sprite.jpg#xywh=896,0,128,72
00:40.000 --> 00:45.000
bbb-sprite.jpg#xywh=1024,0,128,72
00:45.000 --> 00:50.000
bbb-sprite.jpg#xywh=1152,0,128,72
00:50.000 --> 00:55.000
bbb-sprite.jpg#xywh=1280,0,128,72
00:55.000 --> 01:00.000
bbb-sprite.jpg#xywh=0,72,128,72
01:00.000 --> 01:05.000
bbb-sprite.jpg#xywh=128,72,128,72
01:05.000 --> 01:10.000
bbb-sprite.jpg#xywh=256,72,128,72
01:10.000 --> 01:15.000
bbb-sprite.jpg#xywh=384,72,128,72
01:15.000 --> 01:20.000
bbb-sprite.jpg#xywh=512,72,128,72
01:20.000 --> 01:25.000
bbb-sprite.jpg#xywh=640,72,128,72
01:25.000 --> 01:30.000
bbb-sprite.jpg#xywh=768,72,128,72
01:30.000 --> 01:35.000
bbb-sprite.jpg#xywh=896,72,128,72
01:35.000 --> 01:40.000
bbb-sprite.jpg#xywh=1024,72,128,72
01:40.000 --> 01:45.000
bbb-sprite.jpg#xywh=1152,72,128,72
01:45.000 --> 01:50.000
bbb-sprite.jpg#xywh=1280,72,128,72
01:50.000 --> 01:55.000
bbb-sprite.jpg#xywh=0,144,128,72
01:55.000 --> 02:00.000
bbb-sprite.jpg#xywh=128,144,128,72
02:00.000 --> 02:05.000
bbb-sprite.jpg#xywh=256,144,128,72
02:05.000 --> 02:10.000
bbb-sprite.jpg#xywh=384,144,128,72
02:10.000 --> 02:15.000
bbb-sprite.jpg#xywh=512,144,128,72
02:15.000 --> 02:20.000
bbb-sprite.jpg#xywh=640,144,128,72
02:20.000 --> 02:25.000
bbb-sprite.jpg#xywh=768,144,128,72
02:25.000 --> 02:30.000
bbb-sprite.jpg#xywh=896,144,128,72
02:30.000 --> 02:35.000
bbb-sprite.jpg#xywh=1024,144,128,72
02:35.000 --> 02:40.000
bbb-sprite.jpg#xywh=1152,144,128,72
02:40.000 --> 02:45.000
bbb-sprite.jpg#xywh=1280,144,128,72
02:45.000 --> 02:50.000
bbb-sprite.jpg#xywh=0,216,128,72
02:50.000 --> 02:55.000
bbb-sprite.jpg#xywh=128,216,128,72
02:55.000 --> 03:00.000
bbb-sprite.jpg#xywh=256,216,128,72
03:00.000 --> 03:05.000
bbb-sprite.jpg#xywh=384,216,128,72
03:05.000 --> 03:10.000
bbb-sprite.jpg#xywh=512,216,128,72
03:10.000 --> 03:15.000
bbb-sprite.jpg#xywh=640,216,128,72
03:15.000 --> 03:20.000
bbb-sprite.jpg#xywh=768,216,128,72
03:20.000 --> 03:25.000
bbb-sprite.jpg#xywh=896,216,128,72
03:25.000 --> 03:30.000
bbb-sprite.jpg#xywh=1024,216,128,72
03:30.000 --> 03:35.000
bbb-sprite.jpg#xywh=1152,216,128,72
03:35.000 --> 03:40.000
bbb-sprite.jpg#xywh=1280,216,128,72
03:40.000 --> 03:45.000
bbb-sprite.jpg#xywh=0,288,128,72
03:45.000 --> 03:50.000
bbb-sprite.jpg#xywh=128,288,128,72
03:50.000 --> 03:55.000
bbb-sprite.jpg#xywh=256,288,128,72
03:55.000 --> 04:00.000
bbb-sprite.jpg#xywh=384,288,128,72
04:00.000 --> 04:05.000
bbb-sprite.jpg#xywh=512,288,128,72
04:05.000 --> 04:10.000
bbb-sprite.jpg#xywh=640,288,128,72
04:10.000 --> 04:15.000
bbb-sprite.jpg#xywh=768,288,128,72
04:15.000 --> 04:20.000
bbb-sprite.jpg#xywh=896,288,128,72
04:20.000 --> 04:25.000
bbb-sprite.jpg#xywh=1024,288,128,72
04:25.000 --> 04:30.000
bbb-sprite.jpg#xywh=1152,288,128,72
04:30.000 --> 04:35.000
bbb-sprite.jpg#xywh=1280,288,128,72
04:35.000 --> 04:40.000
bbb-sprite.jpg#xywh=0,360,128,72
04:40.000 --> 04:45.000
bbb-sprite.jpg#xywh=128,360,128,72
04:45.000 --> 04:50.000
bbb-sprite.jpg#xywh=256,360,128,72
04:50.000 --> 04:55.000
bbb-sprite.jpg#xywh=384,360,128,72
04:55.000 --> 05:00.000
bbb-sprite.jpg#xywh=512,360,128,72
05:00.000 --> 05:05.000
bbb-sprite.jpg#xywh=640,360,128,72
05:05.000 --> 05:10.000
bbb-sprite.jpg#xywh=768,360,128,72
05:10.000 --> 05:15.000
bbb-sprite.jpg#xywh=896,360,128,72
05:15.000 --> 05:20.000
bbb-sprite.jpg#xywh=1024,360,128,72
05:20.000 --> 05:25.000
bbb-sprite.jpg#xywh=1152,360,128,72
05:25.000 --> 05:30.000
bbb-sprite.jpg#xywh=1280,360,128,72
05:30.000 --> 05:35.000
bbb-sprite.jpg#xywh=0,432,128,72
05:35.000 --> 05:40.000
bbb-sprite.jpg#xywh=128,432,128,72
05:40.000 --> 05:45.000
bbb-sprite.jpg#xywh=256,432,128,72
05:45.000 --> 05:50.000
bbb-sprite.jpg#xywh=384,432,128,72
05:50.000 --> 05:55.000
bbb-sprite.jpg#xywh=512,432,128,72
05:55.000 --> 06:00.000
bbb-sprite.jpg#xywh=640,432,128,72
06:00.000 --> 06:05.000
bbb-sprite.jpg#xywh=768,432,128,72
06:05.000 --> 06:10.000
bbb-sprite.jpg#xywh=896,432,128,72
06:10.000 --> 06:15.000
bbb-sprite.jpg#xywh=1024,432,128,72
06:15.000 --> 06:20.000
bbb-sprite.jpg#xywh=1152,432,128,72
06:20.000 --> 06:25.000
bbb-sprite.jpg#xywh=1280,432,128,72
06:25.000 --> 06:30.000
bbb-sprite.jpg#xywh=0,504,128,72
06:30.000 --> 06:35.000
bbb-sprite.jpg#xywh=128,504,128,72
06:35.000 --> 06:40.000
bbb-sprite.jpg#xywh=256,504,128,72
06:40.000 --> 06:45.000
bbb-sprite.jpg#xywh=384,504,128,72
06:45.000 --> 06:50.000
bbb-sprite.jpg#xywh=512,504,128,72
06:50.000 --> 06:55.000
bbb-sprite.jpg#xywh=640,504,128,72
06:55.000 --> 07:00.000
bbb-sprite.jpg#xywh=768,504,128,72
07:00.000 --> 07:05.000
bbb-sprite.jpg#xywh=896,504,128,72
07:05.000 --> 07:10.000
bbb-sprite.jpg#xywh=1024,504,128,72
07:10.000 --> 07:15.000
bbb-sprite.jpg#xywh=1152,504,128,72
07:15.000 --> 07:20.000
bbb-sprite.jpg#xywh=1280,504,128,72
07:20.000 --> 07:25.000
bbb-sprite.jpg#xywh=0,576,128,72
07:25.000 --> 07:30.000
bbb-sprite.jpg#xywh=128,576,128,72
07:30.000 --> 07:35.000
bbb-sprite.jpg#xywh=256,576,128,72
07:35.000 --> 07:40.000
bbb-sprite.jpg#xywh=384,576,128,72
07:40.000 --> 07:45.000
bbb-sprite.jpg#xywh=512,576,128,72
07:45.000 --> 07:50.000
bbb-sprite.jpg#xywh=640,576,128,72
07:50.000 --> 07:55.000
bbb-sprite.jpg#xywh=768,576,128,72
07:55.000 --> 08:00.000
bbb-sprite.jpg#xywh=896,576,128,72
08:00.000 --> 08:05.000
bbb-sprite.jpg#xywh=1024,576,128,72
08:05.000 --> 08:10.000
bbb-sprite.jpg#xywh=1152,576,128,72
08:10.000 --> 08:15.000
bbb-sprite.jpg#xywh=1280,576,128,72
08:15.000 --> 08:20.000
bbb-sprite.jpg#xywh=0,648,128,72
08:20.000 --> 08:25.000
bbb-sprite.jpg#xywh=128,648,128,72
08:25.000 --> 08:30.000
bbb-sprite.jpg#xywh=256,648,128,72
08:30.000 --> 08:35.000
bbb-sprite.jpg#xywh=384,648,128,72
08:35.000 --> 08:40.000
bbb-sprite.jpg#xywh=512,648,128,72
08:40.000 --> 08:45.000
bbb-sprite.jpg#xywh=640,648,128,72
08:45.000 --> 08:50.000
bbb-sprite.jpg#xywh=768,648,128,72
08:50.000 --> 08:55.000
bbb-sprite.jpg#xywh=896,648,128,72
08:55.000 --> 09:00.000
bbb-sprite.jpg#xywh=1024,648,128,72
09:00.000 --> 09:05.000
bbb-sprite.jpg#xywh=1152,648,128,72
09:05.000 --> 09:10.000
bbb-sprite.jpg#xywh=1280,648,128,72
09:10.000 --> 09:15.000
bbb-sprite.jpg#xywh=0,720,128,72
09:15.000 --> 09:20.000
bbb-sprite.jpg#xywh=128,720,128,72
09:20.000 --> 09:25.000
bbb-sprite.jpg#xywh=256,720,128,72
09:25.000 --> 09:30.000
bbb-sprite.jpg#xywh=384,720,128,72
09:30.000 --> 09:35.000
bbb-sprite.jpg#xywh=512,720,128,72
09:35.000 --> 09:40.000
bbb-sprite.jpg#xywh=640,720,128,72
09:40.000 --> 09:45.000
bbb-sprite.jpg#xywh=768,720,128,72
09:45.000 --> 09:50.000
bbb-sprite.jpg#xywh=896,720,128,72
09:50.000 --> 09:55.000
bbb-sprite.jpg#xywh=1024,720,128,72
09:55.000 --> 10:00.000
bbb-sprite.jpg#xywh=1152,720,128,72