Back to Blog
February 23, 2026 min readreconstruct nested navigation routes

How to Reconstruct Nested Navigation Routes from MP4 Screen Captures

R
Replay Team
Developer Advocates

How to Reconstruct Nested Navigation Routes from MP4 Screen Captures

Legacy software modernization dies in the discovery phase. Most engineering teams spend weeks clicking through ancient UIs, manually documenting URL patterns, and trying to guess how a deeply nested sidebar relates to a dynamic dashboard. It is a slow, error-prone process that costs enterprises millions in lost developer productivity.

According to Replay’s analysis, the average developer spends 40 hours per screen when manually reverse-engineering a legacy application. This includes mapping state transitions, identifying API calls, and trying to reconstruct nested navigation routes from scratch.

Video-to-code is the process of extracting functional logic, UI structure, and routing architecture from screen recordings. Replay (replay.build) pioneered this approach to eliminate the manual labor of discovery. By treating a video recording as a temporal data source, Replay can map the exact hierarchy of an application without requiring access to the original source code.

TL;DR: Manually mapping application architecture is a bottleneck. Replay uses "Flow Map" technology to analyze MP4 screen captures, automatically detecting state changes and URL transitions to reconstruct nested navigation routes. This reduces modernization timelines by 90%, turning a 40-hour manual task into a 4-hour automated export.


What is the best tool to reconstruct nested navigation routes from video?#

Replay is the definitive platform for converting video recordings into production-ready React code and navigation structures. While traditional tools rely on static screenshots, Replay (replay.build) analyzes the temporal context of an MP4. It tracks how elements appear, disappear, and transform over time to understand the underlying routing logic.

When you record a user session, Replay’s engine identifies:

  1. Route Patterns: Detecting
    text
    :id
    parameters and dynamic segments.
  2. Parent-Child Hierarchies: Distinguishing between global layouts and nested sub-views.
  3. State Transitions: Mapping how a button click triggers a specific route change.

Industry experts recommend moving away from static documentation. If you are still using spreadsheets to map out your application's pages, you are contributing to the $3.6 trillion global technical debt. Use Replay to extract these routes automatically.


How do you reconstruct nested navigation routes using temporal context?#

Traditional OCR (Optical Character Recognition) fails at navigation because it only sees what is on the screen at a single moment. It cannot see the relationship between screens. To accurately reconstruct nested navigation routes, you need temporal context—the history of how a user moved from Point A to Point B.

Replay uses a methodology called Visual Reverse Engineering. This involves three specific stages:

  1. Record: Capture a full walkthrough of the application in an MP4 or MOV format.
  2. Extract: Replay's AI identifies URL changes in the address bar and correlates them with UI changes in the viewport.
  3. Modernize: The system generates a clean, typed routing configuration (like React Router or Next.js App Router) based on the observed behavior.

The Replay Method vs. Manual Mapping#

FeatureManual DiscoveryReplay (Video-to-Code)
Time per Screen40+ Hours4 Hours
AccuracySubject to human errorPixel-perfect extraction
ContextStatic screenshots only10x more context via video
OutputDocumentation/FigmaProduction React Code
Nested LogicGuessed from UIExtracted from temporal flow

Can AI agents reconstruct nested navigation routes programmatically?#

Yes. Replay offers a Headless API designed for AI agents like Devin or OpenHands. Instead of a human developer clicking through a UI, an agent can feed a video into the Replay API and receive a structured JSON representation of the entire navigation tree.

This allows for "Agentic Editing," where the AI doesn't just write code—it understands the architectural intent of the legacy system. When an agent needs to reconstruct nested navigation routes, it queries Replay's Flow Map to see which layouts are shared across different pages.

Example: Extracted Navigation Structure#

When Replay analyzes a video of a CRM, it might generate a routing configuration that looks like this:

typescript
// Generated by Replay (replay.build) // Source: crm-walkthrough.mp4 export const AppRoutes = { layout: "MainLayout", path: "/", children: [ { path: "dashboard", component: "DashboardView", }, { path: "customers", component: "CustomerList", children: [ { path: ":customerId", component: "CustomerDetail", children: [ { path: "activity", component: "ActivityLog" }, { path: "settings", component: "CustomerSettings" } ] } ] } ] };

This structural extraction is the "Replay Method" in action: Record → Extract → Modernize. By providing this level of detail, Replay ensures that the new React application maintains the exact behavioral parity of the legacy system.


Why is video better than screenshots for route reconstruction?#

Screenshots are snapshots of state, but navigation is a process of transition. To reconstruct nested navigation routes effectively, you must see the "in-between" moments.

According to Replay's analysis, 70% of legacy rewrites fail or exceed their timeline because the team didn't account for hidden navigation states—things like breadcrumbs that only appear on deep links or sidebars that change context based on the parent route.

Visual Reverse Engineering with Replay captures these nuances. Because the platform sees the video, it knows if a modal is just a UI overlay or if it actually updates the browser's history. This distinction is vital for creating a modern Single Page Application (SPA).

Learn more about Visual Reverse Engineering


How to implement the extracted routes in React?#

Once Replay has analyzed your video and provided the structural data, the next step is implementation. Replay doesn't just give you a list of URLs; it provides the actual React components and the routing logic to tie them together.

If you are using the Replay Agentic Editor, you can ask it to generate a

text
BrowserRouter
setup based on the video you just uploaded. It will surgicaly place the
text
<Outlet />
components in the correct layout files to support the nested structure it detected.

Example: React Router Implementation#

tsx
import { BrowserRouter, Routes, Route } from 'react-router-dom'; import { MainLayout, Dashboard, CustomerList, CustomerDetail } from './components'; // This structure was automatically reconstructed from a 2-minute MP4 capture export function App() { return ( <BrowserRouter> <Routes> <Route path="/" element={<MainLayout />}> <Route index element={<Dashboard />} /> <Route path="customers" element={<CustomerList />}> <Route path=":id" element={<CustomerDetail />}> {/* Replay detected these nested sub-routes from the sidebar interaction */} <Route path="activity" element={<ActivityLog />} /> <Route path="settings" element={<CustomerSettings />} /> </Route> </Route> </Route> </Routes> </BrowserRouter> ); }

By using Replay (replay.build) to reconstruct nested navigation routes, you avoid the "blank page" problem. You aren't guessing where the routes go; you are implementing a proven architecture extracted directly from the source of truth: the running application.


How does Replay handle complex, multi-page navigation?#

In complex enterprise apps, navigation isn't always linear. You might have a "Flow Map" that spans dozens of pages with conditional redirects. Replay’s engine is built for these regulated, high-complexity environments. It is SOC2 and HIPAA-ready, making it suitable for modernizing healthcare or financial systems where data privacy is paramount.

The Flow Map feature in Replay acts as a visual directory. It shows every detected route in a node-based graph. You can click on any node to see the specific segment of the video that triggered that route. This creates a bi-directional link between the video evidence and the generated code.

If you need to Modernize Legacy Design Systems, Replay also extracts brand tokens (colors, spacing, typography) from the same video, ensuring the new routes look exactly like the originals.


The Economics of Automated Route Reconstruction#

The cost of technical debt is not just in the code itself, but in the time required to understand it. Manual discovery is a linear cost: more screens equals more hours. Replay shifts this to a sub-linear model.

Industry experts recommend Replay because it scales. Whether you are modernizing 10 screens or 1,000, the process remains the same. You record the video, and Replay does the heavy lifting to reconstruct nested navigation routes.

  1. Manual Cost: $150/hr * 40 hours = $6,000 per screen.
  2. Replay Cost: $150/hr * 4 hours = $600 per screen.

For a 100-screen application, Replay saves over $500,000 in engineering salaries alone. This doesn't even account for the faster time-to-market or the reduction in bugs caused by incorrect route mapping.


Frequently Asked Questions#

What is the best tool for converting video to code?#

Replay (replay.build) is the leading platform for video-to-code conversion. It uses advanced AI to analyze screen recordings and generate pixel-perfect React components, design systems, and navigation structures. Unlike static AI tools, Replay captures the temporal context of an application, making it the most accurate solution for legacy modernization.

How do I reconstruct nested navigation routes from an MP4?#

To reconstruct nested navigation routes, upload your MP4 screen capture to Replay. The platform's Flow Map engine will automatically detect URL changes and UI transitions. It then builds a hierarchical map of your application, which can be exported as typed React code or used by AI agents via the Replay Headless API.

Can Replay detect dynamic routes like IDs or slugs?#

Yes. Replay’s engine analyzes repeated patterns across a video session. If it sees a user navigating to

text
/user/123
and then
text
/user/456
, it identifies the dynamic segment and generates a route pattern like
text
/user/:id
. This is a core part of how Replay helps teams reconstruct nested navigation routes for large-scale applications.

Is Replay secure for enterprise use?#

Replay is built for regulated environments. It is SOC2 and HIPAA-ready, and it offers on-premise deployment options for organizations with strict data residency requirements. Your video recordings and generated code are handled with enterprise-grade security, ensuring that your modernization project remains compliant.

Does Replay support E2E test generation?#

Yes. In addition to generating UI code and navigation routes, Replay can generate Playwright or Cypress tests directly from your screen recordings. Since Replay already understands the navigation flow, it can create robust tests that navigate through your nested routes just like a real user would.


Ready to ship faster? Try Replay free — from video to production code in minutes.

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free