164 lines
3.3 KiB
Markdown
164 lines
3.3 KiB
Markdown
# Local Windows Setup for Development
|
|
|
|
**Purpose:** Run encoderPro directly on Windows for easier debugging
|
|
|
|
---
|
|
|
|
## Quick Setup
|
|
|
|
### 1. Install Python
|
|
|
|
Make sure you have Python 3.9+ installed:
|
|
```powershell
|
|
python --version
|
|
```
|
|
|
|
### 2. Install Dependencies
|
|
|
|
```powershell
|
|
cd C:\Users\ckoch\OneDrive\Documents\development\encoderPro
|
|
|
|
pip install flask flask-cors pyyaml
|
|
```
|
|
|
|
### 3. Create Local Config
|
|
|
|
Create `config-local.yaml`:
|
|
```yaml
|
|
movies_dir: C:/Users/ckoch/Videos/test-movies
|
|
archive_dir: C:/Users/ckoch/Videos/archive
|
|
work_dir: C:/Users/ckoch/Videos/work
|
|
state_db: C:/Users/ckoch/OneDrive/Documents/development/encoderPro/data/state.db
|
|
log_dir: C:/Users/ckoch/OneDrive/Documents/development/encoderPro/logs
|
|
|
|
profiles:
|
|
default: sweetspot_qsv
|
|
|
|
definitions:
|
|
sweetspot_qsv:
|
|
encoder: intel_qsv_h265
|
|
quality: 23
|
|
preset: medium
|
|
description: "Intel QSV H.265"
|
|
|
|
subtitle_check:
|
|
enabled: true
|
|
|
|
quality_check:
|
|
enabled: true
|
|
warn_threshold: 10.0
|
|
error_threshold: 20.0
|
|
|
|
parallel:
|
|
max_workers: 1
|
|
```
|
|
|
|
### 4. Create Directories
|
|
|
|
```powershell
|
|
# Create test directories
|
|
mkdir C:\Users\ckoch\Videos\test-movies
|
|
mkdir C:\Users\ckoch\Videos\archive
|
|
mkdir C:\Users\ckoch\Videos\work
|
|
mkdir C:\Users\ckoch\OneDrive\Documents\development\encoderPro\data
|
|
mkdir C:\Users\ckoch\OneDrive\Documents\development\encoderPro\logs
|
|
```
|
|
|
|
### 5. Run Dashboard Locally
|
|
|
|
```powershell
|
|
cd C:\Users\ckoch\OneDrive\Documents\development\encoderPro
|
|
|
|
# Set environment variables
|
|
$env:CONFIG_FILE="config-local.yaml"
|
|
$env:DASHBOARD_DEBUG="true"
|
|
|
|
# Run dashboard
|
|
python dashboard.py
|
|
```
|
|
|
|
### 6. Open Browser
|
|
|
|
Navigate to: `http://localhost:5000`
|
|
|
|
---
|
|
|
|
## Debugging
|
|
|
|
### Check Logs in Real-Time
|
|
|
|
```powershell
|
|
# In another terminal
|
|
Get-Content C:\Users\ckoch\OneDrive\Documents\development\encoderPro\logs\encoderpro.log -Wait
|
|
```
|
|
|
|
### Check Database
|
|
|
|
```powershell
|
|
# Install SQLite (if not installed)
|
|
# Download from: https://www.sqlite.org/download.html
|
|
|
|
# Query database
|
|
sqlite3 C:\Users\ckoch\OneDrive\Documents\development\encoderPro\data\state.db
|
|
|
|
# View all files
|
|
SELECT id, relative_path, state FROM files;
|
|
|
|
# View stats
|
|
SELECT state, COUNT(*) FROM files GROUP BY state;
|
|
|
|
# Exit
|
|
.quit
|
|
```
|
|
|
|
### Test Encoding Directly
|
|
|
|
```powershell
|
|
# Run reencode script directly
|
|
python reencode.py -c config-local.yaml --scan-only
|
|
|
|
# Check what it found
|
|
python reencode.py -c config-local.yaml --stats
|
|
```
|
|
|
|
---
|
|
|
|
## Benefits of Local Setup
|
|
|
|
✅ **No Docker rebuild** - Just edit and refresh
|
|
✅ **Direct logs** - See errors immediately in console
|
|
✅ **Debugger** - Can use VS Code debugger
|
|
✅ **Faster iteration** - No container restart
|
|
✅ **Database access** - Can query SQLite directly
|
|
|
|
---
|
|
|
|
## Common Issues
|
|
|
|
### "Module not found"
|
|
```powershell
|
|
pip install flask flask-cors pyyaml
|
|
```
|
|
|
|
### "Permission denied" on database
|
|
Make sure the `data` directory exists and is writable.
|
|
|
|
### "FFmpeg not found"
|
|
You need FFmpeg installed on Windows:
|
|
1. Download from https://ffmpeg.org/download.html
|
|
2. Add to PATH
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
|
|
1. Put a test video file in `C:\Users\ckoch\Videos\test-movies\`
|
|
2. Run dashboard: `python dashboard.py`
|
|
3. Open browser: `http://localhost:5000`
|
|
4. Click "Scan Library"
|
|
5. Select the file
|
|
6. Click "Encode Selected"
|
|
7. Watch the console output to see exactly what's happening!
|
|
|
|
This will help us debug the "pending but not processing" issue.
|