A dockerized web application for extracting video highlights and converting them to GIF, GIFV, or MP4 format.
Features
- Single Container Architecture: Self-contained Flask application with embedded SQLite
- Web Interface: Drag-and-drop video upload with HTML5 video player
- Timeline Selection: Click and drag to select highlight segments
- Multiple Export Formats: MP4, GIFV (WebM), and GIF output
- Real-time Processing: Background processing with progress tracking
- Highlight Management: Play, rename, and delete individual highlights
- Bulk Operations: Clear all - delete entire video and all highlights
- Persistent Storage: Database and files persist between container restarts
- Auto-upload: Automatic form submission on file selection
Quick Start
Using Docker Compose (Recommended)
# Start the application
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the application
docker-compose down
Using Docker directly
# Build the Docker image
docker build -t gifomatic .
# Run the container
docker run -p 5000:5000 -v $(pwd)/uploads:/app/uploads -v $(pwd)/data:/app/data gifomatic
Access the Application
Open your browser and navigate to http://localhost:5000
Usage
- Upload Video: Drag and drop a video file or click to browse (auto-uploads)
- Select Segment: Use the timeline to click and drag a highlight segment
- Choose Format: Select MP4, GIFV, or GIF output format
- Create Highlight: Click "Create Highlight" to process
- Manage Highlights: Play, rename, download, or delete individual highlights
- Clear All: Delete entire video and all highlights with the red "Clear All" button
Supported Video Formats
- MP4, AVI, MOV, MKV, WMV, FLV, WebM
Architecture
- Backend: Flask web server with SQLite database
- Frontend: Server-rendered HTML with vanilla JavaScript
- Video Processing: FFmpeg for video manipulation
- Storage: Local filesystem for temporary files
- Database: Embedded SQLite for metadata
File Structure
gifomatic/
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Container configuration
├── requirements.txt # Python dependencies
├── app.py # Main Flask application
├── README.md # This file
├── static/
│ ├── css/style.css # Application styling
│ └── js/
│ ├── upload.js # Upload functionality
│ └── player.js # Video player controls
├── templates/
│ ├── index.html # Upload page
│ └── player.html # Video player page
├── data/ # Database storage (persistent)
│ └── videos.db # SQLite database
└── uploads/ # Video files storage (persistent)
Development
Local Development (without Docker)
# Install Python dependencies
pip install -r requirements.txt
# Install FFmpeg (Ubuntu/Debian)
sudo apt-get install ffmpeg
# Run the application
python app.py
Environment Variables
SECRET_KEY: Flask secret key (default: dev key)
Docker Compose Features
- Persistent Storage: Uploads and database are persisted via volumes
- Health Checks: Application health monitoring
- Auto Restart: Container restarts automatically on failure
- Environment Variables: Configurable via
.env file or environment
API Endpoints
GET /: Main upload page
POST /upload: Upload video file
GET /video/<id>: Video player page
GET /video-file/<id>: Serve video file
POST /create-highlight: Create highlight segment
GET /highlight-status/<id>: Check processing status
GET /download/<id>: Download processed highlight
POST /rename-highlight: Rename a highlight
POST /delete-highlight: Delete individual highlight
POST /clear-all: Delete video and all highlights
Technical Details
- Container: Python 3.11 slim with FFmpeg
- Database: SQLite with tables for videos and highlights
- Processing: Background threading for video processing
- File Handling: Secure filename handling with UUID prefixes
- Progress Tracking: In-memory status tracking for processing jobs
Limitations
- Maximum file size: 500MB
- Minimum highlight duration: 0.1 seconds
- Single concurrent processing per highlight
- Temporary storage only (files not persisted between container restarts)