This guide helps you upgrade your existing VFXB installation to include the new AI Auto-Edit feature.
- Existing VFXB installation
- OpenAI API key configured
- Node.js backend running
- React frontend running
cd backend
npm installThe new autoEditService.js has been created at:
backend/src/services/autoEditService.js
This service is already imported in backend/src/routes/video.js.
Ensure your .env file has:
OPENAI_API_KEY=your_openai_key
OPENAI_MODEL=gpt-4-turbo-preview # or gpt-3.5-turboThe AutoEditStatus.jsx component has been created at:
frontend/src/components/AutoEditStatus.jsx
This component is already imported in frontend/src/Pages/AIEditor.jsx.
cd frontend
npm installExisting videos in your database will work normally. They simply won't have the aiEnhancements array, which is fine - the AutoEditStatus component checks for this and only shows when present.
The Video model already supports these fields (no migration needed):
aiEnhancements- Array of AI analysis and edit informationparentVideoId- Link to original video (for auto-edited versions)appliedEffects- Array of effects applied to video
These fields are optional and backward-compatible.
# Terminal 1: Backend
cd backend
npm start
# Terminal 2: Frontend
cd frontend
npm run dev- Navigate to AI Editor
- Upload a video with audio (for best results)
- Wait for processing to complete
- Look for the "AI Auto-Edit Applied" banner
Check that:
- Video uploads successfully
- Processing status shows progress
- Auto-edit banner appears after processing
- Can switch between "AI Enhanced" and "Original"
- "Show Details" expands analysis information
- AI Assistant still works for manual edits
cd backend
node testAutoEdit.jsExpected output:
=== Test 1: Happy Vlog ===
Recommended Edits: [
{
"type": "lut-filter",
"parameters": { "preset": "Warm", "intensity": 60 },
"reason": "Warm tones enhance happy, positive content"
},
...
]
Problem: Videos upload but no auto-edit happens
Solutions:
-
Check OpenAI API key is valid:
# In backend/.env echo $OPENAI_API_KEY # Linux/Mac # or check the file directly
-
Check server logs for errors:
cd backend npm start # Look for errors during video processing
-
Verify the background processing function is running:
- Upload a video
- Check logs for "Starting background processing"
- Check logs for "Starting AI analysis"
Problem: AutoEditStatus component doesn't appear
Solutions:
-
Check video has
aiEnhancementsarray:// In browser console console.log(uploadedVideo?.aiEnhancements);
-
Verify import in AIEditor.jsx:
import AutoEditStatus from "../components/AutoEditStatus";
-
Check React DevTools for component errors
Problem: Video stuck at "Processing..."
Solutions:
-
Check FFmpeg is installed and accessible:
ffmpeg -version
-
Check video file permissions
-
Check available disk space
-
Check backend logs for FFmpeg errors
Problem: Auto-edit applies incorrect color grading
Solutions:
- Check AI analysis results in video metadata
- Verify mood detection in
aiEnhancementsarray - Adjust mood mappings in
autoEditService.js:getMoodBasedColorGrading(mood) { // Customize mappings here }
If you need to revert the changes:
In backend/src/routes/video.js, remove the auto-edit section from processVideoInBackground():
// Comment out or remove these lines (around line 320-400):
/*
// Step 2: AI Analysis and Auto-Edit
try {
...all the auto-edit code...
} catch (error) {
logger.error('Auto-edit processing failed:', error);
}
*/In frontend/src/Pages/AIEditor.jsx, remove:
// Remove import
import AutoEditStatus from "../components/AutoEditStatus";
// Remove component usage (around line 2170)
/*
{uploadedVideo && (
<div className="px-6 mb-4">
<AutoEditStatus ... />
</div>
)}
*/rm backend/src/services/autoEditService.js
rm frontend/src/components/AutoEditStatus.jsx
rm backend/testAutoEdit.js- CPU: Moderate increase during auto-edit processing
- Memory: +200-500MB per concurrent auto-edit
- Disk: Each auto-edited video creates a new file
- API Calls: +1 OpenAI API call per video upload
- Limit concurrent uploads if server resources are limited
- Adjust intensity values to reduce processing time
- Cache analysis results for similar videos (future enhancement)
- Use queue system for high-volume scenarios
- OpenAI API cost per video: ~$0.01-0.05 (depending on length)
- Storage: 1 additional video file per upload
- Processing time: 30-60 seconds per video (varies by length)
In backend/src/services/autoEditService.js:
getMoodBasedColorGrading(mood) {
// Change intensity values here
happy: {
preset: "Warm",
intensity: 60, // Change to 40-80 range
},
}getMoodBasedColorGrading(mood) {
const moodToPreset = {
// ... existing mappings ...
mysterious: {
type: "lut-filter",
parameters: {
preset: "Cool",
intensity: 70,
},
reason: "Cool tones add mystery",
},
};
}Comment out sections in determineAutoEdits():
determineAutoEdits(analysis, metadata) {
const edits = [];
// 1. Color grading - ENABLED
const colorGrading = this.getMoodBasedColorGrading(...);
if (colorGrading) edits.push(colorGrading);
// 2. Exposure - DISABLED
// const exposure = this.getContentTypeExposure(...);
// if (exposure) edits.push(exposure);
// 3. Stabilization - ENABLED
if (videoAnalysis.pacing === "fast") {
edits.push({...});
}
return edits;
}- Check full documentation:
docs/AI_AUTO_EDIT_FEATURE.md - Review quick start:
AI_AUTO_EDIT_README.md - Run test script:
node backend/testAutoEdit.js - Check server logs for detailed error messages
See the FAQ section in AI_AUTO_EDIT_README.md
✅ Installation: Drop in new files, no database migration needed ✅ Backward Compatible: Existing videos continue to work ✅ Non-Breaking: Original manual editing workflow preserved ✅ Configurable: Easy to customize behavior ✅ Reversible: Can disable or remove if needed
The AI Auto-Edit feature is designed to enhance your workflow without disrupting existing functionality. All changes are additive and optional.
Need Help? Check the logs, review the documentation, and test with the provided test script before deploying to production.