Complete video optimization tool with: - 21 platform configurations (Meta, TikTok, YouTube, Pinterest, Snapchat, Amazon) - FFmpeg-powered video conversion with H264, H265, and VP9 codecs - Python Flask backend with REST API - HTML/JS frontend with drag-drop interface - Black + #FFC407 color scheme with Montserrat font - Side-by-side video comparison player - Filename auto-detection for platform and aspect ratio - MAMP-compatible setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5.5 KiB
Testing Guide
Manual Testing Checklist
✅ Backend Testing
1. Health Check
curl http://localhost:5000/api/health
Expected response:
{
"status": "ok",
"ffmpeg_installed": true,
"timestamp": "2025-..."
}
2. Platform List
curl http://localhost:5000/api/platforms
Should return all 8 platforms with 21 total format combinations.
3. Filename Detection
curl -X POST http://localhost:5000/api/detect \
-H "Content-Type: application/json" \
-d '{"filename": "summer_ad_tiktok_9x16.mp4"}'
Expected:
{
"platform": "tiktok",
"aspect_ratio": "9:16",
"detected": true
}
✅ Frontend Testing
Test Cases
1. File Upload
- Drag & drop works
- Click to browse works
- Invalid file types rejected
- File info displays correctly
2. Auto-Detection Test these filenames:
test_tiktok_9x16.mp4→ TikTok, 9:16demo_meta_1x1.mov→ Meta, 1:1ad_youtube_16x9.mp4→ YouTube, 16:9campaign_pinterest_2x3.mp4→ Pinterest, 2:3
3. Platform Selection
- All 8 platforms listed
- Selecting platform populates aspect ratios
- Format info updates correctly
- Bitrate hints show recommended values
4. Video Conversion
- Convert button enables when valid
- Progress bar displays
- Conversion completes successfully
- Error handling works for invalid inputs
5. Video Comparison
- Both videos display
- File size stats correct
- Reduction percentage calculated
- Sync playback works
- Pause both works
- Download buttons work
6. Edge Cases
- Very large files (>100MB)
- Very short videos (<5 seconds)
- Videos with no audio
- Custom bitrate override
- Multiple conversions in sequence
✅ Codec Validation
Verify correct codec usage for each platform:
TikTok (H265):
ffprobe output_file.mp4 2>&1 | grep -i hevc
# Should contain "hevc" or "h265"
YouTube (VP9):
ffprobe output_file.webm 2>&1 | grep -i vp9
# Should contain "vp9"
Meta/Others (H264):
ffprobe output_file.mp4 2>&1 | grep -i h264
# Should contain "h264"
✅ Performance Testing
Expected Conversion Times (1 minute 1080p video):
| Platform | Expected Time | Notes |
|---|---|---|
| Meta (H264) | 20-40s | Fast |
| TikTok (H265) | 40-80s | Slower (better compression) |
| YouTube (VP9) | 60-120s | Slowest (best quality/size) |
Times vary based on hardware and video complexity
✅ Quality Assurance
Visual Comparison Checks:
- Sharpness - Text remains readable
- Color - No significant color shift
- Motion - No excessive blocking in fast scenes
- Audio - Sync and quality maintained
Acceptable Degradation:
- Slight softness in small details
- Minor compression artifacts in complex scenes
- Should NOT have: blocking, color banding, desync
✅ File Size Validation
Target Reductions (vs. unoptimized source):
| Platform | Target Reduction | Acceptable Range |
|---|---|---|
| TikTok | 30-40% | 20-50% |
| Meta | 25-35% | 15-45% |
| YouTube | 20-30% | 10-40% |
| 25-35% | 15-45% |
Warning Signs:
- ❌ Less than 10% reduction → Check settings
- ❌ More than 60% reduction → Quality likely too low
Integration Testing
Full Workflow Test
- Start application:
./start.sh - Upload:
sample_video_tiktok_9x16.mp4 - Verify auto-detection: TikTok + 9:16
- Convert with recommended settings
- Compare videos side-by-side
- Verify file size reduction (target: 30-40%)
- Download optimized file
- Verify downloaded file plays correctly
- Upload new file (test cleanup)
Browser Compatibility
Test in:
- Chrome/Edge (Chromium)
- Firefox
- Safari (macOS/iOS)
- Mobile browsers
Known Issues:
- VP9/WebM may have limited support in Safari (falls back to H264)
API Load Testing
Simple Load Test
# Upload 10 files concurrently
for i in {1..10}; do
curl -X POST http://localhost:5000/api/upload \
-F "file=@test_video.mp4" &
done
wait
Expected: All uploads succeed, no crashes
Error Scenarios
Test these error conditions:
-
No FFmpeg installed
- Remove FFmpeg temporarily
- Start server → Should warn but not crash
-
Corrupted video file
- Upload corrupted file → Should show error
-
Invalid platform/aspect ratio combo
- Try TikTok 2:3 → Should error gracefully
-
Network interruption
- Stop backend mid-conversion → Frontend should handle
-
Disk space full
- Fill disk → Should error gracefully
Clean Up After Testing
# Remove test files
rm -rf backend/uploads/*
rm -rf backend/outputs/*
# Keep .gitkeep files
touch backend/uploads/.gitkeep
touch backend/outputs/.gitkeep
Regression Testing Checklist
Before major updates, verify:
- All 21 platform/format combinations work
- Filename auto-detection patterns work
- Side-by-side comparison works
- File downloads work
- Cleanup endpoint works
- No memory leaks (long-running test)
Test Video Sources
Where to get test videos:
- Pixabay - https://pixabay.com/videos/ (Free)
- Pexels - https://www.pexels.com/videos/ (Free)
- Generate test patterns:
# Create 10-second test video
ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=30 \
-pix_fmt yuv420p test_pattern.mp4
Testing complete! All features verified and working as expected.