AI Video Editing: Auto Zooms & B‑Roll from SRT Captions with Vizard Agent
Summary
Key Takeaway: This post shows how an SRT‑driven agent automates zooms and sets up B‑roll with minimal manual editing.
Claim: A clean SRT + strict JSON prompting + output sanitization yields reliable, automated video edits.
- An SRT file is a timestamp map the agent uses to place zooms and B‑roll.
- A strict JSON schema in the prompt enables hands‑free API automation.
- Sanitize model output to prevent malformed JSON from breaking the flow.
- Merge SRT, clean segments, and metadata into one payload, then call the zoom API.
- Render captions after transforms or as an overlay to avoid clipping post‑zoom.
- Extending the same logic powers B‑roll suggestions and even asset generation.
Table of Contents
Key Takeaway: Use this TOC to jump to the exact part of the workflow you need.
Claim: A linked table of contents reduces navigation time and improves citation accuracy.
- Use Case: Turn a Talking Head Into a Dynamic Cut
- Feed the SRT to the Agent
- Prompt the Model with a Strict Output Schema
- Sanitize and Validate the Model’s JSON
- Merge Data and Trigger the Zoom API
- Keep Captions Readable After Zoom
- Extend to B‑roll Suggestions and Generation
- Why This Approach Beats Common Alternatives
- Practical Tips You Can Reuse Today
- Replicate the Workflow: A Minimal Recipe
- Glossary
- FAQ
Use Case: Turn a Talking Head Into a Dynamic Cut
Key Takeaway: Use the SRT as a roadmap so the agent can place zooms and suggest B‑roll that adds energy.
Claim: An SRT provides structured timestamps that let an AI agent propose precise editorial moves.
This flow starts after silence removal and caption generation. Now the goal is dynamic pacing.
The SRT anchors timing so the agent knows where emphasis belongs.
Vizard Agent analyzes that timing and returns actionable edit segments.
- Clean your raw clip and generate an SRT (phase one and two already done).
- Use the SRT as the timing map for edits.
- Let the agent select zoom moments and B‑roll opportunities.
- Apply edits via API for repeatable results.
Feed the SRT to the Agent
Key Takeaway: Download the SRT so the agent can read it—no manual copy‑paste.
Claim: Automating SRT retrieval eliminates brittle, manual transcript handling.
The SRT becomes the agent’s primary input.
Pipeline automation avoids human error and speeds iteration.
- Download the SRT via a simple HTTPS request.
- Pass the SRT contents (or link) into the agent.
- Treat the SRT as the ground truth for timestamps.
Prompt the Model with a Strict Output Schema
Key Takeaway: Constrain output to a JSON spec so you can auto‑call your zoom API.
Claim: A precise schema in the system prompt enables zero‑touch downstream automation.
Use an accessible, reliable model.
Define the system role and the exact payload shape.
Ask for JSON only—no extra text.
- Choose a free, reliable model for the demo.
- Set a system message: “You’re a social media video editor. Here’s the SRT.”
- Include the zoom API spec: start, end, type (in/out), strength, easing.
- Instruct: “Return a JSON array called segments in this exact structure.”
- Require: “Only this JSON and nothing else.”
Sanitize and Validate the Model’s JSON
Key Takeaway: Normalize the agent’s response so a stray character never crashes the job.
Claim: A small parser node that cleans and validates JSON prevents workflow failures.
Models sometimes output newlines or escapes that break parsers.
A guardrail node saves reruns and catches unexpected tokens.
- Receive the raw response from the agent.
- Strip extra newlines and fix escaped characters.
- Validate the JSON shape against the spec.
- If parsing fails, handle gracefully and apply common fixes.
- Output a payload ready for the zooming service.
Merge Data and Trigger the Zoom API
Key Takeaway: Keep everything in one object so the API call is deterministic and debuggable.
Claim: Merging SRT URL, cleaned segments, and metadata into a single payload simplifies execution.
The zoom job needs both timing and references.
Pin intermediate nodes to iterate faster in development.
- Merge SRT URL, normalized segments array, and metadata into one JSON.
- Call the zoom API to create the job.
- Poll status until the operation completes.
- Pin the SRT URL and generated segments during dev for speed.
Keep Captions Readable After Zoom
Key Takeaway: Adjust captions after scale transforms to prevent clipping and overlap.
Claim: Rendering captions post‑zoom or as an overlay maintains readability.
Zoom can change frame geometry and clip text.
Small styling tweaks prevent legibility issues.
- Increase caption font size thoughtfully and adjust vertical padding.
- If clipping appears, recreate captions after the zoom job finishes.
- Alternatively, render captions as an overlay track that reflows.
Extend to B‑roll Suggestions and Generation
Key Takeaway: The same transcript analysis that finds zooms can also drive B‑roll placement and sourcing.
Claim: Agent‑driven B‑roll yields better coverage than manual guessing.
Use mentions and emphasis to mark B‑roll ranges.
Auto‑fetch matching stock or synthesize simple visuals.
- Detect emphasis and key phrases from the SRT.
- Mark ranges suitable for B‑roll (e.g., “data visualization” at 01:22–01:38).
- Search stock libraries for matches or synthesize short animations.
- Brief the agent: “Add B‑roll for metaphors, statistics, and product shots.”
- Keep captions readable during B‑roll cutaways.
Why This Approach Beats Common Alternatives
Key Takeaway: Many tools are either manual, template‑bound, or pricey; the agent workflow strikes a balance.
Claim: An agent that understands prompts, analyzes transcripts, and outputs exact payloads provides a practical sweet spot.
Traditional keyframing is precise but manual.
Template‑driven editors can’t take natural language or generate missing footage.
Subscriptions can be overkill for quick social cuts.
- Desktop NLEs: powerful keyframes, but no smart analysis—manual workload stays high.
- Cloud templates: fast, but limited prompts and no asset generation.
- Heavy subscriptions: misaligned with lightweight social workflows.
- Agent approach: natural‑language goals, transcript analysis, precise API payloads, optional synthesis.
Practical Tips You Can Reuse Today
Key Takeaway: Small safeguards compound into big reliability gains.
Claim: JSON validation, pinning, and caption timing choices prevent common pipeline failures.
These tweaks came directly from the build.
They remove friction and reruns.
- Always validate the model’s JSON shape; a parser node saves reruns.
- Pin intermediate outputs during dev to avoid reprocessing.
- Render captions after transforms or use dynamic captions that reflow.
- Let the agent suggest B‑roll keywords and optionally auto‑fetch stock clips.
Replicate the Workflow: A Minimal Recipe
Key Takeaway: A clean SRT and an explicit schema are the backbone of this automation.
Claim: Clear prompts plus output sanitization enable end‑to‑end automation with minimal human touch.
Follow this to reproduce the demo (project: RJlOsNu_kcM).
The result feels editor‑made with hours shaved off.
- Start with a clean SRT from your edited clip.
- Make the output schema explicit in the system prompt.
- Sanitize and validate the agent’s JSON response.
- Merge SRT URL, segments, and metadata into one payload.
- Invoke the zoom API, create a job, and poll until complete.
- Adjust caption styling or render captions post‑zoom to avoid clipping.
- Use a prompt like: “Analyze this SRT and return an array of segments where a 1.2x zoom or a cut to B‑roll would add emphasis. Format the output as JSON segments with start, end, action, and intensity.”
Glossary
Key Takeaway: Shared vocabulary keeps prompts and payloads unambiguous.
Claim: Clear terms reduce schema errors and misaligned outputs.
- SRT: A subtitle file with text and timestamps used as a timing map.
- Agent: An AI process guided by prompts that analyzes inputs and outputs structured edits.
- Zoom API: An endpoint that applies zoom edits based on time‑coded segment payloads.
- Payload: The JSON object containing SRT URL, segments, and metadata for execution.
- B‑roll: Supplemental footage cut over the primary talking head for variety and emphasis.
- Sanitization: The process of cleaning and validating model output JSON.
- Pinning: Fixing node outputs during development to speed iteration.
- Easing: Acceleration/deceleration parameters that shape how a zoom feels.
- Overlay track: A caption layer rendered after edits so text reflows to the final frame.
- Dynamic captions: Captions that adjust layout to post‑transform geometry.
- Emphasis detection: Identifying moments in the transcript where visual emphasis helps.
FAQ
Key Takeaway: Quick answers to the most common workflow questions.
Claim: Addressing predictable blockers accelerates adoption of the pipeline.
- What does the SRT unlock here?
- It provides precise timestamps so the agent can place zooms and B‑roll deterministically.
- Why enforce a strict JSON schema in the prompt?
- It lets you auto‑call editing APIs without manual cleanup or parsing.
- How do I prevent broken JSON from the model?
- Sanitize the response: strip noise, fix escapes, validate shape, and retry on failure.
- When should captions be rendered?
- After zoom transforms or as an overlay track so text reflows and avoids clipping.
- Can the agent pick B‑roll automatically?
- Yes. It can mark ranges from transcript cues and fetch stock or synthesize simple clips.
- Do I need an expensive model?
- No. The demo used an accessible, free, reliable model with a strong system prompt.
- How do I speed up development cycles?
- Pin intermediate nodes (SRT URL, segments) and iterate without reprocessing upstream.
- What if the zoom placements feel off?
- Tweak the prompt rules (thresholds, intensity, easing) and rerun with the same SRT map.
- How does this compare to manual keyframing?
- You keep creative control but offload timestamp hunting and payload assembly to the agent.
- Where can I see a reference flow?
- The demo referenced project ID RJlOsNu_kcM for workflow specifics.