Programmatic Video Generation with Text-Only Large Language Models
Text-only large language models cannot see images or video, but they can still generate videos by producing structured, executable scene descriptions and rendering code. This article explains a reproducible pipeline covering storyboarding, code generation, deterministic rendering, editing, voice synthesis, synchronization, quality control, cost considerations, and deployment practices.
A text-only large language model cannot see images or video. This is often interpreted as meaning that it cannot create video. However, if a video is represented as a sequence of frames on a timeline, and each frame or shot is described as an executable interface and animation specification, a rendering engine can draw and encode the output with precise timing. The model only needs to process text and code; it does not need to understand pixels.
This approach turns video generation into the generation of a renderable program. It offers predictable costs, reproducible results, and a natural fit for automated production pipelines.
1. The Core Problem: Video Is a Programmable Timeline
A finished video can be abstracted as a collection of shots, including:
- Shot duration and timing
- Composition and camera or object movement
- Captions and graphic overlays
- Transitions
- Audio tracks
Traditional production relies on manual editing or multimodal models that generate video directly. A text-only model cannot see the visual output, but it is effective at producing structured artifacts such as shot scripts, timecodes, component trees, animation parameters, and subtitle tracks. As long as a downstream engine can accurately render frames from those descriptions, the model does not need visual perception.
Three principles are especially important.
First, descriptions must be executable. Avoid expressions such as “use a cool camera movement,” which cannot be implemented directly. Instead, specify position, opacity, scale, easing curves, and start and end times.
Second, time must be discrete and aligned. Use frames or milliseconds as the timing unit, and define the audio sample rate and video frame rate in advance.
Third, visuals should be represented with declarative components. Reusable units such as title cards, cards, charts, character placeholders, and subtitle bars should be instantiated by code rather than produced as one-off, unmaintainable pixels.
2. Recommended Pipeline: Script, Code, Rendering, Compositing, and Voice
A complete workflow can be divided into five stages. Each stage should have clearly defined inputs and outputs to simplify troubleshooting.
1. Planning and Storyboarding
The inputs include the topic, duration, target audience, and brand constraints. The model produces a storyboard containing the shot number, duration, narration points, visual elements, and transition type.
Field validation should be enforced. If a shot has no duration or visual elements, it should be rejected and rewritten.
2. Compiling the Storyboard into Rendering Code
Each shot is mapped to a component tree consisting of layers such as:
- Background
- Main subject
- Decorative elements
- Subtitles
Animations are expressed as keyframes. For example, opacity might change from 0 to 1 during the first 0–400 milliseconds, followed by a position animation from 400 milliseconds to 2 seconds.
Colors, font sizes, and margins should come from design tokens instead of being chosen freely by the model each time. The output should be a compilable project file, not prose.
3. Rendering Frame by Frame or by Time Slice
The rendering system should accept only code and a resource manifest. It samples the timeline and composites the visual output. Static shots can be cached, while animated shots are rendered at the target frame rate.
The result is encoded into a standard video container format. The model does not need to remain online during this stage, which helps keep the visual output stable.
4. Editing and Compositing
The production toolchain should provide reusable capabilities such as:
- Cropping
- Speed changes
- Crossfades
- Picture-in-picture layouts
- Multitrack alignment
- Loudness normalization
- Subtitle burning
These capabilities should be orchestrated through tools or service interfaces rather than having the model manipulate pixels directly. The model only needs to produce timeline JSON containing tracks, clip in and out points, and effect parameters.
5. Voice Generation and Audio-Visual Alignment
The model generates narration text from the storyboard. A speech synthesis system then produces the audio track.
Forced alignment or subtitle timestamps can be used to write timing information back into the visual timeline, preventing mismatches between speech and captions. Background music and sound effects should remain separate tracks, with sufficient loudness headroom to prevent them from overpowering the narration.
For a cloud deployment, source materials and rendered videos can be stored in object storage. A message queue can decouple tasks, while rendering runs on a container platform. Process information should be written to a logging service, and failed jobs should be retried through monitoring and alerting. Billing and quotas can be tracked per task without tying the architecture to a particular vendor or proprietary product design.
3. Helping a Text-Only Model Generate Renderable Code
Because the model cannot see the visual output, quality depends heavily on constraints. The following practices are useful:
- Provide a component catalog and a props contract, and prohibit the model from inventing components that do not exist.
- Use JSON Schema or type definitions to constrain the shot structure.
- Provide a small number of high-quality examples, such as reference storyboards, to make the output style more consistent.
- Clamp numeric ranges for font sizes, contrast, and safe areas to prevent content from leaving the frame or becoming unreadable.
- Generate in stages: structure first, styling second; static frames first, animation second. This reduces structural errors caused by overly long outputs.
- Add automatic validation. Compilation failures, missing resources, overlapping timelines, and incorrect total durations should trigger local rewrites instead of regenerating the entire video.
An illustrative shot description might look like this:
scene:id: 03duration_ms: 4000layers:- type: titletext: "Quarterly Growth Overview"enter: { opacity: [0,1], t: [0,400] }- type: bar_chartdata_ref: "metrics.q3"highlight: "revenue"subtitle:text: "Revenue increased quarter over quarter, driven mainly by repeat purchases"t: [600, 3800]
The downstream system translates this structure into actual drawing instructions. The model continues to work with structured text throughout the process.
4. Quality Control: How to Ensure Watchable Output Without Visual Perception
When visual feedback is unavailable, rules and sampling must replace the practice of simply looking at the video. Important checks include the following.
Readability
Validate contrast, minimum font size, line length, and safe margins.
Timing
A shot that is too short may not give viewers enough time to read, while one that is too long may feel slow. Estimate narration duration from the word count, then use it to determine the visual timing.
Information Density
Each shot should communicate one main point. A chart should generally emphasize only one series at a time.
Brand Consistency
Colors and fonts should be loaded from design tokens. The model should not freely invent hexadecimal color values.
Frame Sampling
Export key frames as still images for manual spot checks. Reviewing representative frames is more efficient than manually watching every generated video.
Regression Testing
Maintain a fixed set of scripts and compare duration, subtitle completeness, and audio volume after each version upgrade.
5. Cost, Risks, and Appropriate Use Cases
Compared with repeatedly calling expensive multimodal or cloud-based video generation services, a text model deployed locally or privately together with a self-managed renderer has marginal costs that are mainly associated with compute and encoding.
This approach is well suited to templated content such as:
- Data reports
- Course chapters
- Product explanations
- Internal training materials
It is less suitable for content that depends heavily on real-world cinematography, complex physical behavior, or difficult-to-describe lighting and visual effects.
For copyright compliance, the source of every asset should be traceable. People and trademarks should not be generated or used without authorization.
For security, rendering code must run in a sandbox, and the model must not be allowed to output arbitrary system commands. For privacy, narration content and business data should be isolated according to access permissions.
Common failures include:
- Animation parameters that cannot be implemented
- Subtitles extending beyond the frame
- Inconsistent audio and video clocks
- Transitions overlapping with peaks in the narration
The corresponding countermeasures are contract validation, static-frame pre-rendering, a unified time base, and fixed loudness and ducking rules in the compositor.
6. Practical Implementation Recommendations
Start with a 30- to 60-second template and complete the full workflow from storyboard to code, rendering, and voice generation.
Treat the component library as a product that requires ongoing maintenance instead of describing every visual from scratch. The timeline and resource manifest should serve as the single source of truth. The model should be responsible only for producing these two types of artifacts.
Monitor task success rate and first-pass completion rate, not just generation speed. When elasticity is required, rendering and voice generation can run on a container cluster, while storage and queues use general-purpose cloud services to handle demand spikes.
Conclusion
Text-only models can generate video not by “seeing” the scene, but by compiling visual language into a program. Structured storyboards, component contracts, deterministic rendering, tool-based compositing, and alignable voice generation form the foundation of this workflow.
With these elements in place, stable video production is possible without multimodal perception. The cost model also shifts from expensive per-call generation toward predictable, manageable engineering capacity.
