Automate your video editing workflow with the power of Generative AI and Python.
⭐ If you find this project useful, please give it a star! It helps more people discover Filmy-AI and motivates further development.
Try Filmy-AI right now:
- 🚀 Hosted API: https://shantanu-pandya-filmy-ai-api.hf.space/
See how Filmy-AI processes videos with AI instructions in real-time!
- Overview
- Features
- Quick Start
- How to Use
- Web Integration Guide
- API Documentation
- License & Attribution
- Contributing
Filmy-AI is an intelligent video editing agent powered by Google's Gemini AI and MoviePy. It allows users to describe video edits in natural language, and the AI automatically processes and applies those edits to their videos.
Instead of manually editing videos frame-by-frame, just tell the AI what you want:
- "Remove background noise and add background music"
- "Cut the first 5 seconds and make it black & white"
- "Add subtitles and blur faces"
The AI understands your instructions and applies them automatically!
- 🤖 Natural Language Processing: Describe edits in plain English
- 🎥 Multi-format Support: MP4, AVI, MOV, MKV, FLV
- ⚡ Fast Processing: GPU-accelerated video encoding
- 🔌 REST API: Easy integration with websites and applications
- 💾 Scalable: Redis-based task queue with Celery workers
- 🐳 Docker Ready: One-click deployment
- Python 3.10+
- Docker & Docker Compose (optional, for containerized deployment)
- Google Gemini API key (Get one here)
- Clone the repository
git clone https://github.com/yourusername/filmy-ai.git
cd filmy-ai- Create a virtual environment
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Set up environment variables
Create a
.envfile in the root directory:
API_PORT=8000
API_HOST=0.0.0.0
DEBUG=False
ENVIRONMENT=production
GEMINI_API_KEY=your-gemini-api-key-here
DATABASE_URL=sqlite:///./data/filmy_ai.db
REDIS_URL=redis://localhost:6379/0- Run the server
python main.pyThe API will be available at http://localhost:8000
Base URL:
- 🌐 Production (Hosted):
https://shantanu-pandya-filmy-ai-api.hf.space/api/v1 - 💻 Local:
http://localhost:8000/api/v1
curl -X POST "https://shantanu-pandya-filmy-ai-api.hf.space/api/v1/upload/video" \
-F "file=@myvideo.mp4"Response:
{
"status": "success",
"video_id": "video_12345.mp4",
"filename": "video_12345.mp4",
"message": "Video uploaded successfully: myvideo.mp4"
}curl -X POST "https://shantanu-pandya-filmy-ai-api.hf.space/api/v1/instruct" \
-H "Content-Type: application/json" \
-d '{
"video_id": "video_12345.mp4",
"instruction": "Remove background noise and make it 720p"
}'Response:
{
"status": "success",
"message": "Video processed successfully",
"output_file": "video_12345_edited.mp4",
"processing_time_seconds": 45.23
}curl "https://shantanu-pandya-filmy-ai-api.hf.space/api/v1/download/video_12345_edited.mp4" \
-o edited_video.mp4If you want to add Filmy-AI to your website, integrate with the live API:
Create your own frontend using JavaScript:
<!DOCTYPE html>
<html>
<head>
<title>Video Editor on My Website</title>
</head>
<body>
<input type="file" id="videoInput" accept="video/*" />
<button onclick="uploadVideo()">Upload</button>
<textarea id="instructions" placeholder="Describe edits here..."></textarea>
<button onclick="processVideo()">Process with AI</button>
<div id="status"></div>
<video id="preview" controls></video>
<script>
const API_URL = 'https://shantanu-pandya-filmy-ai-api.hf.space/api/v1';
let videoId = null;
async function uploadVideo() {
const file = document.getElementById('videoInput').files[0];
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch(`${API_URL}/upload/video`, {
method: 'POST',
body: formData
});
const data = await response.json();
videoId = data.video_id;
document.getElementById('status').innerText = '✅ Video uploaded!';
} catch (error) {
document.getElementById('status').innerText = '❌ Upload failed: ' + error.message;
}
}
async function processVideo() {
const instructions = document.getElementById('instructions').value;
try {
const response = await fetch(`${API_URL}/instruct`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
video_id: videoId,
instruction: instructions
})
});
const data = await response.json();
if (data.status === 'success') {
document.getElementById('status').innerText = '✅ Done! Downloading...';
document.getElementById('preview').src = `${API_URL}/download/${data.output_file}`;
} else {
throw new Error(data.message);
}
} catch (error) {
document.getElementById('status').innerText = '❌ Processing failed: ' + error.message;
}
}
</script>
</body>
</html>// React Example
import React, { useState } from 'react';
export default function VideoEditor() {
const [videoId, setVideoId] = useState(null);
const [status, setStatus] = useState('');
const API_URL = 'https://shantanu-pandya-filmy-ai-api.hf.space/api/v1';
const uploadVideo = async (e) => {
const file = e.target.files[0];
const formData = new FormData();
formData.append('file', file);
try {
const res = await fetch(`${API_URL}/upload/video`, {
method: 'POST',
body: formData
});
const data = await res.json();
setVideoId(data.video_id);
setStatus('✅ Video uploaded!');
} catch (err) {
setStatus('❌ Upload failed: ' + err.message);
}
};
return (
<div>
<input type="file" accept="video/*" onChange={uploadVideo} />
<p>{status}</p>
</div>
);
}For detailed API endpoint documentation, see API_DOCUMENTATION.md
| Endpoint | Method | Purpose |
|---|---|---|
/health |
GET | Health check |
/upload/video |
POST | Upload video file |
/instruct |
POST | Process with AI instructions (blocks until complete) |
/download/{filename} |
GET | Download processed video |
- 🔑 Never commit API keys: Use environment variables
- 📝 Add authentication: Implement API key auth for production
- 💾 Validate uploads: Check file size and type before processing
- 📺 Content Creators: Batch process YouTube videos
- 🎓 Educators: Create edited educational content
- 🎥 Social Media: Generate TikTok/Instagram video edits
- 🎬 Video Production: Automate editing workflows
- 🤖 Video APIs: Integrate into SaaS platforms
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
If you find Filmy-AI useful, please consider:
- ⭐ Giving it a star on GitHub
- 🐛 Reporting bugs and suggesting features
- 📢 Sharing it with others
- 🤝 Contributing to the project
This project is licensed under the MIT License - see LICENSE for details.
If you use, fork, or build upon Filmy-AI, you MUST include proper attribution:
In your README or documentation, include:
This project uses [Filmy-AI](https://github.com/yourusername/filmy-ai)
- An AI-powered video editing API by [Shantanu Pandya](https://github.com/yourusername)For commercial projects:
- Include the above attribution in your project documentation
- Include LICENSE notice in your codebase
- Link back to the original repository
Copying code without attribution is not permitted and violates the MIT License terms.
- ✅ Allowed: Use, modify, distribute (with attribution)
- ✅ Required: Include original license and author credit
- ✅ Allowed: Use in commercial projects
- ❌ Not Allowed: Remove original license or author credits
- ❌ Not Allowed: Claim code as your own without attribution
Made with ❤️ by Shantanu Pandya
If you use this project, please give credit where it's due! 🙏
Every star means a lot! If Filmy-AI helped you:
- ⭐ Star this repo - Biggest motivation!
- 🍴 Fork it - Build awesome things with it
- 🐛 Report issues - Help improve the project
- 📢 Share it - Spread the word (with credit!)
- 🤝 Contribute - Submit PRs
