Week 5.1: Infinite Content Translation Pipeline
Week 5.1 Resources: Infinite Content Translation Pipeline
Required Software & Tools
This week builds heavily on the Week 4 foundation. Ensure you have the previous tools installed, plus the following:
- FFmpeg: Required for video assembly and frame rate conversion.
- Download FFmpeg (Ensure it is added to your system PATH).
- ElevenLabs API: Required for generating the translated voiceovers.
- ElevenLabs Console (Ensure you have an API key in your
.envfile).
- ElevenLabs Console (Ensure you have an API key in your
- Visual Studio Code & Claude Code: (Standard setup from previous weeks).
Project Structure Concept
In this lesson, we introduce a Variations folder structure to handle multiple languages without duplicating heavy media assets (images).
project_root/
└── variations/
└── spanish/
├── data/ (Translated script, lines, segments)
└── media/ (Generated Spanish audio files)Class Prompts & Workflow Logic
You can use these prompts within Claude Code to generate the specific workflow files created in the lesson.
1. Text Translation Workflow
This workflow handles the translation of the script and YAML files while preserving image paths.
Create the translation logic:
CREATE workflows/create_short_form_translation/translate_text_assets.md
- Inputs: project_name, language, script_path
- Steps:
1. Create a [translated_script_path]
2. Translate the script to the specified [language]
3. Create [translated_lines_path] and [translated_segments_path]
4. CRITICAL: The translated lines must perfectly match the translation in the script path.
5. CRITICAL: DO NOT COPY the AUDIO file paths (we will generate new ones).
6. CRITICAL: DO COPY the IMAGE paths (we reuse the original images).2. Audio Generation Workflow
This workflow generates the new voiceovers for the translated text.
Create the audio generation logic:
CREATE workflows/create_short_form_translation/generate_translated_audio.md
- Inputs: project_name, language
- Read: tools.md, [data_folder]/lines.yaml
- Steps:
1. For each line in the script, use ElevenLabs tools to create audio in the specified [language].
2. Save audio to variations/[language]/media/
3. Update the [data_folder]/lines.yaml with the new audio paths relative to project root.3. Video Assembly Workflow (With FFmpeg Fix)
This workflow stitches the original images with the new audio. Note: This includes the fix for the Windows Media Player “black screen” issue discovered in the video.
Create the assembly logic:
CREATE workflows/create_short_form_translation/assemble_translated_video.md
- Inputs: project_name, language
- Steps:
1. Use FFmpeg to combine images and audio into a video.
2. Use images from the original [media_folder] (but NOT the audio).
3. Use audio from the [translated_media_folder].
4. Display the image for each segment for the combined duration of line audios.
5. Use a constant frame rate (e.g., -r 25 -vsync cfr) to ensure compatibility.
6. Save result to output/[language]/[project_name].mp44. The Orchestrator (Master Workflow)
This file chains the previous three workflows together into a single command.
Create the master workflow:
CREATE workflows/create_short_form_translation/create_short_form_translation.md
- Inputs: project_name, language
- Steps:
1. Use a sub-agent to run workflows/create_short_form_translation/translate_text_assets.md
2. Use a sub-agent to run workflows/create_short_form_translation/generate_translated_audio.md
3. Use a sub-agent to run workflows/create_short_form_translation/assemble_translated_video.mdDebugging Techniques (The “UltraThink”)
In the video, we encountered a bug where the output video played audio but showed no video in Windows Media Player. Here is the prompt used to diagnose and fix the FFmpeg encoding issue:
Diagnosing the Codec Issue:
The hindi video plays sound but doesn't show video in windows media player. It properly plays sound and video in VLC player. The portuguese video plays properly in both players. What's going on? only answer, don't fix. ultrathinkThe Solution:
The issue was Variable Frame Rate (VFR) vs Constant Frame Rate (CFR). The fix required adding -r 25 (or -r 30) to the FFmpeg command to enforce a constant frame rate.
Execution Command
Once the workflows are set up, you can run the entire translation pipeline with a single command in Claude Code:
To Translate a Project:
/create_short_form_translation project_name=mermaids language=spanish(Note: You may need to register this as a slash command in your settings.json or run it via run workflows/...)