Communitygithub.com

3378925604-a11y/video-upscale-cpu

视频补分辨率/升 2K/去色带/画面发糊发虚——任意视频通用(动效信息图、2D/3D 动画、实拍、录屏、电影剧集片段均可)的纯 CPU ffmpeg 修复链:deband 去色带 → hqdn3d 去压缩噪 → lanczos 放大 → CAS 锐化。零显存、零下载、免 AI、免注册。当用户发来视频说"补分辨率""升到 2K""画面糊/有色带""帮我放大""画质修复"时触发。对实拍素材同样有效;若追求实拍纹理的极致重建,可在本链基础上再叠加 AI 超分作为可选进阶。

video-upscale-cpu 是什么?

video-upscale-cpu is a Claude Code agent skill that 视频补分辨率/升 2K/去色带/画面发糊发虚——任意视频通用(动效信息图、2D/3D 动画、实拍、录屏、电影剧集片段均可)的纯 CPU ffmpeg 修复链:deband 去色带 → hqdn3d 去压缩噪 → lanczos 放大 → CAS 锐化。零显存、零下载、免 AI、免注册。当用户发来视频说"补分辨率""升到 2K""画面糊/有色带""帮我放大""画质修复"时触发。对实拍素材同样有效;若追求实拍纹理的极致重建,可在本链基础上再叠加 AI 超分作为可选进阶。.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/3378925604-a11y/video-upscale-cpu/tree/HEAD/.agents/skills/video-upscale-cpu

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

video-upscale-cpu — Video Upscaler (Pure CPU Universal Chain)

A battle-tested ffmpeg repair chain: deband → hqdn3d → lanczos scale to 2560×1440 → CAS 0.6 sharpening, x264 crf15, audio stream copy. Pure CPU, zero VRAM, speed about RTF 1~3 (161 seconds of footage runs in minutes). Universal for any video — motion graphics, animation, live action, screencasts, movie clips, all work.

Three Typical Artifacts Fixed

  1. Banding on dark backgrounds/gradients — deband treats it, common in animation and dark live action
  2. Blurry small text and edges from compression — lanczos+CAS treats it, benefits infographics, screencasts, subtitles
  3. Compression noise and general fuzziness — hqdn3d treats it

One-Click Script (wraps all gotchas)

python scripts/upscale2k.py <source video> [output path]

Dependencies: ffmpeg/ffprobe in PATH (download or winget install Gyan.FFmpeg); Pillow + numpy optional (only affects auto-validation comparison images).

The script automatically does: ffprobe source probe → target dimension calculation (if source height ≥1440, only repair, no upscale) → run chain → integrity check (moov readable / duration aligned / audio start_time=0) → output same-frame 1:1 comparison image (old version nearest neighbor resize to same size vs new version) + edge energy ratio report.

Manual Command (equivalent)

ffmpeg -y -i <source> -vf "deband,hqdn3d=1.5:1.5:6:6,scale=2560:1440:flags=lanczos,cas=0.6"   -c:v libx264 -crf 15 -preset medium -c:a copy <output>

Per-Content-Type Tweaks (optional, works without)

ContentSuggested Tweak
Motion graphics / infographics (dark bg, small text)Default works; if text too sharp, lower cas=0.6 to 0.4
2D animationDefault works; if banding heavy, stack one more deband
Live actionLower first two params of hqdn3d to 1 (preserve film grain); for pore-level texture reconstruction, optionally layer AI super-resolution
Screencast / tutorialDefault; if text blurry, focus on CAS

🔴 Three Hard Gotchas (all hit in practice)

  1. lanczos is not a standalone filter — must write scale=2560:1440:flags=lanczos; writing lanczos=2560:1440 gives Invalid argument.
  2. mp4 moov index written only at end of transcoding — opening output mid-run gives "Invalid data / cannot open"; it's not broken, wait for completion.
  3. Re-encoded copies cannot be used as source — WeChat/QQ etc. re-encodes and drops frames (measured 4842→4830 frames) + timestamp damage; pairing its video track with original audio causes audio/video desync (silent first few seconds). Desync check: ffprobe -select_streams a:0 -show_entries stream=start_time + silencedetect to check audio start.

Validation Criteria

  • Same-frame 1:1 pixel comparison: old version uses flags=neighbor resize to same size, edge energy ratio (new/old) in 1.05~1.15 is normal gain; significantly below 1.0 = chain working backward, check params.
  • Visually confirm small text edges and dark background banding in the comparison image; quantitative metrics are only supporting evidence.
  • Audio: output start_time=0 + volumedetect shows loudness in the first 3 seconds.

相关技能