ai-video-generator
БесплатноБез исполняемых скриптовНе проверенGenerate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
AI Video Generator — Short-Form Content Pipeline
Overview
Automate creation of short-form videos (TikTok, YouTube Shorts, Instagram Reels) using AI for every step: topic research, script writing, text-to-speech narration, stock footage matching, subtitle generation, and final assembly. Inspired by MoneyPrinterTurbo (130k+ stars).
Instructions
Step 1: Set Up the Environment
pip install anthropic openai requests whisperx srt schedule
sudo apt install ffmpeg # Linux — or: brew install ffmpeg (macOS)
API keys needed (read from environment variables): ANTHROPIC_API_KEY (scripts), ELEVENLABS_API_KEY plus ELEVENLABS_VOICE_ID (a voice ID from your ElevenLabs voice library) or OPENAI_API_KEY for OpenAI TTS, and PEXELS_API_KEY (free stock footage). WhisperX downloads speech models on first run and works best with a GPU; on CPU pass compute_type="int8".
Step 2: AI Script Writing
import os
import anthropic
def generate_script(topic, duration_seconds=45):
"""Generate a video script optimized for short-form content."""
client = anthropic.Anthropic()
prompt = f"""Write a {duration_seconds}-second video script about: {topic}
Format:
HOOK (first 3 seconds): A shocking statement or question that stops scrolling
BODY (main content): 3-5 punchy facts or points, each 1-2 sentences
CTA (last 5 seconds): Call to action — follow, like, comment
Rules:
- Conversational, no complex sentences
- Each sentence on its own line
- ~{duration_seconds * 2.5:.0f} words ({duration_seconds}s at 150wpm)
- Use power words: secret, shocking, nobody tells you, actually
- No emojis or hashtags — this is a voiceover script
"""
response = client.messages.create(
model=os.environ.get("SCRIPT_MODEL", "claude-sonnet-5-5"), max_tokens=500,
messages=[{"role": "user", "content": prompt}]
)
return response.content[0].text
Step 3: Text-to-Speech Narration
import requests, os
def generate_voice_elevenlabs(text, output_path='narration.mp3'):
"""Generate voiceover using ElevenLabs."""
voice_id = os.environ["ELEVENLABS_VOICE_ID"]
url = f"https://api.elevenlabs.io/v1/text-to-speech/{voice_id}?output_format=mp3_44100_128"
headers = {"xi-api-key": os.environ["ELEVENLABS_API_KEY"], "Content-Type": "application/json"}
data = {"text": text, "model_id": "eleven_flash_v2_5",
"voice_settings": {"stability": 0.5, "similarity_boost": 0.75}}
response = requests.post(url, json=data, headers=headers)
response.raise_for_status()
with open(output_path, 'wb') as f:
f.write(response.content)
return output_path
def generate_voice_openai(text, output_path='narration.mp3'):
"""Generate voiceover using OpenAI TTS (cheaper alternative). tts-1-hd is deprecated (removal announced for 2027-01-06), so use gpt-4o-mini-tts."""
from openai import OpenAI
client = OpenAI()
with client.audio.speech.with_streaming_response.create(
model="gpt-4o-mini-tts", voice="onyx", input=text
) as response:
response.stream_to_file(output_path)
return output_path
Step 4: Stock Footage Selection
def search_pexels_videos(query, count=5):
"""Search Pexels for portrait-oriented stock video clips."""
url = "https://api.pexels.com/videos/search"
headers = {"Authorization": os.environ["PEXELS_API_KEY"]}
params = {"query": query, "per_page": count, "orientation": "portrait", "size": "medium"}
response = requests.get(url, headers=headers, params=params)
videos = response.json().get('videos', [])
results = []
for v in videos:
files = sorted(v['video_files'], key=lambda x: x.get('height', 0), reverse=True)
hd = next((f for f in files if f.get('height', 0) >= 720), files[0]) # prefers >=720p
results.append({'id': v['id'], 'url': hd['link'], 'duration': v['duration']})
return results
Step 5: Subtitle Generation
def generate_subtitles(audio_path, output_srt='subtitles.srt'):
"""Generate word-level subtitles using WhisperX."""
import whisperx, srt
from datetime import timedelta
model = whisperx.load_model("base", device="cpu", compute_type="int8")
audio = whisperx.load_audio(audio_path)
result = model.transcribe(audio)
align_model, metadata = whisperx.load_align_model(language_code=result["language"], device="cpu")
aligned = whisperx.align(result["segments"], align_model, metadata, audio, "cpu")
subs = []
words = [w for seg in aligned["segments"] for w in seg.get("words", [])]
for i in range(0, len(words), 4):
group = words[i:i + 4]
if not group: continue
start = timedelta(seconds=group[0].get('start', 0))
end = timedelta(seconds=group[-1].get('end', 0))
text = ' '.join(w['word'] for w in group)
subs.append(srt.Subtitle(index
Установить ai-video-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ai-video-generator?
Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.
Как установить скилл ai-video-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ai-video-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic