No description
Find a file
2025-09-18 14:25:24 -05:00
backend initial commit 2025-09-18 14:25:24 -05:00
frontend initial commit 2025-09-18 14:25:24 -05:00
.gitignore initial commit 2025-09-18 14:25:24 -05:00
CLAUDE.md initial commit 2025-09-18 14:25:24 -05:00
DEPLOYMENT.md initial commit 2025-09-18 14:25:24 -05:00
extract_user_logs.sh initial commit 2025-09-18 14:25:24 -05:00
extract_user_logs_robust.sh initial commit 2025-09-18 14:25:24 -05:00
LOG_EXTRACTION_README.md initial commit 2025-09-18 14:25:24 -05:00
quick_extract.sh initial commit 2025-09-18 14:25:24 -05:00
README.md initial commit 2025-09-18 14:25:24 -05:00
requirements.txt initial commit 2025-09-18 14:25:24 -05:00
restart.sh initial commit 2025-09-18 14:25:24 -05:00
video_query.py initial commit 2025-09-18 14:25:24 -05:00

Video Query Tool

This application processes videos using Google's Gemini AI model, allowing users to:

  1. Upload videos (MP4, AVI, MOV, etc.)
  2. Choose from preset processing modes or use custom prompts
  3. Get AI-generated markdown content based on the video content

Important Notes

  • Video Length Limitation: The Gemini AI model can only process videos up to 55 minutes in length.
  • File Size: The application supports uploads up to 5GB.

Project Structure

video_query/
├── backend/             # Flask/Hypercorn server
│   ├── app.py           # Main Flask application
│   ├── video_processor.py # Video processing logic
│   └── run.py           # Hypercorn server script
└── frontend/            # React frontend
    ├── public/          # Static assets
    └── src/             # React source code

Setup Instructions

Backend Setup

  1. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  2. Install backend dependencies:

    pip install -r requirements.txt
    
  3. Set your Google API key:

    export GOOGLE_API_KEY=your_api_key_here
    
  4. Run the development server:

    cd backend
    python run.py
    

Frontend Setup

  1. Install Node.js dependencies:

    cd frontend
    npm install
    
  2. Start the development server:

    npm start
    

Deployment

Backend Deployment with Systemd

  1. Update the systemd service file (backend/video-query.service):

    • Update paths to match your server
    • Add your GOOGLE_API_KEY
    • Place in /etc/systemd/system/
  2. Enable and start the service:

    sudo systemctl enable video-query
    sudo systemctl start video-query
    
  3. Check the service status:

    sudo systemctl status video-query
    

Frontend Deployment with Apache

  1. Build the React frontend:

    cd frontend
    npm run build
    
  2. Copy the build directory to your Apache document root:

    cp -r build/* /var/www/html/video-query/
    
  3. Configure Apache to serve the React app, adding the following to your Apache configuration:

    <VirtualHost *:80>
      ServerName yourdomain.com
      DocumentRoot /var/www/html/video-query
    
      <Directory "/var/www/html/video-query">
        AllowOverride All
        Require all granted
    
        # Redirect all requests to index.html for React routing
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.html$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.html [L]
      </Directory>
    
      # Proxy API requests to the backend
      ProxyPass /api http://localhost:5010/api
      ProxyPassReverse /api http://localhost:5010/api
    </VirtualHost>
    
  4. Restart Apache:

    sudo systemctl restart apache2
    

API Reference

The backend API exposes a single endpoint:

  • POST /api/process: Processes an uploaded video with the specified prompt
    • Form parameters:
      • video: The video file
      • prompt: The prompt text to process the video with
    • Returns:
      • Success: { "success": true, "content": "markdown content..." }
      • Error: { "success": false, "message": "error message..." }

License

This project is proprietary and confidential.