✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: July 2, 2026
  • 6 min read

Video2Code: Generating Interactive Webpages from UI Videos via Action-Aware Revisit

Direct Answer

Video2Code introduces a novel AI pipeline that converts UI demonstration videos into fully interactive webpages by automatically extracting visual layouts, element hierarchies, and the state‑transition logic triggered by user actions. This matters because it bridges the long‑standing gap between design mock‑ups and production‑ready code, enabling rapid prototyping and reducing manual front‑end effort.

Background: Why This Problem Is Hard

Designers and product teams frequently capture user flows as short videos—think of a product demo, a tutorial, or a recorded usability test. While these videos convey both the look of a page and the dynamic behavior when a button is clicked, turning that visual information into clean HTML, CSS, and JavaScript has remained a manual, error‑prone process.

Existing approaches fall into two camps:

  • Static screenshot‑to‑code tools that infer layout from a single frame but ignore interaction, resulting in static pages that lack the intended functionality.
  • Code‑generation from design files (e.g., Figma‑to‑React) that require designers to export structured assets. These pipelines break down when the source is a video, because the video does not expose a machine‑readable component tree or explicit event bindings.

The core difficulty lies in recovering action‑aware state transitions—knowing not only where a button is, but also what DOM changes occur after the click, what data is fetched, and how the UI animates. Traditional computer‑vision models excel at object detection but lack the temporal reasoning needed to link a user gesture to subsequent visual changes across frames.

What the Researchers Propose

The authors present Video2Code, a two‑stage framework that treats a UI video as a sequence of action‑aware revisits. The system first builds a coarse representation of the page layout, then iteratively refines it by revisiting frames where user actions occur, extracting the before‑and‑after visual states, and mapping those differences to DOM mutations.

Key components include:

  • Coarse Layout Encoder: A vision transformer that extracts a rough hierarchy of containers, text blocks, and interactive widgets from the video’s initial frames.
  • Action Detector: A temporal model that spots click, swipe, and hover gestures by analyzing motion vectors and audio cues (if present).
  • State‑Transition Reviser: For each detected action, the model re‑examines the surrounding frames, computes a visual delta, and translates that delta into a structured change set (e.g., add class, modify attribute, inject script).
  • Code Synthesizer: A language model fine‑tuned on paired UI‑code datasets that consumes the refined layout and change set to emit clean HTML, CSS, and JavaScript.

How It Works in Practice

The end‑to‑end workflow can be visualized as a pipeline:

Video2Code pipeline diagram

  1. Video Ingestion: The raw UI video is split into uniformly spaced frames and pre‑processed for resolution consistency.
  2. Initial Layout Extraction: The Coarse Layout Encoder processes the first few seconds, producing a provisional DOM tree with placeholder IDs.
  3. Action Spotting: The Action Detector scans the entire timeline, flagging timestamps where user input occurs.
  4. Action‑Aware Revisit: For each flagged timestamp, the State‑Transition Reviser pulls the pre‑action frame and the post‑action frame, computes visual differences, and annotates the provisional DOM with mutation instructions.
  5. Iterative Refinement: The system loops back, feeding the updated DOM into the Layout Encoder to resolve any newly revealed elements (e.g., modal dialogs that appear only after a click).
  6. Code Generation: Once the DOM and its mutation graph stabilize, the Code Synthesizer generates production‑ready HTML, CSS, and JavaScript, optionally formatting the output for frameworks like React or Vue.

What sets Video2Code apart is the revisit mechanism: instead of a single pass, the model actively returns to earlier frames with the context of later actions, ensuring that dynamic elements are not missed and that the generated code faithfully reproduces the original interaction flow.

Evaluation & Results

The researchers evaluated Video2Code on two benchmark suites:

  • UI‑Video‑100: A curated set of 100 publicly available UI demonstration videos spanning e‑commerce, SaaS dashboards, and mobile apps.
  • Action‑Rich Demo Set: 30 videos specifically selected for complex multi‑step interactions, such as drag‑and‑drop, accordion expansions, and asynchronous data loading.

Key findings include:

  • Layout Accuracy: Video2Code achieved a mean Intersection‑over‑Union (IoU) of 0.87 for element bounding boxes, outperforming the best static screenshot baseline by 14%.
  • Interaction Recovery: The system correctly identified 92% of user actions and reproduced the corresponding DOM mutations, compared to 68% for a prior video‑to‑code prototype.
  • Code Quality: Human evaluators rated the generated code as “clean” or “very clean” in 81% of cases, with minimal manual edits required to achieve functional parity.
  • End‑to‑End Speed: Average processing time per minute of video was 3.2 minutes on a single GPU, making the approach viable for batch processing in CI pipelines.

These results demonstrate that Video2Code not only reconstructs static layouts but also captures the dynamic behavior that defines modern web experiences.

Why This Matters for AI Systems and Agents

For AI‑driven product teams, the ability to auto‑generate interactive webpages from video opens several strategic pathways:

  • Rapid Prototyping: Agents can ingest a design video uploaded by a stakeholder and instantly spin up a working prototype, shortening the feedback loop from days to minutes.
  • Automated Documentation: Documentation bots can generate live demos directly from tutorial videos, ensuring that code samples stay in sync with visual guides.
  • Cross‑Platform Consistency: By extracting a canonical DOM and interaction graph, agents can render the same UI on web, mobile, or embedded devices without re‑authoring code.
  • Integration with Orchestration Platforms: The generated code can be fed into workflow automation tools to trigger downstream actions, such as populating a CMS or updating a feature flag.

Practically, teams using the UBOS platform overview can plug Video2Code’s output into the Web app editor on UBOS, allowing non‑technical designers to iterate on UI videos and instantly see production‑grade code. Moreover, the Workflow automation studio can orchestrate the entire pipeline—from video upload to deployment—without manual intervention.

What Comes Next

While Video2Code marks a significant leap, several limitations remain:

  • Audio‑Driven Interactions: Current models ignore spoken instructions that could disambiguate ambiguous gestures.
  • Complex Data Binding: The system captures DOM mutations but does not yet infer the underlying API contracts or state management logic.
  • Scalability to Long‑Form Videos: Processing videos longer than a few minutes still incurs noticeable latency.

Future research directions include:

  • Integrating multimodal speech‑to‑action models to leverage narration.
  • Coupling the generated DOM with program synthesis techniques that infer data fetching patterns (e.g., GraphQL queries).
  • Optimizing the revisit loop with sparse attention mechanisms to handle hour‑long recordings.

From an industry perspective, we anticipate that Video2Code‑style pipelines will become a core component of Enterprise AI platform by UBOS, enabling large organizations to automate UI migration, legacy modernization, and rapid A/B testing directly from stakeholder videos.

For readers who want to explore the technical details, the full pre‑print is available on Video2Code paper. The authors also release their codebase under an open‑source license, inviting the community to extend the action‑aware revisiting paradigm to AR/VR interfaces and beyond.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.