This skill is suitable for streamlined video processing needs, aimed at quickly cutting out silent segments, transcribing accurate subtitles, and delivering the highest quality video, SRT subtitles, and plain text transcript through manual confirmation of key terms.
Prerequisite Tools and Environment
- ffmpeg: In PATH.
- auto-editor: Executable
python -m auto_editor(version 29+). - Groq API Key: Set in environment variable
GROQ_API_KEYor exists in~/.groq_api_key。 - Custom Python scripts(both located in
skills/):skills/smart-cut/scripts/smart_cut.pyskills/audio-to-srt/scripts/transcribe_groq.pyskills/audio-to-srt/scripts/resegment.pyskills/audio-to-srt/scripts/apply_vocab.pyskills/audio-to-srt/scripts/validate_srt.pyskills/audio-to-srt/scripts/srt_to_txt.pyskills/video-editing-and-subtitles/scripts/find_dubious_terms.pyskills/video-editing-and-subtitles/scripts/finalize_subtitles.py
Standardized Workflow
Step 1: Create Workspace and Copy Video
- Decide on an internal video code, for example
<video-id>(such asantigravity-ep06)。 - Create directory
raw/<video-id>/andworking/<video-id>/。 - Copy the original video as
raw/<video-id>/原始.mp4。
Step 2: Smart Silence Removal and Talking-Head Cut (smart-cut)
Run auto-editor for silent segment removal:
python "skills/smart-cut/scripts/smart_cut.py" \
"raw/<video-id>/原始.mp4" \
--out "working/<video-id>/<video-id>.cut.mp4" \
--threshold 0.05
(The threshold can be adjusted between 0.04 and 0.06 based on the speaker's vocal pauses; margin defaults to 0.2s)
Step 3: Audio Extraction and Speech Transcription (audio-to-srt)
- Extract 16kHz mono wav audio from the cut video:
ffmpeg -i "working/<video-id>/<video-id>.cut.mp4" -vn -ar 16000 "working/<video-id>/<video-id>.cut.wav" -y - Upload to Groq Whisper for STT (large files will be automatically compressed at a lower bitrate before upload):
python "skills/audio-to-srt/scripts/transcribe_groq.py" \ "working/<video-id>/<video-id>.cut.wav" \ --out "working/<video-id>/_subtitles/<video-id>.groq.json" - Re-segment finely based on word-level timestamps:
python "skills/audio-to-srt/scripts/resegment.py" \ "working/<video-id>/_subtitles/<video-id>.groq.json" \ --out "working/<video-id>/_subtitles/<video-id>.raw.srt" - Mechanically apply basic vocabulary replacement:
python "skills/audio-to-srt/scripts/apply_vocab.py" \ "working/<video-id>/_subtitles/<video-id>.raw.srt" \ --out "working/<video-id>/_subtitles/<video-id>.vocab.srt"
Step 4: Questionable Term Extraction and Manual Correction (Core Requirement)
- Run the filtering script to extract keywords (such as
Antigravity、Claude、Gemini、Gems、clasp, etc.) as well as segments with common transliteration errors:python "skills/video-editing-and-subtitles/scripts/find_dubious_terms.py" \ "working/<video-id>/_subtitles/<video-id>.vocab.srt" \ --out "working/<video-id>/_subtitles/dubious_terms.md" - Verify with the user: Read the generated
dubious_terms.md, list the questionable segments in the conversation, and ask the user how to correct them. - Apply user corrections: Run
finalize_subtitles.pyto apply custom correction rules (multiple corrections can be specified by passing the--replaceparameter multiple times; specific segment corrections are also supported, such as390:AGE->Agent):python "skills/video-editing-and-subtitles/scripts/finalize_subtitles.py" \ "working/<video-id>/_subtitles/<video-id>.vocab.srt" \ --out "working/<video-id>/_subtitles/<video-id>.clean.srt" \ --replace "舊字->新字" \ --replace "段號:特定舊字->新字"
Step 5: Verification and Packaging Output
- Run timecode format verification:
python "skills/audio-to-srt/scripts/validate_srt.py" \ --raw "working/<video-id>/_subtitles/<video-id>.vocab.srt" \ --clean "working/<video-id>/_subtitles/<video-id>.clean.srt" - Generate subtitle plain text transcript:
python "skills/audio-to-srt/scripts/srt_to_txt.py" \ "working/<video-id>/_subtitles/<video-id>.clean.srt" \ --out "working/<video-id>/<video-id>.txt" - Create output directory:
output/<影片標題> [<AgentName>]/(AgentName can beCodexorClaude)。 - Copy and rename the finished products to the output directory:
- Video:
output/<標題> [<AgentName>]/<標題>.mp4 - Subtitles:
output/<標題> [<AgentName>]/<標題>.srt - Text:
output/<標題> [<AgentName>]/<標題>.txt
- Video:
Pitfalls and Precautions
- Handling Brackets in Paths: PowerShell is sensitive to paths containing square brackets (such as
[Codex]). When executing file operation commands, it is recommended to always add quotes and use the-LiteralPathparameter. - Specific Segment Correction: If a certain term (such as
Gem➡️Gems) needs correction in most cases, but must not be changed in certain specific contexts (such asGemini), use a segment prefix to limit the replacement scope, for example390:AGE->Agent。