Screen Capture Provider Configuration Guide
Overviewโ
This guide helps you choose and configure the optimal screen capture method for Brobot pattern matching. It compares different capture providers and tools to help you achieve the best results for reliable pattern recognition.
Recommendationโ
FFmpeg (JavaCV) is the recommended capture provider for Brobot, offering excellent compatibility with Windows Snipping Tool and SikuliX IDE patterns, while capturing at full physical resolution.
Capture Methods Comparisonโ
Note: The comparison data below is based on testing configurations. Results may vary depending on your specific environment, display settings, and Windows version.
Tools Testedโ
External Capture Toolsโ
- Windows Snipping Tool - Native Windows screen capture (Win+Shift+S)
- SikuliX IDE - Traditional pattern capture tool
- Brobot Pattern Capture Tool - Custom tool using Brobot's capture providers
Brobot Capture Providersโ
- SikuliX - Legacy provider for backward compatibility
- Robot - Java's built-in Robot class
- FFmpeg (JavaCV) - Bundled FFmpeg via JavaCV library
Test Environmentโ
- Windows with 125% display scaling
- Physical resolution: 1920x1080
- Logical resolution: 1536x864
- Java 21 (DPI-aware by default)
Detailed Resultsโ
Resolution Capture Comparisonโ
| Method | Resolution | File Size | Bit Depth | Compression |
|---|---|---|---|---|
| SikuliX | 1536x864 | 324 KB | 24-bit | 12.0x |
| Robot | 1536x864 | 324 KB | 24-bit | 12.0x |
| FFmpeg | 1920x1080 | 255 KB | 24-bit | 23.7x |
| Windows | 1920x1080 | 329 KB | 32-bit | 24.6x |
| SikuliX IDE | 1920x1080 | 228 KB | 24-bit | 26.5x |
Pixel-Perfect Similarity Resultsโ
Perfect Matches (100% Similarity)โ
- Windows โ FFmpeg: 100% identical pixels
- Windows โ SikuliX IDE: 100% identical pixels
- FFmpeg โ SikuliX IDE: 100% identical pixels
- SikuliX โ Robot: 100% identical pixels (both logical resolution)
Near-Perfect Matches (97%+ Similarity)โ
- SikuliX Tool โ SikuliX/Robot: 97.2% similarity
- Minor differences due to capture timing
Significant Differences (Less than 80% Similarity)โ
- Robot Tool captures showed 69-75% similarity with other methods
- Likely due to different color space handling or compression
Pattern Matching Simulationโ
A 200x100 pixel pattern was extracted and matched across all capture methods:
| Target Screenshot | Match Similarity | Compatibility |
|---|---|---|
| SikuliX | 100% | Excellent |
| Robot | 100% | Excellent |
| FFmpeg | 90.2% | Good |
| Windows | 90.2% | Good |
| SikuliX IDE | 90.2% | Good |
Recommendationsโ
Optimal Configurationโ
The following configuration provides reliable results (see Properties Reference for all options):
# Recommended Brobot Configuration
brobot.capture.provider=JAVACV_FFMPEG # Use bundled FFmpeg
brobot.dpi.disable=true # Disable DPI awareness for physical resolution
brobot.dpi.resize-factor=1.0 # No scaling (1.0 = physical resolution)
Note: Similarity thresholds are configured per-action using
PatternFindOptions, not as global properties. See Action Config Reference for details.
Best Practice Workflowsโ
Option 1: Windows Snipping Tool (Quick & Simple)โ
Best for: Quick pattern capture, familiar workflow
Advantages:
- Built into Windows (Win+Shift+S)
- 100% compatible with FFmpeg provider
- No additional tools needed
Workflow:
- Press Win+Shift+S
- Select region
- Save to
images/[state-name]/ - Configure Brobot to use FFmpeg provider
Option 2: Brobot Pattern Capture Tool (Integrated)โ
Best for: Project integration, automated workflow
Advantages:
- Auto-saves to correct project directory
- Same 100% quality as Windows
- Integrated with Brobot project structure
- Supports batch capture and organization
Workflow:
- Run Pattern Capture Tool
- Select FFmpeg provider
- Press F1 or click Capture
- Images auto-save to patterns folder
Option 3: SikuliX IDE (Legacy)โ
Best for: Existing SikuliX users, legacy projects
Advantages:
- Familiar to SikuliX users
- 100% compatible with FFmpeg provider
- Established tool with documentation
Note: Captures at physical resolution (1920x1080)
Technical Detailsโ
Why FFmpeg Achieves Perfect Matchesโ
- Physical Resolution Capture: FFmpeg captures at true physical resolution (1920x1080), bypassing Java's DPI scaling
- Direct Screen Access: Uses Windows GDI for direct screen buffer access
- Consistent Color Space: Maintains consistent RGB color representation
- No Scaling Artifacts: Avoids interpolation issues from resolution conversion
DPI Scaling Considerationsโ
For comprehensive DPI handling strategies, see the DPI and Resolution Guide.
With 125% Windows scaling:
- Logical methods (SikuliX, Robot): Capture at 1536x864
- Physical methods (FFmpeg, Windows): Capture at 1920x1080
- Brobot's DPI compensation handles the conversion automatically
File Size Optimizationโ
FFmpeg provides the best compression efficiency:
- Smallest file size for physical resolution (255 KB vs 329 KB for Windows)
- Best compression ratio (23.7x)
- No quality loss despite smaller file size
Compatibility Matrixโ
| Pattern Created With | Best Brobot Provider | Expected Similarity |
|---|---|---|
| Windows Snipping Tool | FFmpeg | 100% |
| SikuliX IDE | FFmpeg | 100% |
| Brobot Tool (FFmpeg) | FFmpeg | 100% |
| Brobot Tool (SikuliX) | SikuliX or Robot | 97-100% |
| Legacy patterns (unknown) | Auto-detect | Varies |
Migration Guideโ
From SikuliX IDE to Brobotโ
- Keep existing patterns - They work with FFmpeg at 100% similarity
- Update configuration:
brobot.capture.provider=JAVACV_FFMPEG - No pattern recreation needed
From Robot to FFmpegโ
- Patterns may need adjustment due to resolution difference
- Enable DPI scaling:
brobot.dpi.resize-factor=1.25 # or 'auto' - Test similarity threshold - may need adjustment
Troubleshootingโ
Common Issues and Solutionsโ
"FFmpeg not available" Errorโ
Solution: FFmpeg via JavaCV is bundled with Brobot. Ensure the library module is properly built and included.
Patterns Not Matching After Provider Switchโ
Solution: Check DPI settings. FFmpeg captures physical resolution while SikuliX/Robot capture logical resolution.
Different Colors Between Capturesโ
Solution: This is normal - slight color variations don't affect pattern matching above 70% similarity threshold.
Summaryโ
Based on testing and configuration analysis, FFmpeg (JavaCV) is the recommended capture provider for Brobot. It captures at full physical resolution and works well with patterns created using Windows Snipping Tool or SikuliX IDE.
Key Takeawaysโ
- โ FFmpeg captures at physical resolution for better accuracy
- โ Compatible with Windows Snipping Tool and SikuliX IDE patterns
- โ The Brobot Pattern Capture Tool supports all capture providers
- โ All capture methods can work together with proper configuration
Next Stepsโ
- Configure your
application.propertieswith recommended settings - Choose a capture workflow that fits your process
- Test pattern matching with your specific display configuration
- Adjust DPI settings if needed (see DPI Guide)
Related Documentationโ
Capture Systemโ
- DPI and Resolution Guide - Comprehensive DPI scaling strategies and troubleshooting
- Modular Capture System - Complete capture provider details and configuration
- Pattern Capture Tool Guide - Using the Brobot Pattern Capture Tool
- Quick Start Capture Setup - Fast setup guide for optimal capture
- Capture Quick Reference - Command reference for capture operations
Configurationโ
- Properties Reference - Complete Brobot configuration properties
- ActionConfig Reference - Action configuration including similarity thresholds
Testing & Debuggingโ
- Debugging Pattern Matching - Troubleshooting pattern matching issues
- Mock Mode Guide - Testing without GUI