video test#1
Open
wocanbe wants to merge 7 commits into
Open
Conversation
added 7 commits
July 6, 2026 18:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTML Animation to Video Generation System
Project Overview
This project implements an AI-powered HTML-to-Video generation system.
The system allows AI-generated web pages (HTML/CSS/JavaScript animations) to be automatically rendered in a real browser environment and converted into video files.
The core idea is:
Instead of generating videos from traditional graphics pipelines, this project treats modern web pages as a new form of dynamic video content.
Potential use cases include:
Technology Selection
Why Not Generate Videos Directly with Canvas?
Canvas is a powerful graphics rendering solution and can be directly recorded using browser APIs such as
MediaRecorder.However, Canvas has limitations when the goal is to support arbitrary AI-generated web content.
Modern web pages are not limited to canvas rendering. They may contain:
For example:
This type of animation is controlled by the browser rendering engine rather than Canvas.
Supporting all HTML capabilities through Canvas would require rebuilding a browser rendering engine, which is impractical.
Therefore, this project uses:
Advantages:
Video Format Decision
Why MP4 Instead of WebM?
Browser-based recording commonly produces:
However, this project outputs:
because of better ecosystem compatibility.
HLS / M3U8 Compatibility
The future video delivery pipeline is designed as:
The HLS ecosystem has much stronger support for:
WebM has limited support in traditional HLS workflows, especially for:
Therefore, MP4 provides better compatibility for large-scale video distribution.
System Workflow
The complete workflow:
System Architecture
Core Implementation
1. Browser Rendering with Puppeteer
The system uses Chromium Headless through Puppeteer.
Responsibilities:
Example:
This ensures the final video matches the actual browser rendering result.
2. Video Encoding with FFmpeg
FFmpeg handles:
Pipeline:
Containerized Video Worker
The video generation environment runs as an isolated container:
Including:
Benefits:
Environment Isolation
Avoid conflicts between:
Horizontal Scaling
The architecture can scale horizontally:
Multiple workers can process video generation jobs concurrently.
Future Improvements
1. Separate Video Generation Service
Current:
Future:
Benefits:
2. Record Specific DOM Regions
Current implementation captures the full browser viewport.
Future support:
{ "selector": "#animation", "width": 800, "height": 600 }Possible applications:
3. Configurable Video Parameters
Allow users to customize:
Resolution
Frame Rate
Duration
Codec
4. Improve Capture Performance
Current pipeline:
Future optimization:
Goals:
5. Job Status Management
Introduce a complete job lifecycle:
Additional features:
Project Highlights
Browser-level rendering solution supporting full HTML/CSS/JavaScript animation capabilities
Containerized video workers enabling isolation and horizontal scaling
MP4/H.264 output optimized for video distribution and future HLS streaming
Asynchronous job architecture suitable for AI-generated content workflows
Extensible foundation for an AI-powered video generation platform
Project Positioning
This project is not just a screen recording tool.
It is: