Skip to content

Mr-funny/hbg-classical-poem-silk-video / skill/classical-poem-silk-video

classical-poem-silk-video

Verified

Turn Chinese classical poems and ci into coherent vertical Chinese-art videos with poem-driven scene grouping, GPT ImageGen stills, Docker-only Gemini I2V, retained model-generated ambience, Gemini sparkle-watermark cleanup, brush-calligraphy captions revealed character by character, optional local BGM mixing, stitching, and final-frame QA. Supports verse-driven variation across ink landscape, gongbi bird-and-flower, colored figure-and-horse painting, blue-green landscape, xuan paper, silk, and related Chinese visual languages. Use when users ask for 古诗词动态视频、诗词逐句或两句一景、国风视频、毛笔字逐字出现、整首诗拼接成片,or want the established 月落乌啼霜满天 workflow applied to another poem.

FileKindSize
SKILL.mdskill md6.5 KB
agents/openai.yamlconfig275 B
assets/MaShanZheng-Regular.ttfbinary5.6 MB
assets/OFL.txtmarkdown4.2 KB
references/runtime-contract.mdmarkdown1.9 KB
references/style-and-scene-mapping.mdmarkdown6.2 KB
scripts/check_prerequisites.shexecutablescript1.5 KB
scripts/clean_star_watermark.shexecutablescript861 B
scripts/concat_poem.shexecutablescript1.3 KB
scripts/concat_poem_crossfade.shexecutablescript2.0 KB
scripts/docker_gemini_i2v.pyexecutablescript2.7 KB
scripts/docker_gemini_i2v.shexecutablescript970 B
scripts/final_media_qa.shexecutablescript3.6 KB
scripts/make_scene_ass.pyexecutablescript2.7 KB
scripts/render_scene.shexecutablescript1.8 KB

scripts/render_scene.sh

View on GitHub
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 4 ] || [ "$#" -gt 5 ]; then
  echo "Usage: $0 <input-video> <scene.ass> <output.mp4> <duration-seconds> [fade|none]" >&2
  exit 2
fi

skill_dir="$(cd "$(dirname "$0")/.." && pwd)"
input="$1"
ass="$2"
output="$3"
duration="$4"
fade_mode="${5:-fade}"
fade_out="$(awk -v d="$duration" 'BEGIN { printf "%.3f", d - 0.45 }')"
mkdir -p "$(dirname "$output")"

case "$fade_mode" in
  fade)
    video_fade=",fade=t=in:st=0:d=0.35,fade=t=out:st=$fade_out:d=0.45"
    audio_fade=",afade=t=in:st=0:d=0.35,afade=t=out:st=$fade_out:d=0.45"
    ;;
  none)
    video_fade=""
    audio_fade=""
    ;;
  *)
    echo "Fade mode must be 'fade' or 'none'" >&2
    exit 2
    ;;
esac

if ffprobe -v error -select_streams a:0 -show_entries stream=index -of csv=p=0 "$input" | rg -q '[0-9]'; then
  ffmpeg -y \
    -i "$input" \
    -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,setsar=1,subtitles='$ass':fontsdir='$skill_dir/assets'$video_fade,format=yuv420p[v];[0:a]atrim=start=0:end=$duration,asetpts=N/SR/TB,volume=0.92$audio_fade[a]" \
    -map '[v]' -map '[a]' \
    -t "$duration" -r 30 \
    -c:v libx264 -preset slow -crf 18 -profile:v high -level 4.1 \
    -c:a aac -b:a 192k -ar 44100 -ac 2 \
    -movflags +faststart \
    "$output"
else
  ffmpeg -y \
    -i "$input" -f lavfi -i anullsrc=r=44100:cl=stereo \
    -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,setsar=1,subtitles='$ass':fontsdir='$skill_dir/assets'$video_fade,format=yuv420p[v];[1:a]atrim=start=0:end=$duration$audio_fade[a]" \
    -map '[v]' -map '[a]' \
    -t "$duration" -r 30 \
    -c:v libx264 -preset slow -crf 18 -profile:v high -level 4.1 \
    -c:a aac -b:a 192k -ar 44100 -ac 2 \
    -movflags +faststart \
    "$output"
fi

echo "$output"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall