Skip to content

anbeime/skill / skills/video-creation-suite/video-creation-suite

video-creation-suite

Unverified

自媒体创作者与影片与视频编辑当需要从零原创、二次创作或深度分析视频时,请使用此套件。通过11个智能体协同,一键生成配音、音效与BGM并合成高质量视频,或自动抽帧提取分镜提示词,全流程大幅提升视频产出效率。

scripts/generate_background_music.py

View on GitHub
#!/usr/bin/env python3
"""
生成背景音乐脚本
由于没有Suno API,使用简单的静音音频作为占位
"""

import os
import json
import subprocess


def generate_background_music(script_path: str, output_dir: str):
    """
    生成背景音乐(静音占位)

    参数:
        script_path: 分镜脚本路径
        output_dir: 输出目录
    """
    with open(script_path, 'r', encoding='utf-8') as f:
        script = json.load(f)

    total_duration = script['duration']

    print(f"正在生成背景音乐(静音占位)...")
    print(f"总时长: {total_duration}秒")

    output_path = os.path.join(output_dir, "background_music.mp3")

    # 使用ffmpeg生成静音音频
    cmd = [
        "ffmpeg",
        "-f", "lavfi",
        "-i", f"anullsrc=r=44100:cl=mono",
        "-t", str(total_duration),
        "-q:a", "9",
        "-y",
        output_path
    ]

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)

        if result.returncode == 0:
            # 获取文件大小
            size = os.path.getsize(output_path)

            print(f"\n✓ 背景音乐已生成: {output_path}")
            print(f"大小: {size / 1024:.1f} KB")
            print(f"注意: 这是静音占位音频,实际使用时需要替换为真实的背景音乐")
        else:
            print(f"\n✗ 背景音乐生成失败")
            print(f"错误: {result.stderr}")
            raise Exception(f"ffmpeg失败: {result.stderr}")

    except Exception as e:
        print(f"\n✗ 背景音乐生成失败: {str(e)}")
        raise


if __name__ == "__main__":
    script_path = "./output/script.json"
    output_dir = "./output/audio"

    os.makedirs(output_dir, exist_ok=True)

    generate_background_music(script_path, output_dir)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall