AI-powered manga panel editor and video creation platform with automated panel detection, narrative generation, and professional video rendering.
VideoAI is a comprehensive web application that transforms manga/comic pages into narrated videos. It combines AI-powered panel detection, Google Gemini narrative generation, and a professional video editor with headless browser recording capabilities.
Key Features:
VideoAI is a comprehensive web application that transforms manga/comic pages into narrated videos. It combines AI-powered panel detection, Google Gemini narrative generation, and a professional video editor with headless browser recording capabilities.
Key Features:
| Page | URL | Purpose |
|---|---|---|
| Dashboard | /editor/dashboard | Project list and management |
| Manga Editor | /editor/manga-editor/{project_id} | Main project editor with narration |
| Panel Editor β | /editor/panel-editor/{project_id} | TTS generation & audio management |
| Video Editor | /editor/video-editor/{project_id} | Timeline, effects, and rendering |
β The Panel Editor is essential for TTS generation and preparing panels for video export
# Clone the repository
git clone https://github.com/pavankavade/VideoAI.git
cd VideoAI
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows (PowerShell)
.\venv\Scripts\Activate.ps1
# Windows (CMD)
.\venv\Scripts\activate.bat
# Windows (Git Bash)
source venv/Scripts/activate
# macOS/Linux
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Install Node.js packages (for Tailwind CSS)
npm install
# Build Tailwind CSS
npm run build:css
Note: The project includes FFmpeg.js files in
package.jsonfor potential future use, but video rendering currently uses headless browser recording only. The npm postinstall script copies FFmpeg.js files but they are not actively used.
# Install Playwright browsers
playwright install chromium
Create a .env file in the project root:
# ============ AI Configuration ============
# Google Gemini API key (required for AI narration)
GOOGLE_API_KEY=your_gemini_api_key_here
# ============ Panel Detection API ============
# External panel detection service (e.g., MagiV3)
PANEL_API_URL=https://your-panel-api.ngrok-free.app/split_panels
# ============ TTS (Optional) ============
# External text-to-speech API
TTS_API_URL=https://your-tts-api.com/synthesize
# ============ Network & CORS ============
# Allowed origins for CORS (comma-separated or "*")
ALLOW_ORIGINS=*
# Start the server (localhost only)
uvicorn main:app --reload --host 127.0.0.1 --port 8000
# OR for LAN access (accessible from other devices)
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Open your browser and navigate to:
data/mangaeditor.db/editor/panel-editor/{project_id}The Panel Editor (/editor/panel-editor/{project_id}) is a dedicated full-page interface specifically designed for managing panels and generating TTS audio. This is integral to the workflow for creating narrated videos.
When to Use:
Example URL: http://localhost:8000/editor/panel-editor/1760184821003
Default Effect Settings:
{
animationSpeed: 0.2, // Slower = more cinematic
screenMargin: 0.1, // 10% margin
zoomAmount: 0.25, // 25% zoom
maxDuration: 5.0, // seconds
panelBaseSize: 1.2, // 120% of original
smoothing: 1.0,
transitionDuration: 0.8, // seconds
transitionOverlap: 0.4, // seconds
transitionSmoothing: 2.0
}
Headless Browser Recording:
renders/headless-recording-{project_id}-{uuid}.webmHow it Works:
renders/ directoryRequirements:
Advantages:
videoai/
βββ main.py # FastAPI app entry point
βββ mangaeditor.py # Manga editor module (SQLite-backed)
βββ videoeditor.py # Video editor module
βββ headless_recorder.py # Playwright headless recording
βββ async_utils.py # Windows asyncio compatibility
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ .env # Environment variables (create this)
β
βββ templates/ # Jinja2 HTML templates
β βββ manga_editor_dashboard.html
β βββ manga_editor.html
β βββ panel_editor_full.html
β βββ video_editor_db.html
β
βββ static/ # Static assets
β βββ ui.css # Tailwind source
β βββ ui.build.css # Compiled CSS
β βββ manga_editor_dashboard.js
β βββ vendor/ # Third-party libraries
β βββ @ffmpeg/ # FFmpeg.js WebAssembly
β
βββ scripts/ # Build scripts
β βββ copy-ffmpeg-core.js
β
βββ data/ # SQLite databases (auto-created)
β βββ mangaeditor.db # Project storage
β
βββ manga_projects/ # Project files (auto-created)
β βββ {project_id}/
β βββ page_*.png # Page images
β βββ panels/ # Detected panel crops
β
βββ uploads/ # User uploads (auto-created)
βββ renders/ # Video renders (auto-created)
βββ venv/ # Python virtual environment
All API endpoints are prefixed with /editor (from the mangaeditor and videoeditor routers).
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Redirects to dashboard |
/editor/dashboard | GET | Main manga editor dashboard (project list) |
/editor/manga-editor/{project_id} | GET | Full manga editor for specific project |
/editor/panel-editor/{project_id} | GET | Dedicated panel editor - TTS generation, audio management, panel editing |
/editor/video-editor/{project_id} | GET | Video editor for project |
/editor/headless-test | GET | Headless recording test page |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/projects | GET | List all projects |
/editor/api/projects | POST | Create new project |
/editor/api/projects/{project_id} | DELETE | Delete project |
/editor/api/project/{project_id} | GET | Get project details |
Create Project Payload:
{
"title": "My Manga Project",
"image_files": ["page1.png", "page2.png"],
"characters": "# Character Notes\n..."
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/panels/create | POST | Detect panels for all pages |
/editor/api/project/{project_id}/panels/create/page/{page_number} | POST | Detect panels for specific page |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/text | PUT | Update panel text |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/audio | PUT | Update panel audio |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/config | PUT | Update panel config |
/editor/api/project/{project_id}/page/{page_number}/config | PUT | Update page config |
Panel Detection Payload:
{
"use_external_api": true
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/narrate/sequential | POST | Generate narration for entire project |
/editor/api/project/{project_id}/narrate/page/{page_number} | POST | Generate narration for specific page |
Sequential Narration Payload:
{
"batch_size": 1,
"custom_prompt": "Optional custom instructions..."
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/characters | GET | Get character notes |
/editor/api/project/{project_id}/characters | PUT | Update character notes |
/editor/api/project/{project_id}/characters/update | POST | Update character notes (alternative) |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/tts/synthesize/page/{page_number} | POST | Generate TTS for page |
/editor/api/project/{project_id}/tts/synthesize/all | POST | Generate TTS for all panels |
/editor/api/project/{project_id}/tts/backfill | POST | Generate missing TTS audio |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/video/effect-config | GET | Get effect configuration |
/editor/api/video/effect-config | POST | Update effect configuration |
/editor/api/project/{project_id}/layers | POST | Save timeline layers |
/editor/api/video/render/headless | POST | Start headless recording |
/editor/api/video/headless/available | GET | Check if Playwright is available |
/editor/api/video/progress/stream/{job_id} | GET | SSE progress stream |
/editor/api/video/download/{job_id} | GET | Download completed render |
Headless Render Payload:
{
"project_id": "1234567890",
"duration": 60,
"width": 1920,
"height": 1080
}
| Endpoint | Method | Description |
|---|---|---|
/upload | POST | Upload images or audio files |
Supported formats: PNG, JPG, JPEG, WEBP, MP3, WAV, OGG, M4A
| Variable | Required | Default | Description |
|---|---|---|---|
GOOGLE_API_KEY | Yes* | - | Google Gemini API key for AI narration |
PANEL_API_URL | Yes** | - | External panel detection API endpoint |
TTS_API_URL | Yes*** | - | External text-to-speech API endpoint |
ALLOW_ORIGINS | No | * | CORS allowed origins (comma-separated) |
* Required for AI narration features
** Required for automated panel detection
*** Required for Text to Speech Generation
Your panel detection API should implement this specification:
Endpoint: POST /split_panels
Input:
file field (image)add_border (boolean)border_width (integer)border_color (string: "R,G,B")curved_border (boolean)corner_radius (integer)Output:
panel_1.png, panel_2.png, etc.[[x1, y1, x2, y2], ...]Your TTS API should implement:
Endpoint: POST /synthesize
Input:
{
"text": "Text to synthesize",
"voice": "optional_voice_id"
}
Output:
{"audio_url": "https://..."}Complete Workflow:
Dashboard β Create Project β Detect Panels β Generate Narration β Panel Editor (TTS) β Video Editor β Export
Navigate to Dashboard
Create Project
Detect Panels
Generate Narration
Edit Panels (Optional)
Generate TTS (Optional)
Open Video Editor
Build Timeline
Apply Effects
Preview
Render Video
renders/ directory with format: headless-recording-{project_id}-{uuid}.webm# Backend with auto-reload
uvicorn main:app --reload --host 127.0.0.1 --port 8000
# Frontend CSS development (watch mode)
npm run dev:css
The SQLite database is located at data/mangaeditor.db.
Schema Overview:
-- Projects table
CREATE TABLE projects (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
created_at TEXT NOT NULL
);
-- Pages table
CREATE TABLE pages (
project_id TEXT NOT NULL,
page_number INTEGER NOT NULL,
image_path TEXT NOT NULL,
PRIMARY KEY (project_id, page_number),
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);
-- Project details (consolidated storage)
CREATE TABLE project_details (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
created_at TEXT NOT NULL,
pages_json TEXT NOT NULL,
character_markdown TEXT NOT NULL DEFAULT '',
metadata_json TEXT NOT NULL DEFAULT '{}'
);
-- Video timeline layers
CREATE TABLE video_timeline (
project_id TEXT NOT NULL,
layer_index INTEGER NOT NULL,
clip_data TEXT NOT NULL,
PRIMARY KEY (project_id, layer_index)
);
Inspecting Database:
# Using sqlite3 CLI
sqlite3 data/mangaeditor.db
# Or use a GUI tool like DB Browser for SQLite
Choose the appropriate module:
mangaeditor.py - Manga-related featuresvideoeditor.py - Video-related featuresmain.py - Standalone featuresAdd the endpoint:
# In mangaeditor.py
@router.post("/api/project/{project_id}/custom-action")
async def custom_action(project_id: str, payload: Dict[str, Any]):
# Your logic here
return JSONResponse({"status": "success"})
Edit mangaeditor.py - EditorDB.init_schema():
c.execute(
"""
CREATE TABLE IF NOT EXISTS my_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project_id TEXT NOT NULL,
data TEXT NOT NULL,
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);
"""
)
Python:
JavaScript:
Currently, automated tests are not implemented. Contributions welcome!
Manual Testing:
Cause: Missing environment variable
Solution: Add PANEL_API_URL=... to .env file
Cause: Missing or invalid Google API key
Solution:
GOOGLE_API_KEY=... to .envCause: External API unreachable or wrong format
Solution:
PANEL_API_URL is accessibleCause: Playwright not installed
Solution:
pip install playwright
playwright install chromium
Cause: FFmpeg not installed (optional for post-processing)
Solution:
Cause: Accessing from different origin
Solution: Set ALLOW_ORIGINS=http://your-origin.com in .env
Cause: Concurrent writes
Solution: Wait and retry, or restart server
Cause: Missing TTS API configuration or panel editor not used
Solution:
TTS_API_URL in .env file/editor/panel-editor/{project_id}Cause: TTS not generated or audio not attached to panels
Solution:
Note: Previous versions supported FFmpeg.js client-side rendering, but this has been removed.
Current: Only headless browser recording is available (faster, more reliable, better audio sync)
Why: Headless recording solves browser audio capture limitations and provides better performance
Server logs important events to console:
Enable verbose logging:
# In main.py or mangaeditor.py
logging.basicConfig(level=logging.DEBUG)
For Large Projects:
For Better Narration:
Backend:
Frontend:
1. Upload Images (Dashboard)
β
2. Create Project (SQLite)
β
3. Detect Panels (External API)
βββ Send images
βββ Receive panel crops (ZIP)
βββ Save to project directory
β
4. Generate Narration (Google Gemini)
βββ Send panel images + context
βββ Save to database
β
5. Panel Editor (/editor/panel-editor/{project_id}) β CRITICAL STEP
βββ Review and edit panel text
βββ Generate TTS audio
βββ Upload custom audio
βββ Configure panel settings
βββ Preview audio playback
β
6. [Optional] Additional TTS Processing
βββ Send text to TTS API
βββ Batch generate for pages
βββ Backfill missing audio
β
7. Export to Video Editor
βββ Timeline uses panel images + audio
βββ Apply effects and transitions
Note: The Panel Editor step is integral to the workflow, especially for TTS generation and audio management before creating videos.
1. Build Timeline
βββ Add clips to layers
βββ Configure effects
βββ Save to database
β
2. Preview (Browser)
βββ Canvas rendering
βββ Audio mixing
βββ Real-time playback
β
3. Render
βββ Headless Browser Recording
βββ Launch Playwright
βββ Record canvas + audio in Chromium
βββ Save to renders/
βββ [Optional] FFmpeg metadata post-process
Current Implementation:
Production Recommendations:
Contributions are welcome! Here's how you can help:
Include in your bug report:
For new features:
git checkout -b feature/amazing-feature)Before submitting:
This project is open source. Please check individual dependencies for their respective licenses.
TODO.md for known issuesCurrent Version: Development (2024-2025)
Status: Active Development
Repository: VideoAI
Built with β€οΈ for manga creators and storytellers
Transform your manga into engaging narrated videos!
AI-powered manga panel editor and video creation platform with automated panel detection, narrative generation, and professional video rendering.
VideoAI is a comprehensive web application that transforms manga/comic pages into narrated videos. It combines AI-powered panel detection, Google Gemini narrative generation, and a professional video editor with headless browser recording capabilities.
Key Features:
VideoAI is a comprehensive web application that transforms manga/comic pages into narrated videos. It combines AI-powered panel detection, Google Gemini narrative generation, and a professional video editor with headless browser recording capabilities.
Key Features:
| Page | URL | Purpose |
|---|---|---|
| Dashboard | /editor/dashboard | Project list and management |
| Manga Editor | /editor/manga-editor/{project_id} | Main project editor with narration |
| Panel Editor β | /editor/panel-editor/{project_id} | TTS generation & audio management |
| Video Editor | /editor/video-editor/{project_id} | Timeline, effects, and rendering |
β The Panel Editor is essential for TTS generation and preparing panels for video export
# Clone the repository
git clone https://github.com/pavankavade/VideoAI.git
cd VideoAI
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows (PowerShell)
.\venv\Scripts\Activate.ps1
# Windows (CMD)
.\venv\Scripts\activate.bat
# Windows (Git Bash)
source venv/Scripts/activate
# macOS/Linux
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Install Node.js packages (for Tailwind CSS)
npm install
# Build Tailwind CSS
npm run build:css
Note: The project includes FFmpeg.js files in
package.jsonfor potential future use, but video rendering currently uses headless browser recording only. The npm postinstall script copies FFmpeg.js files but they are not actively used.
# Install Playwright browsers
playwright install chromium
Create a .env file in the project root:
# ============ AI Configuration ============
# Google Gemini API key (required for AI narration)
GOOGLE_API_KEY=your_gemini_api_key_here
# ============ Panel Detection API ============
# External panel detection service (e.g., MagiV3)
PANEL_API_URL=https://your-panel-api.ngrok-free.app/split_panels
# ============ TTS (Optional) ============
# External text-to-speech API
TTS_API_URL=https://your-tts-api.com/synthesize
# ============ Network & CORS ============
# Allowed origins for CORS (comma-separated or "*")
ALLOW_ORIGINS=*
# Start the server (localhost only)
uvicorn main:app --reload --host 127.0.0.1 --port 8000
# OR for LAN access (accessible from other devices)
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Open your browser and navigate to:
data/mangaeditor.db/editor/panel-editor/{project_id}The Panel Editor (/editor/panel-editor/{project_id}) is a dedicated full-page interface specifically designed for managing panels and generating TTS audio. This is integral to the workflow for creating narrated videos.
When to Use:
Example URL: http://localhost:8000/editor/panel-editor/1760184821003
Default Effect Settings:
{
animationSpeed: 0.2, // Slower = more cinematic
screenMargin: 0.1, // 10% margin
zoomAmount: 0.25, // 25% zoom
maxDuration: 5.0, // seconds
panelBaseSize: 1.2, // 120% of original
smoothing: 1.0,
transitionDuration: 0.8, // seconds
transitionOverlap: 0.4, // seconds
transitionSmoothing: 2.0
}
Headless Browser Recording:
renders/headless-recording-{project_id}-{uuid}.webmHow it Works:
renders/ directoryRequirements:
Advantages:
videoai/
βββ main.py # FastAPI app entry point
βββ mangaeditor.py # Manga editor module (SQLite-backed)
βββ videoeditor.py # Video editor module
βββ headless_recorder.py # Playwright headless recording
βββ async_utils.py # Windows asyncio compatibility
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ .env # Environment variables (create this)
β
βββ templates/ # Jinja2 HTML templates
β βββ manga_editor_dashboard.html
β βββ manga_editor.html
β βββ panel_editor_full.html
β βββ video_editor_db.html
β
βββ static/ # Static assets
β βββ ui.css # Tailwind source
β βββ ui.build.css # Compiled CSS
β βββ manga_editor_dashboard.js
β βββ vendor/ # Third-party libraries
β βββ @ffmpeg/ # FFmpeg.js WebAssembly
β
βββ scripts/ # Build scripts
β βββ copy-ffmpeg-core.js
β
βββ data/ # SQLite databases (auto-created)
β βββ mangaeditor.db # Project storage
β
βββ manga_projects/ # Project files (auto-created)
β βββ {project_id}/
β βββ page_*.png # Page images
β βββ panels/ # Detected panel crops
β
βββ uploads/ # User uploads (auto-created)
βββ renders/ # Video renders (auto-created)
βββ venv/ # Python virtual environment
All API endpoints are prefixed with /editor (from the mangaeditor and videoeditor routers).
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Redirects to dashboard |
/editor/dashboard | GET | Main manga editor dashboard (project list) |
/editor/manga-editor/{project_id} | GET | Full manga editor for specific project |
/editor/panel-editor/{project_id} | GET | Dedicated panel editor - TTS generation, audio management, panel editing |
/editor/video-editor/{project_id} | GET | Video editor for project |
/editor/headless-test | GET | Headless recording test page |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/projects | GET | List all projects |
/editor/api/projects | POST | Create new project |
/editor/api/projects/{project_id} | DELETE | Delete project |
/editor/api/project/{project_id} | GET | Get project details |
Create Project Payload:
{
"title": "My Manga Project",
"image_files": ["page1.png", "page2.png"],
"characters": "# Character Notes\n..."
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/panels/create | POST | Detect panels for all pages |
/editor/api/project/{project_id}/panels/create/page/{page_number} | POST | Detect panels for specific page |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/text | PUT | Update panel text |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/audio | PUT | Update panel audio |
/editor/api/project/{project_id}/panel/{page_number}/{panel_index}/config | PUT | Update panel config |
/editor/api/project/{project_id}/page/{page_number}/config | PUT | Update page config |
Panel Detection Payload:
{
"use_external_api": true
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/narrate/sequential | POST | Generate narration for entire project |
/editor/api/project/{project_id}/narrate/page/{page_number} | POST | Generate narration for specific page |
Sequential Narration Payload:
{
"batch_size": 1,
"custom_prompt": "Optional custom instructions..."
}
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/characters | GET | Get character notes |
/editor/api/project/{project_id}/characters | PUT | Update character notes |
/editor/api/project/{project_id}/characters/update | POST | Update character notes (alternative) |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/project/{project_id}/tts/synthesize/page/{page_number} | POST | Generate TTS for page |
/editor/api/project/{project_id}/tts/synthesize/all | POST | Generate TTS for all panels |
/editor/api/project/{project_id}/tts/backfill | POST | Generate missing TTS audio |
| Endpoint | Method | Description |
|---|---|---|
/editor/api/video/effect-config | GET | Get effect configuration |
/editor/api/video/effect-config | POST | Update effect configuration |
/editor/api/project/{project_id}/layers | POST | Save timeline layers |
/editor/api/video/render/headless | POST | Start headless recording |
/editor/api/video/headless/available | GET | Check if Playwright is available |
/editor/api/video/progress/stream/{job_id} | GET | SSE progress stream |
/editor/api/video/download/{job_id} | GET | Download completed render |
Headless Render Payload:
{
"project_id": "1234567890",
"duration": 60,
"width": 1920,
"height": 1080
}
| Endpoint | Method | Description |
|---|---|---|
/upload | POST | Upload images or audio files |
Supported formats: PNG, JPG, JPEG, WEBP, MP3, WAV, OGG, M4A
| Variable | Required | Default | Description |
|---|---|---|---|
GOOGLE_API_KEY | Yes* | - | Google Gemini API key for AI narration |
PANEL_API_URL | Yes** | - | External panel detection API endpoint |
TTS_API_URL | Yes*** | - | External text-to-speech API endpoint |
ALLOW_ORIGINS | No | * | CORS allowed origins (comma-separated) |
* Required for AI narration features
** Required for automated panel detection
*** Required for Text to Speech Generation
Your panel detection API should implement this specification:
Endpoint: POST /split_panels
Input:
file field (image)add_border (boolean)border_width (integer)border_color (string: "R,G,B")curved_border (boolean)corner_radius (integer)Output:
panel_1.png, panel_2.png, etc.[[x1, y1, x2, y2], ...]Your TTS API should implement:
Endpoint: POST /synthesize
Input:
{
"text": "Text to synthesize",
"voice": "optional_voice_id"
}
Output:
{"audio_url": "https://..."}Complete Workflow:
Dashboard β Create Project β Detect Panels β Generate Narration β Panel Editor (TTS) β Video Editor β Export
Navigate to Dashboard
Create Project
Detect Panels
Generate Narration
Edit Panels (Optional)
Generate TTS (Optional)
Open Video Editor
Build Timeline
Apply Effects
Preview
Render Video
renders/ directory with format: headless-recording-{project_id}-{uuid}.webm# Backend with auto-reload
uvicorn main:app --reload --host 127.0.0.1 --port 8000
# Frontend CSS development (watch mode)
npm run dev:css
The SQLite database is located at data/mangaeditor.db.
Schema Overview:
-- Projects table
CREATE TABLE projects (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
created_at TEXT NOT NULL
);
-- Pages table
CREATE TABLE pages (
project_id TEXT NOT NULL,
page_number INTEGER NOT NULL,
image_path TEXT NOT NULL,
PRIMARY KEY (project_id, page_number),
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);
-- Project details (consolidated storage)
CREATE TABLE project_details (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
created_at TEXT NOT NULL,
pages_json TEXT NOT NULL,
character_markdown TEXT NOT NULL DEFAULT '',
metadata_json TEXT NOT NULL DEFAULT '{}'
);
-- Video timeline layers
CREATE TABLE video_timeline (
project_id TEXT NOT NULL,
layer_index INTEGER NOT NULL,
clip_data TEXT NOT NULL,
PRIMARY KEY (project_id, layer_index)
);
Inspecting Database:
# Using sqlite3 CLI
sqlite3 data/mangaeditor.db
# Or use a GUI tool like DB Browser for SQLite
Choose the appropriate module:
mangaeditor.py - Manga-related featuresvideoeditor.py - Video-related featuresmain.py - Standalone featuresAdd the endpoint:
# In mangaeditor.py
@router.post("/api/project/{project_id}/custom-action")
async def custom_action(project_id: str, payload: Dict[str, Any]):
# Your logic here
return JSONResponse({"status": "success"})
Edit mangaeditor.py - EditorDB.init_schema():
c.execute(
"""
CREATE TABLE IF NOT EXISTS my_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project_id TEXT NOT NULL,
data TEXT NOT NULL,
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);
"""
)
Python:
JavaScript:
Currently, automated tests are not implemented. Contributions welcome!
Manual Testing:
Cause: Missing environment variable
Solution: Add PANEL_API_URL=... to .env file
Cause: Missing or invalid Google API key
Solution:
GOOGLE_API_KEY=... to .envCause: External API unreachable or wrong format
Solution:
PANEL_API_URL is accessibleCause: Playwright not installed
Solution:
pip install playwright
playwright install chromium
Cause: FFmpeg not installed (optional for post-processing)
Solution:
Cause: Accessing from different origin
Solution: Set ALLOW_ORIGINS=http://your-origin.com in .env
Cause: Concurrent writes
Solution: Wait and retry, or restart server
Cause: Missing TTS API configuration or panel editor not used
Solution:
TTS_API_URL in .env file/editor/panel-editor/{project_id}Cause: TTS not generated or audio not attached to panels
Solution:
Note: Previous versions supported FFmpeg.js client-side rendering, but this has been removed.
Current: Only headless browser recording is available (faster, more reliable, better audio sync)
Why: Headless recording solves browser audio capture limitations and provides better performance
Server logs important events to console:
Enable verbose logging:
# In main.py or mangaeditor.py
logging.basicConfig(level=logging.DEBUG)
For Large Projects:
For Better Narration:
Backend:
Frontend:
1. Upload Images (Dashboard)
β
2. Create Project (SQLite)
β
3. Detect Panels (External API)
βββ Send images
βββ Receive panel crops (ZIP)
βββ Save to project directory
β
4. Generate Narration (Google Gemini)
βββ Send panel images + context
βββ Save to database
β
5. Panel Editor (/editor/panel-editor/{project_id}) β CRITICAL STEP
βββ Review and edit panel text
βββ Generate TTS audio
βββ Upload custom audio
βββ Configure panel settings
βββ Preview audio playback
β
6. [Optional] Additional TTS Processing
βββ Send text to TTS API
βββ Batch generate for pages
βββ Backfill missing audio
β
7. Export to Video Editor
βββ Timeline uses panel images + audio
βββ Apply effects and transitions
Note: The Panel Editor step is integral to the workflow, especially for TTS generation and audio management before creating videos.
1. Build Timeline
βββ Add clips to layers
βββ Configure effects
βββ Save to database
β
2. Preview (Browser)
βββ Canvas rendering
βββ Audio mixing
βββ Real-time playback
β
3. Render
βββ Headless Browser Recording
βββ Launch Playwright
βββ Record canvas + audio in Chromium
βββ Save to renders/
βββ [Optional] FFmpeg metadata post-process
Current Implementation:
Production Recommendations:
Contributions are welcome! Here's how you can help:
Include in your bug report:
For new features:
git checkout -b feature/amazing-feature)Before submitting:
This project is open source. Please check individual dependencies for their respective licenses.
TODO.md for known issuesCurrent Version: Development (2024-2025)
Status: Active Development
Repository: VideoAI
Built with β€οΈ for manga creators and storytellers
Transform your manga into engaging narrated videos!