| name | content-analyzer |
| description | Analyze video/text content to identify highlights, key topics, and optimal clip points for short video creation. |
内容分析器
分析视频/文字内容,识别精彩片段、关键话题,为短视频创作提供智能建议。
功能
- 话题识别: 提取内容的核心主题
- 情绪分析: 识别情感高潮点
- 精彩定位: 找出最适合做短视频的片段
- 结构分析: 分析内容结构,建议剪辑点
使用方法
分析这个视频的内容: ./output/downloads/video.mp4
帮我分析这段文案的亮点:
今天分享三个改变我人生的习惯...
Instructions
Step 1: 获取转录文本
INPUT="[USER_INPUT]"
if [[ -f "$INPUT" ]]; then
TRANSCRIPT="${INPUT%.mp4}.txt"
if [ ! -f "$TRANSCRIPT" ]; then
echo "正在转录音频..."
whisper "$INPUT" --model base --language zh --output_format txt --output_dir ./temp/
fi
else
echo "$INPUT" > ./temp/content.txt
TRANSCRIPT="./temp/content.txt"
fi
Step 2: 内容分析
import re
from collections import Counter
with open(TRANSCRIPT_PATH, 'r') as f:
text = f.read()
total_chars = len(text)
sentences = re.split(r'[。!?\n]', text)
sentences = [s.strip() for s in sentences if len(s.strip()) > 5]
print(f"=== 内容分析报告 ===\n")
print(f"总字数: {total_chars}")
print(f"句子数: {len(sentences)}")
print(f"预估阅读时间: {total_chars / 300:.1f} 分钟")
print(f"预估语音时长: {total_chars / 4:.0f} 秒\n")
stopwords = set(['的', '是', '在', '和', '了', '有', '我', '你', '他', '她', '它',
'这', '那', '就', '也', '都', '会', , , , ])
words = re.findall(, text)
word_freq = Counter(w w words (w) >= w stopwords)
top_keywords = word_freq.most_common()
()
word, count top_keywords:
()
numbered_points = re.findall(, text)
numbered_points:
()
point numbered_points[:]:
()
exclamations = [s s sentences s s]
exclamations:
()
ex exclamations[:]:
()
quotes = re.findall(].*?[」\n
q quotes[:]:
()
Step 3: 精彩片段推荐
highlights = []
for i, sentence in enumerate(sentences):
score = 0
if '秘密' in sentence or '技巧' in sentence: score += 3
if '推荐' in sentence or '必须' in sentence: score += 2
if '震惊' in sentence or '惊讶' in sentence: score += 2
if re.search(r'\d+[个种条]', sentence): score += 2
if '!' in sentence: score += 1
if len(sentence) > 20 and len(sentence) < 50: score += 1
if score >= 3:
highlights.append({
'index': i,
'text': sentence,
'score': score
})
highlights.sort(key=lambda x: x['score'], reverse=True)
print("\n## 推荐短视频片段:")
for h in highlights[:]:
()
()
()
Step 4: 生成分析报告
cat > ./output/analysis_report.md << 'EOF'
- 总字数: X
- 句子数: X
- 预估时长: X 秒
1. 话题 A
2. 话题 B
3. 话题 C
- 位置: 00:30 - 00:45
- 内容: "..."
- 原因: 包含数字要点、情感高潮
- 位置: 01:20 - 01:35
- 内容: "..."
- 原因: 实用技巧分享
1. **开场 Hook**: 使用片段 1 作为开场吸引注意
2. **核心内容**: 围绕核心话题展开
3. **结尾 CTA**: 添加互动引导
精简版,只保留核心金句
标准版,包含完整观点
详细版,包含案例说明
EOF
echo "✅ 分析报告已生成: ./output/analysis_report.md"
输出
- 分析报告:
./output/analysis_report.md
- 推荐片段列表
- 短视频脚本建议
与其他 Skills 配合
- 分析完成后 →
highlight-finder 精确定位时间点
- 确定片段后 →
shorts-generator 生成短视频
- 基于建议 →
script-to-video 生成优化版本