video_frame / README.md
Gnanashri Kota Venkatesh
Enhance README with usage and configuration details
2be6e26 unverified
|
Raw History Blame Contribute Delete
3.56 kB

A newer version of the Streamlit SDK is available: 1.67.0

Upgrade
metadata
title: Video Frame Extractor
emoji: πŸ”§
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: 1.53.0
app_file: app.py
pinned: false
license: mit
python_version: '3.12'

Video Scene Frame Extractor

A Streamlit web application that extracts frames from video files, detects scenes, and provides downloadable image packages.

What It Does

This app allows you to:

  1. Upload videos - Supports MP4, AVI, MOV, MPEG, and GIF formats
  2. Extract frames - Automatically extracts frames at configurable intervals
  3. Detect scenes - Identifies distinct scenes within your videos
  4. Download results - Get all extracted frames as a ZIP file
  5. Save to local folders - Optionally save to Documents or OneDrive

Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

  1. Clone the repository:

    git clone https://github.com/venkateshdecode/video_frame_extractor.git
    cd video_frame_extractor
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run the app:

    streamlit run app.py
    

    Or use the provided scripts:

    • Windows: run_streamlit.bat
    • Linux/Mac: ./start.sh
  4. Open your browser to http://localhost:8501

How to Use

  1. Set Project Name - Enter a name for your extraction project in the sidebar
  2. Configure Settings:
    • Frames per Scene: How many frames to extract from each detected scene (1-15)
    • Max Image Size: Maximum dimension in pixels for extracted frames (200-2100)
    • Extract More Frames: Enable for denser frame coverage
  3. Upload Videos - Drag and drop or click to upload video files
  4. Click "Start Processing" - Wait for extraction to complete
  5. Download - Click the download button to get your frames as a ZIP file

Configuration

The app uses .streamlit/config.toml for server settings:

Setting Value Description
maxUploadSize 4000 MB Maximum upload file size
maxMessageSize 4000 MB Maximum message size
headless true Run without opening browser automatically
gatherUsageStats false Disable Streamlit analytics

Project Structure

decode-internal-app/
β”œβ”€β”€ app.py                 # Main Streamlit application
β”œβ”€β”€ get_onedrive.py        # OneDrive integration for saving frames
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ .streamlit/
β”‚   └── config.toml        # Streamlit configuration
β”œβ”€β”€ run_streamlit.bat      # Windows launcher
β”œβ”€β”€ start.sh               # Linux/Mac launcher
└── README.md              # This file

Dependencies

Package Purpose
streamlit Web UI framework
opencv-python-headless Video processing and frame extraction
Pillow Image manipulation and resizing
pandas Data handling for results
numpy Numerical operations
tqdm Progress bars
scikit-learn Optional: advanced scene detection
timm Optional: image model embeddings
scenedetect Optional: advanced scene detection

Output Format

Extracted frames are organized as:

project_name/
β”œβ”€β”€ video1_name/
β”‚   β”œβ”€β”€ video1_name_01.jpg
β”‚   β”œβ”€β”€ video1_name_02.jpg
β”‚   └── ...
β”œβ”€β”€ video2_name/
β”‚   β”œβ”€β”€ video2_name_01.jpg
β”‚   └── ...