No description
| backend | ||
| frontend | ||
| .gitignore | ||
| CLAUDE.md | ||
| DEPLOYMENT.md | ||
| extract_user_logs.sh | ||
| extract_user_logs_robust.sh | ||
| LOG_EXTRACTION_README.md | ||
| quick_extract.sh | ||
| README.md | ||
| requirements.txt | ||
| restart.sh | ||
| video_query.py | ||
Video Query Tool
This application processes videos using Google's Gemini AI model, allowing users to:
- Upload videos (MP4, AVI, MOV, etc.)
- Choose from preset processing modes or use custom prompts
- 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
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install backend dependencies:
pip install -r requirements.txt -
Set your Google API key:
export GOOGLE_API_KEY=your_api_key_here -
Run the development server:
cd backend python run.py
Frontend Setup
-
Install Node.js dependencies:
cd frontend npm install -
Start the development server:
npm start
Deployment
Backend Deployment with Systemd
-
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/
-
Enable and start the service:
sudo systemctl enable video-query sudo systemctl start video-query -
Check the service status:
sudo systemctl status video-query
Frontend Deployment with Apache
-
Build the React frontend:
cd frontend npm run build -
Copy the build directory to your Apache document root:
cp -r build/* /var/www/html/video-query/ -
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> -
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 fileprompt: The prompt text to process the video with
- Returns:
- Success:
{ "success": true, "content": "markdown content..." } - Error:
{ "success": false, "message": "error message..." }
- Success:
- Form parameters:
License
This project is proprietary and confidential.