Batch Short Video Production with Large Language Models: A Practical Guide
This guide explains how to build a pipeline that produces short videos in batches with large language models. It covers splitting production into stages, separating the control plane from the data plane, using structured prompts and storyboard templates, deduplicating and caching outputs, scheduling work with queues and retries, and running automated quality and compliance checks.
1. Reframing the Problem: From Single Generation to Pipeline Throughput
Generating dozens of original videos within minutes may sound like the work of a single tool. In engineering terms, however, it is better understood as a throughput target for a content production pipeline. Once templates, asset pools, prompt assets, and rendering services are warmed up, the system uses task decomposition, concurrent scheduling, cache reuse, and automated quality checks to keep producing publishable videos at a rate measured in minutes. The system does not need to generate any single video from scratch, one step after another, within one minute.
The core problem, then, is not finding a large model button. It is designing a reusable production system that splits short video production into stages that can run in parallel:
- Topic and script stage: Generate topics, titles, voiceover scripts, shot descriptions, subtitle text, and publishing metadata.
- Multimodal asset stage: Based on the storyboard, generate or retrieve visuals, voiceovers, background music, transitions, and stickers.
- Composition and rendering stage: Assemble shots, subtitles, audio tracks, covers, and end cards according to templates.
- Quality and compliance stage: Check duration, resolution, audio-video sync, sensitive content, copyright risk, and labels for AI-generated content.
- Publishing preparation stage: Generate covers, tags, descriptions, scheduled publishing plans, and archive records.
Only when these stages are decoupled can a stable production system be built using message queues, concurrent workers, object storage, state machines, and monitoring and alerting. At the infrastructure level, general-purpose services from Baidu AI Cloud, including object storage, message queues, container platforms, log services, and monitoring and alerting, can host asset storage, task decoupling, elastic execution, and observability.
2. Architecture: Separating the Control Plane from the Data Plane
We recommend a layered architecture with a control plane and a data plane.
- Control plane: Handles task orchestration. It receives batch requests, builds task lists, maintains state machines, and controls concurrency, rate limits, retries, and priorities.
- Data plane: Handles content production. It runs script generation, speech synthesis, visual generation, asset retrieval, video rendering, quality checks, and transcoding.
- Object storage holds assets, intermediate outputs, finished videos, and covers. A relational database stores task states, template versions, prompt versions, and review records. A message queue smooths traffic peaks. Logging and monitoring track throughput, failure rates, and latency distributions.
The task state machine can be designed as follows: Pending script generation → Script completed → Generating assets → Rendering → Quality check → Ready to publish / Archived. Every state transition must be idempotent. In other words, consuming the same task message more than once must not produce duplicate videos or duplicate charges. Failed tasks go to a retry queue. Tasks that exceed the retry limit go to a dead-letter queue, where engineers investigate them manually.
3. Content Generation: Structured Prompts and Storyboard Templates
Batch production breaks down when each video is written from scratch. Prompts should be managed as versioned assets. Variables such as topic, audience, style, duration, aspect ratio, selling points, banned words, factual constraints, and calls to action should be injected into prompt templates. Ask the large language model to return structured JSON containing fields such as title, voiceover script, shot list, visual description for each shot, subtitles, transitions, sound effect suggestions, cover copy, and tags. Structured output is easier for downstream programs to parse and validate.
Storyboard templates should limit the number of shots, the duration of each shot, and the length of subtitles. This prevents the model from producing structures that cannot be rendered. Example fields include shot_id, duration, visual_prompt, subtitle, transition, and voice_emotion. After script generation, run rule-based checks: Does the total duration match the target? Are any subtitles too long? Does the script include banned words? Do any factual statements need human review? Only scripts that pass these checks move on to the asset stage.
For the multimodal stage, use a mix of generation and retrieval. Use generative models for shots that need creative content, and pull generic establishing shots, backgrounds, and icons from a licensed asset library. This reduces uncertainty and cost. Voiceovers, subtitles, and background music are generated as separate assets, and a template rendering service combines them at the end.
4. Batch Core: Template Matrices, Deduplication, and Caching
Batch variation cannot come from swapping synonyms. Build a template matrix that combines a topic matrix, an audience matrix, a narrative structure matrix, a visual style matrix, and a cover style matrix. The system samples tasks from this matrix and uses random seeds to make results reproducible. Each task records its seed, template version, prompt version, and asset sources so that it can be traced and reproduced.
The deduplication strategy includes script fingerprinting, subtitle text similarity checks, visual asset hashing, and metadata comparison for finished videos. Tasks that are too similar to others are sent back for resampling. To keep content original, focus on varying the script structure, licensing every asset with a traceable source, using different narrative angles, and combining covers and titles in different ways. Simply concatenating clips does not make content original.
Caching can significantly increase throughput. Script drafts for the same topic, common voiceover segments, intros and outros, background music, transition animations, and intermediate rendered frames can all be cached. Cache keys consist of the template version, a hash of the prompt, asset hashes, and parameters. On a cache hit, the system reuses the stored result directly, which reduces repeated generation and rendering.
5. Scheduling and Concurrency: Queues, Rate Limits, Retries, and Idempotency
Batch tasks should not run as synchronous, serial calls. We recommend using message queues to decouple stages, with worker pools that scale independently for each stage. Script generation can run at high concurrency. Rendering is resource-intensive, so it needs its own rate limit. Quality checks can run asynchronously. Each task carries a unique task_id and a stage version number. Consumers check the task state before processing, which prevents duplicate work.
Retry behavior should depend on the error type. Network timeouts, rate limit errors, and temporary service outages can use exponential backoff. Content moderation failures, invalid parameters, and missing assets should fail immediately, with the reason recorded. Set timeouts, circuit breakers, and concurrency limits for calls to third-party services to prevent cascading failures. At a minimum, monitor the number of tasks per minute, the success rate for each stage, P95 latency, queue backlog, retry rate, dead-letter count, and average cost per video.
For capacity planning, use the general formula: stage throughput ≈ number of concurrent workers ÷ average processing time per task. If rendering takes a long time per task, increase the number of workers, split shot rendering, pre-render template segments, and merge transcoding in batches to raise throughput. The “30 videos within minutes” target comes from pipeline parallelism, not from speeding up a single video’s serial processing.
6. Quality and Compliance: Automated Checks, Manual Sampling, and Copyright Management
Batch production requires quality controls. Automated checks can verify resolution and aspect ratio, duration, black frames, silence, audio-video sync, subtitle typos, sensitive words, cover completeness, and whether the file can be played. For compliance, maintain a licensing ledger that records the source and permitted use of every image, music track, font, and video clip. Add labels for AI-generated content as required by applicable rules. Review factual content through manual sampling. Set blocking rules for privacy, likeness, and trademark risks.
Before publishing, run manual spot checks. Adjust the sampling rate based on business risk. Archive all review records, version information, and revision history so that every video can be traced.
7. Pseudocode for Batch Task Orchestration
function build_batch(topics, templates, count):tasks = []for i in range(count):seed = stable_hash(topics[i % len(topics)] + templates[i % len(templates)] + i)task = {task_id: new_id(),topic: topics[i % len(topics)],template_version: templates[i % len(templates)],seed: seed,state: "WAIT_SCRIPT"}tasks.append(task)return tasksfunction worker_loop(queue):while true:msg = queue.consume()task = load_task(msg.task_id)if not can_transition(task, msg.stage):ack(msg); continuetry:result = execute_stage(task, msg.stage)save_asset(result)transition(task, next_state(msg.stage))ack(msg)except RetryableError:requeue_with_backoff(msg)except FatalError as e:mark_failed(task, e); send_to_dead_letter(msg)
8. Rollout Steps and Common Pitfalls
Rollout takes four steps. First, define the templates and the structured output specification. Second, set up the task queue, object storage, and state machine. Third, connect the script, voiceover, visual, and rendering capabilities, then run a small batch load test. Fourth, add quality checks, monitoring, cost accounting, and publishing archives.
Common mistakes include treating batch production as simple word swapping, ignoring asset copyright, lacking idempotency and therefore processing messages twice, mixing generation and rendering in one queue so that they block each other, optimizing only for volume without manual sampling, and failing to record template and prompt versions, which makes results impossible to reproduce. Validate end-to-end success rates with a small batch first, then raise concurrency gradually.
9. Summary
Producing original short videos in batches within minutes is an engineering system. It combines large language model generation, template matrices, asynchronous queues, concurrent scheduling, caching and deduplication, automated quality checks, and compliance review. Developers should split video generation into stages that can run in parallel, be observed, and be retried. Structured prompts keep quality under control, versioned assets make results reproducible, and monitoring and manual sampling protect stability and compliance. With these pieces in place, generation capability becomes a sustainable content production line rather than a one-time demo.
