Loading...
Loading...
Podcast Rough Cut. Perform sentence-level FFmpeg clipping based on deletion markers in the review draft. Trigger words: rough cut, sentence-level clipping, rough cut
npx skill4agent add luoyuweidu1/podcastcut-skills podcastcut-edit-rawIterate through each sentence in the transcript → Check if it is in the deletion markers → Delete the entire sentence
User: Rough cut according to this review draft /path/to/podcast_review_draft.md
User: Rough cut, output to /path/to/output| Scenario | Description |
|---|---|
| ✅ Delete large sections | Greetings, off-topic content, privacy-related parts, verbose segments |
| ✅ Delete entire sentences | Sentence-level timestamps are sufficiently accurate |
| ❌ Delete half sentences/verbal slips | Use |
# 从 transcript 出发,检查每个句子是否需要删除
for sentence in transcript['sentences']:
if normalize(sentence['text']) in 审查稿删除标记:
删除这个句子~~deletion markers~~1. Load the review draft and extract all ~~deletion markers~~
↓
2. Load transcript.json (sentence-level timestamps)
↓
3. Iterate through each sentence and check if it is in the deletion markers
↓
4. Merge consecutive deletions → Calculate retained segments
↓
5. Generate FFmpeg filter → Execute clipping
↓
6. Output podcast_v2.mp3/mp4def is_sentence_deleted(sentence_text, deletions):
"""检查句子是否应该删除"""
text_norm = normalize(sentence_text) # 移除空格标点
# 句子出现在任一删除标记中 → 删除
for deletion in deletions:
if text_norm in normalize(deletion):
return True
return Falsepython scripts/rough_cut.py <working_directory> <input_audio> [output_audio]python scripts/rough_cut.py \
"/Volumes/T9/podcast/v5" \
"/Volumes/T9/podcast/original_audio.mp3"podcast_review_draft.mdpodcast_transcript.jsonpodcast_deletion_list.jsonkeep_segments.jsonfilter.txtffmpeg_cmd.sh<working_directory>/
├── podcast_v2.mp3 # Clipped audio
├── podcast_deletion_list.json # List of deleted time segments
├── keep_segments.json # List of retained segments
├── filter.txt # FFmpeg filter script
└── ffmpeg_cmd.sh # Complete FFmpeg commandffmpeg -y -i input.mp3 \
-filter_complex_script filter.txt \
-map "[outa]" \
-c:a libmp3lame -q:a 2 \
output_v2.mp3ffmpeg -y -i input.mp4 \
-filter_complex_script filter.txt \
-map "[outv]" -map "[outa]" \
-c:v libx264 -crf 18 -c:a aac \
output_v2.mp4User: Rough cut according to the review draft /path/to/podcast_review_draft.md
AI: Sure, starting rough cut...
1. Loaded review draft: 144 deletion markers
2. Loaded transcript: 3376 sentences
3. Matched deletions: 296 sentences
4. After merging: 137 deletion blocks
5. Generated FFmpeg command and executed it
Results:
- Original duration: 2:08:07
- After clipping: 1:57:54
- Deleted: 10:13| Comparison | Rough Cut (this Skill) | Fine Cut (/podcastcut-edit-fine) |
|---|---|---|
| Timestamp | Sentence-level | Character-level |
| Minimum Unit | Entire sentence | Single character |
| Use Case | Delete large sections | Delete verbal slips, filler words |
| Input | podcast_transcript.json | podcast_transcript_chars.json |
len < 2if len(text_norm) == 1:
text_norm == del_norm # 精确匹配,避免误删
else:
text_norm in del_norm # 包含即可/podcastcut-edit/podcastcut-edit-fine