The Screen Capture engine works for windows capture but it just crops the screen video according to the specified window size and position. It leads to a problem when the window is overlapped by other applications or pop-up messages. To solve this, there is a Window Capture Engine that is released with the 2.4 version of the SDK.
The way to work with it is similar to the Screen Capture:
- Initialize the device with the DeviceSet method
- Set the target window by its handle (for example, "0x520b62") with the "capture.follow_window_by_handle" property with the PropsSet method.
- Set other properties with the PropsSet method.
When a window is captured, it is rounded by a yellow rectangle:
Whereas on the captured video it looks like this:
Properties
You can manage the engine behavior with different properties by using a PropsSet method or by setting them through the system registry:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFLive\MFDeviceSCR
And once specified in the registry, all the instances of ScreenCapture engine use these values. PropsSet method manages only a single instance of the object.
Name | Default value | Description |
---|---|---|
capture.follow_window_by_handle | none | Capture window by a handle. Once set, "capture.following_mode" is ignored. Possible values:
|
capture.show_mouse | show | Sets behavior of the mouse pointer capturing. Possible values:
|
capture.show_clicks | true | Indicates whether mouse clicks are highlighted on video. Possible values: true, false |
capture.focus_change_speed | 0.2 | Speed of focus changing (fraction per frame units). Possible values: from 0.1 to 1.0 |
capture.memory_format | HDYC | Pixel memory format for hardware mode. Possible values:
|
capture.fps_limit | 30.0 | FPS value (for high values frames can be duplicated on low-performance machines). Possible values: range between 1 and 60. Otherwise, the default value is used. |
capture.frame_size | 1920x1080 | Size of the captured frame. Possible values:
|
capture.highlight_mouse | show | Show mouse highlight on a frame. Possible values:
|
capture.highlight_mouse_color | Yellow(136) | Color of mouse highlight. Possible values:
|
capture.show_keypresses | false | Show key presses. Possible values: true, false |
capture.keypress_text_size | 1.0 | Size of keypress info text. Possible values: range from 0.5 to 2.0 |
capture.background_color | Black(170) | Background color. Possible values:
|
capture.aspect_ratio | keep | Aspect ratio mode. Possible values:
|
capture.sampler_type | linear | Type of a sampler for hardware rendering. Possible values:
|
capture.wait_frame_msec | 0 | Frame wait timeout in milliseconds. |
capture.software_scaling | letter-box | Scaling type for software screen capture. Possible values:
|
capture.audio_device | none | Audio device for capturing sound. Possible values:
|
timecode.print | false | Enable timecode overlay. Possible values: true, false. |
capture.no_frame_max_count | 100 | Sets an interval of "No Video" frames after which the engine is reset. Use "0" to disable. |
You can specify any of these properties with a PropsSet method.
MPlatform SDK:
(myLive as IMProps).PropsSet("device::capture.follow_window_by_handle", "0x520b62"); // note the "device::" prefix please
MFormats SDK:
(myLive as IMFProps).PropsSet("capture.follow_window_by_handle", "0x520b62");