Communitygithub.com

drama-finishing-upscaler

Short drama industrialization pipeline · Stage 5: Final assembly and 1080p upscaling. Handles lossless segment concatenation and cinema-grade 1080p super-resolution enhancement. Core tech: FFmpeg concat zero-loss stitch, RealESRGAN x2plus GPU-exclusive FP16 batch upscaling (~4.8fps), native high-quality ducked audio lossless muxing, ffprobe industrial-grade physical parameter validation.

What is drama-finishing-upscaler?

This skill represents the fifth and final stage of an industrial short drama production pipeline, focused on delivering the finished episode with optional 1080p super-resolution upscaling. It strictly enforces lossless concatenation of up to 8 cleaned segments using FFmpeg's concat demuxer with stream copy, avoiding any re-encoding to preserve original sharpness and audio quality. For 1080p enhancement, it utilizes the RealESRGAN_x2plus model with CUDA FP16 precision and a batch size of 4, achieving approximately 4.8 fps on an RTX 4080 (about 4.5 minutes for 1400 frames). The skill automatically extracts the original audio track before upscaling and losslessly muxes it back after frame processing, ensuring that complex ducked background music and clean dialogue are 100% preserved. Finally, it runs an automated ffprobe-based validation to confirm resolution (1920×1080), frame rate (24.0 fps), duration matching, and audio stream integrity. This skill is designed for use with FFmpeg, Python scripts for RealESRGAN inference, and supports Windows PowerShell execution. It is ideal for AI agents or developers automating high-volume short-form video production requiring minimal quality loss and reliable physical inspection.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/abserari/drama-production-skills/tree/HEAD/skills/drama-finishing-upscaler

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Drama Finishing Upscaler (Final Assembly and 1080p Upscaling)

Operation Positioning: Final delivery and quality enhancement step for short dramas. No Generic Fluff: This document does not explain what super-resolution is. It only records multi-segment lossless concatenation syntax, RealESRGAN VRAM batch processing acceleration, and final video physical inspection criteria.


1. Runtime Contract and Input/Output

  • Input:
    1. 8 cleaned segments output from Stage 4: cleaned_segments/seg01.mp4 ~ seg08.mp4;
    2. Or the final episode with completed side-chain ducked music: [episode_name]_final_ducked.mp4.
  • Output:
    1. [episode_name]_original_commercial.mp4 (832×480 native HD delivery master);
    2. [episode_name]_1080p.mp4 (1920×1080 cinema-grade super-resolution final);
    3. delivery_report.json: Physical parameter validation ledger.

2. Core SOP: Shot-Lossless Concatenation (Zero-Loss Concat)

Hard Rule: Absolutely no re-encoding when concatenating segments! Re-encoding destroys original sharpness and causes additional audio degradation.

2.1 FFmpeg Concat Zero-Loss Seamless Stitch

Generate a temporary concatenation index list and perform stream copy:

# 1. Automatically generate ordered index list
file 'cleaned_segments/seg01.mp4'
file 'cleaned_segments/seg02.mp4'
...
file 'cleaned_segments/seg08.mp4'

# 2. Execute zero-overhead stream copy concatenation
ffmpeg -y -f concat -safe 0 -i concat_list.txt -c copy concat_raw.mp4
  • Duration: Stitching all 8 segments takes only 0.2 seconds, preserving every frame's original pixels and audio-video sync losslessly.

3. Core SOP: RealESRGAN 1080p Exclusive Upscaling Acceleration

VRAM Isolation Rule: Before performing 1080p upscaling, GPU VRAM occupied by ComfyUI must be released first, allowing RealESRGAN exclusive access to 16GB VRAM for maximum throughput.

3.1 Industrial Upscaling Inference and Audio Muxing

Invoke scripts/upscale_video.py:

  • Model: RealESRGAN_x2plus.pth;
  • Precision & Device: CUDA + FP16 half precision;
  • Batch Size: batch_size = 4 (on RTX 4080 exclusive mode, frame rate stable at ~4.8 frame/s, entire episode of 1400 frames takes about 4.5 minutes);
  • Audio Protection Mechanism: Before upscaling, use ffmpeg to losslessly extract the original video's audio track (audio.m4a). After frame inference, mux it back using libx264 -crf 18 -c:a copy, 100% preserving the 90s side-chain intelligent ducked background music and clean dialogue.

Command:

python scripts/upscale_video.py --input raw_video.mp4 --output final_1080p.mp4 --model RealESRGAN_x2plus.pth --width 1920 --height 1080

4. Core SOP: Final Video Dual Physical Inspection

After the final file is written, automated acceptance testing must be performed using ffprobe:

  • Resolution strictly met: Width 1920, Height 1080 (fails if not 1080p);
  • Frame rate strictly aligned: 24.0 fps standard cinema frame rate;
  • Duration strictly aligned: 8 segments × 175 frames = 58.33s ~ 58.35s;
  • Audio stream complete: Contains independent stereo audio stream (AAC, sample rate 44.1kHz/48kHz).

5. Dedicated Tool Scripts

  • Single-episode 1080p upscale: python scripts/upscale_video.py --input in.mp4 --output out.mp4
  • Batch upscale scheduling for full set: python scripts/run_episodes_1_to_8_upscale.py

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

comfy-h3-render-core

短剧工业化管线·第 3 工序:H3 物理视频渲染与防翻车调度。负责与本地 ComfyUI 服务交互,调度 MiniMax H3 进行 Turbo 8-step 视频生成。硬核沉淀:Windows WDDM 驱动锁防御、潜空间 32 整除铁律、单人发音锁定与全员闭嘴抑制指令装配、首帧 I2V 安全注入、分镜间显存防泄漏。

comfy-h3-video-producer

本地 ComfyUI 剧本转视频自动生产管线(MiniMax H3)。用户给剧本要求用 ComfyUI 出分镜视频,或提到"一采二采/超分/班长套件/CSGlide/工作流生成视频"时使用。覆盖:工作流握手(不写死节点号)、导演调度与段规划、H3 提示词、提交与自动监工、一采双检闸门、收片清床音与拼接、断点续产。

drama-audio-soundstage

短剧工业化管线·第 4 工序:声音工程与智能避让配乐。负责 H3 视频生成后的声音精修。硬核沉淀:谱减法音频门控(消灭风噪/电流床音)、Whisper ASR 纯普通话语种漂移拦截、FFmpeg 原生侧链动态避让混音(Sidechain Ducking,台词开口 BGM 瞬降 -14dB,闭嘴扬起)。

drama-director-staging

短剧工业化管线·第 1 工序:编剧与导演分镜调度。负责将剧情大纲或小说文本转化为符合短剧视听规律的工业级分镜。内置:6 大动态运镜轮换决策树、台词纯中文汉字归一化(数字大写)、短剧快节奏 20~28 字密度调控、单人发言与旁观者闭嘴标注。

drama-keyframe-forge

短剧工业化管线·第 2 工序:分镜定帧与资产一致性。负责在视频渲染前,建立全局风格母卡 (Style Bible),并为每个分镜前置生成“场景+人物+道具”三合一的 16:9 高清定帧垫图。彻底根治 T2V 盲跑带来的人脸变形、角色换脸、场景变色与道具软化。

Related Skills