# Veo3 Short-Form Story Generator — Product Requirements Document (PRD) --- ## 1. Purpose Create a tool that generates a 30-second short-form video story featuring a single, consistent character (e.g., a stormtrooper) by chaining together three 8-second video clips generated by the Veo 3 model. The tool must minimize unnecessary API calls due to the high cost ($5 per 8s video) and ensure character consistency across scenes. --- ## 2. Background & Motivation Short-form video content is highly engaging, but current AI video models (like Veo 3) are limited to short clips (8 seconds). By chaining multiple generations together, we can create longer, more narrative-driven content. Ensuring character consistency (e.g., always a stormtrooper) is key for story coherence. **API usage is expensive, so efficiency and careful prompt design are critical.** --- ## 3. Requirements ### Functional - **Web UI:** Users interact via a web interface. - **Character Selection:** User chooses a character (e.g., "stormtrooper") from templates or custom input. - **Prompt Input:** User writes a story prompt. The system uses this to generate three scene scripts (system prompt to script splitting). - **Prompt Review:** User reviews and confirms the three generated scene prompts before any API call (with cost warning). - **Veo 3 Integration:** For each scene, generate an 8-second video using the Veo 3 API, ensuring prompts reinforce character consistency. - **Video Chaining:** Concatenate the three generated clips into a single video (approx. 24 seconds). - **Output:** Deliver a downloadable or shareable video file in **mp4** format. ### Non-Functional - **Reliability:** Handle API errors, retries, and ensure all clips are generated before chaining. - **Performance:** Reasonable generation and processing time (target: <5 minutes per story). - **Cost Awareness:** Minimize API calls, require user confirmation before each generation, and provide cost estimates. - **Scalability:** Design for future extension (e.g., more scenes, user-uploaded characters, etc.). --- ## 4. User Flow ```mermaid flowchart TD A[User selects character & writes prompt] --> B[System generates 3 scene scripts] B --> C[User reviews & confirms scripts (cost warning)] C --> D[Tool calls Veo 3 API for each scene] D --> E[Download generated clips] E --> F[Concatenate clips into one mp4 video] F --> G[User downloads or shares final video] ``` --- ## 5. Technical Considerations ### Stack - **Node.js with Express** for backend server and API endpoints - **Static HTML/CSS/JavaScript** for simple web UI - **@fal-ai/client** for Veo 3 API integration - **fluent-ffmpeg** for video concatenation - **OpenAI API** for generating scene scripts from user prompts ### Cost Control - **Prompt user before each API call with cost warning** - **Log all API calls and costs** - **Allow dry-run mode for prompt review without generation** ### Video Chaining - Use `fluent-ffmpeg` to concatenate mp4 files --- ## 6. Example Prompt Template > Character: Stormtrooper > > Prompt: "A stormtrooper vlogs their day in three scenes." > > Scene 1: "A stormtrooper stands in a bustling city square, vlogging about their day. The scene is lively, with futuristic vehicles passing by." > > Scene 2: "The same stormtrooper now sits in a quiet café, talking to the camera about their favorite drink. The ambiance is cozy and warm." > > Scene 3: "The stormtrooper ends the vlog on a rooftop at sunset, reflecting on the day's adventures. The city skyline glows in the background." --- ## 7. Cost Table | Action | API Calls | Cost per Call | Total Cost | |-----------------------|-----------|---------------|------------| | Generate 1 video | 1 | $4 | $4 | | Generate 3 videos | 3 | $4 | $12 | | Concatenate videos | 0 | $0 | $0 | | **Total per story** | 3 | $4 | **$12** | --- ## 8. Open Questions (Answered) - **Web UI:** Yes, the tool will have a web UI. - **Prompt Templates & Character Selection:** User selects a character and writes a prompt; system generates 3 scene scripts. - **Intro/Outro:** No intro or outro. - **Background Music/Narration:** Not required. - **Output Format:** mp4. --- ## 9. References - [Veo 3 API Docs](https://fal.ai/models/fal-ai/veo3/api) - [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg) - [@fal-ai/client npm](https://www.npmjs.com/package/@fal-ai/client) --- ## 10. Summary Diagram ```mermaid flowchart LR subgraph User U1[Select character & write prompt] U2[Review & confirm 3 scene scripts] U3[Download final mp4 video] end subgraph Backend B1[Generate 3 scene scripts] B2[Call Veo 3 API (x3)] B3[Download clips] B4[Concatenate clips] end U1 --> B1 B1 --> U2 U2 --> B2 B2 --> B3 B3 --> B4 B4 --> U3 ```