Skip to content

Commit 41481cc

Browse files
authored
Merge pull request #42 from ClipABit/plugin-for-staging
Simplified Plugin
2 parents c7d7d58 + b9640e4 commit 41481cc

File tree

5 files changed

+1696
-0
lines changed

5 files changed

+1696
-0
lines changed

frontend/plugin/README.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# ClipABit - DaVinci Resolve Plugin
2+
3+
A semantic video search plugin for DaVinci Resolve that allows you to search through your media pool using natural language queries and automatically add matching clips to your timeline.
4+
5+
## Features
6+
7+
### Core Functionality
8+
- **Semantic Video Search**: Search your media pool using natural language (e.g., "woman walking", "car driving")
9+
- **Smart Upload Management**: Track which files have been processed and upload only new files
10+
- **Background Job Tracking**: Monitor upload and processing jobs with real-time status updates
11+
- **Timeline Integration**: Add search results directly to your timeline with precise timing
12+
- **Persistent Storage**: Local tracking of processed files across sessions
13+
14+
### User Interface
15+
- **Split Panel Design**: Upload controls on the left, search and results on the right
16+
- **File Status Display**: Shows total files, processed count, and new files available
17+
- **Active Jobs Monitor**: Real-time display of upload and processing jobs
18+
- **Search Results**: Visual display of top matching clips with scores and timing
19+
- **One-Click Timeline Addition**: Add any search result to timeline with a single click
20+
21+
## Prerequisites
22+
23+
* **DaVinci Resolve** installed in default location
24+
* **Python 3.12+**
25+
* **Required Python Packages**:
26+
* `PyQt6` - UI framework
27+
* `requests` - API communication
28+
* `watchdog` - File watching for development
29+
30+
## Setup & Installation
31+
32+
### 1. Install Dependencies
33+
```bash
34+
# Navigate to plugin directory
35+
cd frontend/plugin
36+
37+
# Install via uv (recommended)
38+
uv pip install
39+
40+
# Or install globally via pip
41+
pip install PyQt6 requests watchdog
42+
```
43+
44+
### 2. Development Setup (Hot Reload)
45+
```bash
46+
# Navigate to development utilities
47+
cd utils/plugins/davinci
48+
49+
# Start file watcher for automatic updates
50+
python watch_clipabit.py
51+
```
52+
53+
This starts a file watcher that automatically copies the plugin to Resolve's Scripts directory when you make changes, enabling hot-reload development.
54+
55+
### 3. Running the Plugin
56+
1. Open DaVinci Resolve
57+
2. Open or create a project
58+
3. Navigate to: `Workspace > Scripts > ClipABit`
59+
4. The plugin window will open
60+
61+
## Usage
62+
63+
### Initial Setup
64+
1. **Load Media**: Add video files to your DaVinci Resolve media pool
65+
2. **Upload Files**: Click "Upload New Files" to process and index your media
66+
3. **Monitor Jobs**: Watch the "Active Jobs" panel for processing status
67+
68+
### Searching & Timeline Integration
69+
1. **Search**: Enter natural language queries in the search box
70+
- Examples: "person walking", "car on road", "sunset scene"
71+
2. **Review Results**: Browse search results with similarity scores and timing
72+
3. **Add to Timeline**: Click "Add to Timeline" on any result to insert the clip
73+
74+
### File Management
75+
- **Upload New Files**: Only uploads files that haven't been processed
76+
- **Upload All Files**: Re-uploads all files in media pool
77+
- **Automatic Tracking**: Plugin remembers which files have been processed
78+
- **Status Display**: Shows file counts and processing status
79+
80+
## Configuration
81+
82+
### Environment Settings
83+
Set the `CLIPABIT_ENVIRONMENT` environment variable to control which backend to use:
84+
- `dev` (default) - Development environment
85+
- `prod` - Production environment
86+
- `staging` - Staging environment
87+
88+
### API Endpoints
89+
The plugin automatically configures API endpoints based on the environment:
90+
- Search: `https://clipabit01--{env}-server-search{suffix}.modal.run`
91+
- Upload: `https://clipabit01--{env}-server-upload{suffix}.modal.run`
92+
- Status: `https://clipabit01--{env}-server-status{suffix}.modal.run`
93+
94+
### Data Storage
95+
- **Device ID**: Stored in platform-appropriate location for user identification
96+
- **Processed Files**: JSON file tracking which media has been uploaded
97+
- **Namespacing**: Each device + project combination gets its own namespace
98+
99+
## Architecture
100+
101+
### Backend Integration
102+
- **Modal.com Deployment**: Serverless backend for video processing
103+
- **Pinecone Vector Database**: Stores video embeddings for semantic search
104+
- **R2 Storage**: Cloudflare R2 for video file storage
105+
- **CLIP Embeddings**: OpenAI CLIP model for semantic understanding
106+
107+
### Local Components
108+
- **PyQt6 Interface**: Modern, responsive UI
109+
- **Background Job Tracking**: Non-blocking upload and status monitoring
110+
- **File System Integration**: Direct access to Resolve's media pool
111+
- **Persistent State**: Local storage for processed file tracking
112+
113+
### DaVinci Resolve Integration
114+
- **Media Pool Access**: Reads video files from current project
115+
- **Timeline Manipulation**: Adds clips with precise frame timing
116+
- **Project Awareness**: Separate namespaces per project
117+
- **Real-time Updates**: Monitors media pool changes
118+
119+
## Development
120+
121+
### File Structure
122+
```
123+
frontend/plugin/
124+
Γö£ΓöÇΓöÇ clipabit.py # Main plugin file
125+
Γö£ΓöÇΓöÇ pyproject.toml # Dependencies
126+
Γö£ΓöÇΓöÇ README.md # This file
127+
ΓööΓöÇΓöÇ uv.lock # Dependency lock file
128+
129+
utils/plugins/davinci/
130+
ΓööΓöÇΓöÇ watch_clipabit.py # Development file watcher
131+
```
132+
133+
### Development Workflow
134+
1. Make changes to `frontend/plugin/clipabit.py`
135+
2. File watcher automatically copies to Resolve Scripts directory
136+
3. Restart plugin in Resolve to see changes
137+
4. Use Resolve Console (`Workspace > Console`) for debugging
138+
139+
### Key Classes
140+
- **ClipABitApp**: Main application window and logic
141+
- **JobTracker**: Background thread for monitoring upload jobs
142+
- **Config**: Environment-based configuration management
143+
144+
## Troubleshooting
145+
146+
### Common Issues
147+
- **"Resolve API not available"**: Plugin is running outside of DaVinci Resolve
148+
- **Upload failures**: Check internet connection and API endpoints
149+
- **No search results**: Ensure files have been uploaded and processed
150+
- **Timeline errors**: Verify timeline exists or plugin will create one
151+
152+
### Debug Information
153+
- Check Resolve Console for detailed logs
154+
- Plugin status bar shows current operations
155+
- Job tracker displays upload progress and errors
156+
157+
### File Locations
158+
- **Windows**: `%APPDATA%\ClipABit\`
159+
- **macOS**: `~/Library/Application Support/ClipABit/`
160+
- **Linux**: `~/.config/clipabit/`
161+
162+
## Future Enhancements
163+
164+
- **Preview Thumbnails**: Visual previews of search results
165+
- **Batch Operations**: Multi-select and batch timeline additions
166+
- **Advanced Filters**: Filter by duration, resolution, or other metadata
167+
- **Custom Namespaces**: User-defined organization schemes
168+
- **Offline Mode**: Local-only search capabilities

0 commit comments

Comments
 (0)