Skip to content

Commit

Permalink
New Capture Method system
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Sep 3, 2022
1 parent a017599 commit 402a5f9
Show file tree
Hide file tree
Showing 20 changed files with 1,143 additions and 263 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ This program can be used to automatically start, split, and reset your preferred

## Avg. FPS

- Calculates the average comparison rate of the capture region to split images. This value will likely be much higher than needed (unless you [Force Full-Content-Rendering](#Full-Content-Rendering)), so it is highly recommended to limit your FPS depending on the frame rate of the game you are capturing.
- Calculates the average comparison rate of the capture region to split images. This value will likely be much higher than needed, so it is highly recommended to limit your FPS depending on the frame rate of the game you are capturing.

## OPTIONS

Expand All @@ -72,9 +72,29 @@ This program can be used to automatically start, split, and reset your preferred
- Histograms: An explanation on Histograms comparison can be found [here](https://mpatacchiola.github.io/blog/2016/11/12/the-simplest-classifier-histogram-intersection.html). This is a great method to use if you are using several masked images.
- Perceptual Hash: An explanation on pHash comparison can be found [here](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html). It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.

### Full Content Rendering

- Certain windows (namely hardware accelerated ones) won't always render their content. To work around this, you can "Force Full Content Rendering". This option is not recommended unless you really need it. It will cause a 10-15x performance drop based on the size of the complete window that's being captured (not the selected region, but rather the actual window size). It can also mess with some applications' rendering pipeline.
#### Capture Method

- **BitBlt** (fastest, least compatible)
A good default fast option. But it cannot properly record OpenGL, Hardware Accelerated or Exclusive Fullscreen windows.
The smaller the selected region, the more efficient it is.
- **Windows Graphics Capture** (fast, most compatible, capped at 60fps)
Only available in Windows 10.0.17134 and up.
Due to current technical limitations, it requires having at least one audio or video Capture Device connected and enabled. Even if it won't be used.
Allows recording UWP apps, Hardware Accelerated and Exclusive Fullscreen windows.
Adds a yellow border on Windows 10 (not on Windows 11).
Caps at around 60 FPS.
- **Direct3D Desktop Duplication** (slower, bound to display)
Duplicates the desktop using Direct3D.
It can record OpenGL and Hardware Accelerated windows.
About 10-15x slower than BitBlt. Not affected by window size.
overlapping windows will show up and can't record across displays.
- **Force Full Content Rendering** (very slow, can affect rendering pipeline)
Uses BitBlt behind the scene, but passes a special flag to PrintWindow to force rendering the entire desktop.
About 10-15x slower than BitBlt based on original window size and can mess up some applications' rendering pipelines.
- **Video Capture Device**
Uses a Video Capture Device, like a webcam, virtual cam, or capture card.
There are currently performance issues, but it might be more convenient.
If you want to use this with OBS' Virtual Camera, use the [Virtualcam plugin](https://obsproject.com/forum/resources/obs-virtualcam.949/) instead.

### Show Live Similarity

Expand Down
5 changes: 0 additions & 5 deletions res/design.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1008,11 +1008,6 @@
<string>Check for Updates on Open</string>
</property>
</action>
<action name="actionLoop_Last_Split_Image_To_First_Image">
<property name="text">
<string>Force Full Render</string>
</property>
</action>
<action name="actionAuto_Start_On_Reset">
<property name="text">
<string>Check For Updates On Open</string>
Expand Down
114 changes: 73 additions & 41 deletions res/settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>289</width>
<height>540</height>
<height>621</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -19,13 +19,13 @@
<property name="minimumSize">
<size>
<width>289</width>
<height>540</height>
<height>621</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>289</width>
<height>540</height>
<height>621</height>
</size>
</property>
<property name="cursor">
Expand All @@ -46,40 +46,12 @@
<x>10</x>
<y>180</y>
<width>271</width>
<height>101</height>
<height>181</height>
</rect>
</property>
<property name="title">
<string>Capture Settings</string>
</property>
<widget class="QCheckBox" name="force_print_window_checkbox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>6</x>
<y>73</y>
<width>204</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Force a full render of the capture window, which is required for some applications to be captured</string>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string>Force Full Render (slower Max FPS)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
<widget class="QSpinBox" name="fps_limit_spinbox">
<property name="geometry">
<rect>
Expand Down Expand Up @@ -143,12 +115,64 @@
<bool>false</bool>
</property>
</widget>
<widget class="QComboBox" name="capture_method_combobox">
<property name="geometry">
<rect>
<x>6</x>
<y>97</y>
<width>251</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="capture_method_label">
<property name="geometry">
<rect>
<x>6</x>
<y>75</y>
<width>151</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Capture method:</string>
</property>
</widget>
<widget class="QLabel" name="capture_device_label">
<property name="geometry">
<rect>
<x>6</x>
<y>126</y>
<width>151</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Capture device:</string>
</property>
</widget>
<widget class="QComboBox" name="capture_device_combobox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>6</x>
<y>148</y>
<width>251</width>
<height>22</height>
</rect>
</property>
<property name="placeholderText">
<string>Scanning for existing devices...</string>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="image_settings_groupbox">
<property name="geometry">
<rect>
<x>10</x>
<y>290</y>
<y>370</y>
<width>271</width>
<height>241</height>
</rect>
Expand All @@ -175,10 +199,21 @@
</rect>
</property>
<property name="toolTip">
<string/>
</property>
<property name="whatsThis">
<string notr="true"/>
<string>L2 Norm:
This method should be fine to use for most cases.
It finds the difference between each pixel, squares it, sums it over the entire image and takes the square root.
This is very fast but is a problem if your image is high frequency.
Any translational movement or rotation can cause similarity to be very different.

Histograms:
An explanation on Histograms comparison can be found here
https://mpatacchiola.github.io/blog/2016/11/12/the-simplest-classifier-histogram-intersection.html
This is a great method to use if you are using several masked images.

Perceptual Hash:
An explanation on pHash comparison can be found here
http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
It is highly recommended to NOT use pHash if you use masked images. It is very inaccurate.</string>
</property>
<item>
<property name="text">
Expand All @@ -192,7 +227,7 @@
</item>
<item>
<property name="text">
<string>Perceptual Hash</string>
<string>pHash</string>
</property>
</item>
</widget>
Expand Down Expand Up @@ -644,9 +679,6 @@
<tabstop>default_similarity_threshold_spinbox</tabstop>
<tabstop>default_pause_time_spinbox</tabstop>
<tabstop>loop_splits_checkbox</tabstop>
<tabstop>fps_limit_spinbox</tabstop>
<tabstop>live_capture_region_checkbox</tabstop>
<tabstop>force_print_window_checkbox</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
Loading

0 comments on commit 402a5f9

Please sign in to comment.