qiaomu-cut
Verified把一句话需求转成可复现、可验收视频工程的乔木智能剪辑导演。Use when the user asks to create, plan, edit, remix, explain, narrate, subtitle, animate, composite, or render a video—including one-line requests such as “制作一个科普视频:介绍 LLM 中的 RL”. Builds English-learning movie mixes, person profiles, explainers, code-drawn motion graphics (UI morph loops, showreels, kinetic-type promos, line-art/pixel/Three.js animation, lyric MVs), product launch videos, cinematic shorts, social clips, course/PPT videos, AI image/video/TTS/music-assisted stories, stock-footage stories, or multi-source montage. Routes across 33台词, ClipSeek/open media, local files, ListenHub, image generation, HTML/SVG/Canvas motion graphics with beat-grid storyboards and determinism probes, Manim, ffmpeg-full, captions, sound design, frame-0 video covers with YouTube thumbnails, and release checks.
scripts/renderers/ass.js
View on GitHub'use strict';
const fs = require('fs');
function assTime(seconds) {
const value = Math.max(0, Number(seconds || 0));
const h = Math.floor(value / 3600);
const m = Math.floor((value % 3600) / 60);
const s = Math.floor(value % 60);
const cs = Math.floor((value - Math.floor(value)) * 100);
return `${h}:${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}.${String(cs).padStart(2, '0')}`;
}
function escapeAss(text) {
return String(text || '')
.replace(/\r?\n/g, '\\N')
.replace(/[{}]/g, '');
}
function generateAss(captions, options = {}) {
const width = Number(options.width || 1920);
const height = Number(options.height || 1080);
const font = options.font || 'Arial';
const fontSize = Number(options.fontSize || Math.round(height * 0.052));
const primary = options.primary || '&H00FFFFFF';
const outline = options.outline || '&HAA000000';
const marginV = Number(options.marginV || Math.round(height * 0.08));
const lines = [
'[Script Info]',
'ScriptType: v4.00+',
`PlayResX: ${width}`,
`PlayResY: ${height}`,
'ScaledBorderAndShadow: yes',
'',
'[V4+ Styles]',
'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding',
`Style: Default,${font},${fontSize},${primary},&H000000FF,${outline},&H66000000,-1,0,0,0,100,100,0,0,1,3,0,2,80,80,${marginV},1`,
`Style: Highlight,${font},${Math.round(fontSize * 1.08)},&H0000D7FF,&H000000FF,${outline},&H66000000,-1,0,0,0,100,100,0,0,1,3,0,2,80,80,${marginV},1`,
'',
'[Events]',
'Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text'
];
for (const caption of captions) {
const style = caption.style || (caption.highlight ? 'Highlight' : 'Default');
lines.push(`Dialogue: 0,${assTime(caption.start)},${assTime(caption.end)},${style},,0,0,0,,${escapeAss(caption.text)}`);
}
return lines.join('\n') + '\n';
}
function readCaptions(file) {
const data = JSON.parse(fs.readFileSync(file, 'utf8'));
if (Array.isArray(data)) return data;
if (Array.isArray(data.captions)) return data.captions;
throw new Error('Caption JSON must be an array or { "captions": [...] }.');
}
module.exports = {
assTime,
generateAss,
readCaptions
};
if (require.main === module) {
const input = process.argv[2];
const output = process.argv[3];
if (!input || !output) {
console.error('Usage: ass.js captions.json subtitles.ass');
process.exit(2);
}
const ass = generateAss(readCaptions(input));
fs.writeFileSync(output, ass);
console.log(output);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |