Skip to content

Clip Workflows

Clip workflows transform longer videos into short-form viral content. They handle moment detection, clip extraction, reframing, subtitles, hooks, dubbing, and effects.

Workflow: clip/clip_generator

Complete pipeline: download a video, detect viral moments, extract clips, reframe to vertical, add subtitles, hooks, and effects.

Terminal window
# From YouTube
fabric run clip/clip_generator --input url="https://youtube.com/watch?v=..."
# From local file
fabric run clip/clip_generator --input media_path="/path/to/podcast.mp4"
transcription_pipeline
detect_viral_moments (Gemini moment scoring)
extract_clips (FFmpeg at timestamps)
reframe_pipeline (MediaPipe + YOLO → 9:16)
subtitle_pipeline (word-level subtitles)
hook_overlay_pipeline (AI text overlays)
effects_pipeline (AI color grading)
collect_final_clips
ParameterTypeDefaultDescription
urlstringYouTube or video URL
media_pathstringLocal video file
query / topicstring""Focus topic for moment detection
{
"clips": [
{
"id": "clip_001",
"path": "/tmp/clip_001_final.mp4",
"hook": "You won't believe what happened next",
"start": 45.2,
"end": 75.8,
"duration": 30.6,
"score": 0.92
}
],
"total_clips": 5
}

Workflow: clip/blur_reframe

Converts landscape to 9:16 vertical without cropping — the full frame is visible with a blurred background fill (pillarbox style).

Terminal window
fabric run clip/blur_reframe --input media_path="/path/to/landscape.mp4"
{
"vertical_path": "/tmp/blur_reframe.mp4",
"reframe_mode": "blur"
}

Workflow: clip/dubbing

Translates and dubs video audio into 30+ languages using ElevenLabs voice synthesis.

Terminal window
fabric run clip/dubbing \
--input media_path="/path/to/video.mp4" \
--input target_language="Spanish" \
--input full_text="Original transcript..."
translate_transcript → generate_dubbed_audio → replace_audio_track
ParameterTypeDefaultDescription
full_textstringrequiredOriginal transcript
target_languagestringrequiredTarget language name
voice_idstringautoElevenLabs voice ID
elevenlabs_api_keystringenvAPI key
{
"dubbed_path": "/tmp/dubbed_spanish.mp4",
"dubbed_audio_path": "/tmp/dubbed_audio.mp3"
}

Workflow: clip/hooks

Generates attention-grabbing text and burns it as an animated overlay on the first 3 seconds of a clip.

Terminal window
fabric run clip/hooks \
--input media_path="/path/to/clip.mp4" \
--input hook="This changes everything"
generate_hook_text → burn_hook_overlay

If no hook text is provided, the LLM generates one from the transcript excerpt.

{
"hooked_path": "/tmp/hooked_clip.mp4",
"hook_text": "This changes everything"
}

Workflow: clip/effects

Uses Gemini to generate professional FFmpeg filter chains based on content type and mood, then applies them.

Terminal window
fabric run clip/effects \
--input media_path="/path/to/clip.mp4" \
--input mood="dramatic" \
--input content_type="talking_head"
generate_effect_filters → apply_effects
{
"effects_path": "/tmp/effected_clip.mp4",
"ffmpeg_filters": "eq=contrast=1.1:brightness=0.02,unsharp=5:5:0.5"
}