Skip to content

leroytan/Sequence

Repository files navigation

GHBanner

Sequence

An intelligent video editor that assembles raw footage into a narrative timeline based on your theme, exportable to Final Cut Pro 7 XML.

Sequence leverages Google's Gemini AI to analyze your video clips and automatically create professional edits based on your creative vision. Simply upload your footage, describe your desired narrative or theme, and let AI craft a compelling edit that you can export directly to Final Cut Pro.

Check out our demo video here.

✨ Features

  • AI-Powered Video Analysis: Automatically extracts and analyzes frames from your video clips to understand content, mood, and visual activity
  • Intelligent Edit Generation: Uses advanced AI to create edit decisions based on your narrative theme
  • Visual Timeline Editor: Preview your generated edit with an interactive timeline interface
  • Final Cut Pro Export: Export your edit as FCP7 XML format for seamless import into Final Cut Pro/Adobe Premiere Pro or any video editor Real-time Preview: Watch your generated edit play back in real-time before exporting
  • Smart Clip Segmentation: AI identifies distinct visual events and segments within each clip for precise editing

🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher recommended)
  • Google Gemini API Key (Get one here)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd Sequence
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    GEMINI_API_KEY=your_api_key_here
  4. Run the development server

    npm run dev

    The app will be available at http://localhost:3000

📖 Usage

  1. Import Video Clips

    • Click "Add Clips" in the Library panel
    • Select one or more video files from your computer
    • Clips will automatically begin analysis (extracting frames every 20 frames for dense context)
  2. Describe Your Vision

    • Enter your desired theme or narrative description in the text area
    • Examples:
      • "A fast-paced action sequence that slows down for emotional moments"
      • "Create a dynamic trailer using these clips, focusing on action and character introduction"
      • "A slow, contemplative montage with smooth transitions"
  3. Generate Edit

    • Click "Generate Edit" to let AI create your timeline
    • The AI will analyze all clips and their segments to match your theme
    • Wait for processing to complete (this may take a minute depending on clip count)
  4. Preview & Refine

    • Review the generated timeline in the Timeline panel
    • Watch the preview in the Player
    • View the generated storyline description
    • Optionally regenerate with the same theme if you want a different cut
  5. Export to Final Cut Pro

    • Set the source folder path (where your video files are located)
    • Click "Export FCP7 XML"
    • Import the XML file into Final Cut Pro

🏗️ Project Structure

Sequence/
├── components/
│   ├── Library.tsx      # Video clip library and management
│   ├── Player.tsx       # Video preview player
│   └── Timeline.tsx    # Timeline editor interface
├── services/
│   └── geminiService.ts # AI analysis and edit generation
├── utils/
│   ├── videoProcessor.ts # Frame extraction utilities
│   └── xmlGenerator.ts   # FCP7 XML export generation
├── types.ts             # TypeScript type definitions
├── App.tsx              # Main application component
└── index.tsx            # Application entry point

🛠️ Technology Stack

  • React 19 - UI framework
  • TypeScript - Type safety
  • Vite - Build tool and dev server
  • Google Gemini AI - Video analysis and edit generation
    • gemini-2.5-flash-image - Visual content analysis
    • gemini-3-flash-preview - Edit decision generation
  • Lucide React - Icon library

🔧 Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build

📝 How It Works

  1. Video Analysis Phase

    • Extracts frames from uploaded videos (every 20 frames for dense sampling)
    • Sends frames to Gemini Vision API for semantic analysis
    • Receives structured data: summary, mood, keywords, and timecoded segments
  2. Edit Generation Phase

    • Combines all clip metadata and user theme
    • Uses Gemini to generate edit decisions with precise in/out points
    • Creates a narrative storyline and reasoning for each edit choice
  3. Timeline Assembly

    • Converts AI decisions into timeline clips
    • Calculates proper sequencing and timing
    • Enables real-time preview
  4. XML Export

    • Generates Final Cut Pro 7 compatible XML
    • Includes proper file paths, timecodes, and track linking
    • Supports video and stereo audio tracks

🎯 Tips for Best Results

  • Clear Themes: Be specific about pacing, mood, and narrative structure
  • Quality Clips: Use well-lit, clear footage for better AI analysis
  • Reasonable Length: Very long clips may take longer to analyze
  • Multiple Clips: Provide several clips for more creative editing options

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Built with ❤️ using Google Gemini AI

About

AI Video Editor

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors