| name | youtube-clip-transcribe |
| description | Downloads YouTube sermon audio, crops by timestamps, optimises volume (quiet or hot), merges multi-part clips, transcribes with praisonai-audio-editor, maps to YAML decks, and packs deliverables. Use when the user gives a YouTube URL with start/end times, full video, two-part merge, sermon transcript, or BIC sermon deck pack. |
YouTube clip โ normalise โ transcribe โ pack
Run every step on the user's Mac. Do not stop at instructions.
Repeat the pipeline per clip. Never merge transcripts unless the user explicitly asks to join two videos into one audio file first.
Prerequisites
| Tool | Check |
|---|
ffmpeg / ffprobe | ffmpeg -version |
OPENAI_API_KEY | bash -lc 'test -n "$OPENAI_API_KEY" && echo ok' |
| This repo | ~/praisonai-audio-editor |
yt-dlp | conda python3 -m yt_dlp (homebrew yt-dlp often returns 403) |
| YAML decks | /Users/praison/praisonaippt/examples/*.yaml |
Shell: use bash -lc 'โฆ' so ~/.bashrc loads OPENAI_API_KEY.
Parse user input
- YouTube URL โ
{VIDEO_ID}
- Start / End โ
-to is absolute on the full timeline
- "till the end" โ
-ss START only (no -to)
- Full video โ skip crop; use
~/Downloads/{VIDEO_ID}_full.m4a
- Two-part sermon โ crop each, merge, then normalise โ transcribe once
Output naming
| Artifact | Path |
|---|
| Full download | ~/Downloads/{VIDEO_ID}_full.m4a |
| Cropped / normalised | ~/praisonai-audio-editor/{stem}.m4a |
| Transcript JSON | โฆ/{stem}.transcript.json |
| Plain text | โฆ/{stem}.transcript.txt |
| Log | โฆ/{stem}_transcribe.log |
Checklist
- [ ] Download (conda yt-dlp)
- [ ] Crop or merge parts
- [ ] Normalise volume โ report mean/max before & after
- [ ] ffprobe duration check
- [ ] transcribe --format json
- [ ] extract-text
- [ ] Pack + YAML map (if requested)
Step 1 โ Download
zsh -c "source $(conda info --base)/etc/profile.d/conda.sh && conda activate test && \
python3 -m yt_dlp -f 'ba/b' --no-playlist --concurrent-fragments 8 --no-part \
-x --audio-format m4a \
-o '/Users/praison/Downloads/{VIDEO_ID}_full.%(ext)s' 'URL'"
403 โ pip install -U yt-dlp + --extractor-args 'youtube:player_client=android,web'.
No --print on download โ it can skip writing the file.
Step 2 โ Crop
ffmpeg -y -nostdin -i FULL.m4a -ss START -to END -map 0:a:0 -c copy OUT.m4a
Step 2b โ Volume optimisation
Target: โ16 LUFS, โ1.5 dBTP.
| Condition | Action |
|---|
| Too quiet (mean < โ22 dB or max < โ8 dB) | Auto loudnorm |
| Optimal (โ22โฆโ14 mean, โ8โฆโ2 max) | Skip โ "Volume OK" |
| Too loud (mean > โ12 dB or max โฅ โ1 dB) | --in-place --force |
cd ~/praisonai-audio-editor
python3 -m praisonai_editor normalize "$AUDIO" --in-place
python3 -m praisonai_editor normalize "$AUDIO" --in-place --force
Wrapper: scripts/optimize-audio-volume.sh
Step 2c โ Merge two parts
ffmpeg -y -i PART1.m4a -i PART2.m4a \
-filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[out]" -map "[out]" \
-c:a aac -b:a 192k MERGED.m4a
Normalise merged file, then transcribe once.
Step 3 โ Transcribe
Full local pipeline (silence cut + normalise + transcribe): sermon-transcribe โ run all steps when user provides audio; this YouTube skill covers download + crop + normalise only.
Transcribe rules (Tamil+English, --speed 2, sanity checks): sermon-transcribe Steps 6โ10.
Mixed Tamil/English: omit --language. English-dominant: --language en.
bash -lc 'cd ~/praisonai-audio-editor && python3 -m praisonai_editor transcribe \
FILE.m4a --format json \
2>&1 | tee STEM_transcribe.log'
Optional: --speed 2 after 5 min quality test (see sermon-transcribe).
Step 4 โ Extract text
python3 -m praisonai_editor extract-text STEM.transcript.json
โ {stem}.transcript.txt
Step 5โ6 โ YAML map + deck pack
Map stem โ examples/*.yaml by topic/verses. Pack script:
python3 /Users/praison/praisonaippt/scripts/build_sermon_pack2.py
Output: ~/Downloads/BIC-Sermon-Deck-Pack-2/ + sermon_video_map.json
Do not use
- Homebrew
yt-dlp alone (403)
--download-sections on long clips
transcribe --force-transcribe
More detail
Canonical skill: ~/.cursor/skills/youtube-clip-transcribe/SKILL.md (reference.md, examples.md)