CaptureByInput
Supported Hardware Devices: Pro Capture cards
Contents Demonstrated in the Sample:
- Capturing video data according to the format of input signals
- Saving the last frame of video data as a BMP image
- Channel selection via command parameters when multiple devices are available
Call Logic:
- Obtain version information, initialize, and enumerate devices: MWGetVersion, MWCaptureInitInstance, MWRefreshDevice, MWGetChannelCount
- Filter supported devices based on device and interface information: MWGetChannelInfoByIndex
- Open the device:
- Open the device specified by command parameters: MWOpenChannel
- When no device is specified in command parameters, open the first available channel by default: MWGetDevicePath, MWOpenChannelByPath
- Retrieve video signal status: MWGetVideoSignalStatus
- Start video capture: MWStartVideoCapture
- Create event: MWCreateEvent
- Register for message notifications: MWRegisterNotify MWCAP_NOTIFY_VIDEO_FRAME_BUFFERED (normal mode), MWCAP_NOTIFY_VIDEO_FRAME_BUFFERING (low-latency mode)
- Wait for event: MWTryWaitEvent, MWWaitEvent
- Capture video data: MWCaptureVideoFrameToVirtualAddressEx MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERED (normal mode), MWCAP_VIDEO_FRAME_ID_NEWEST_BUFFERING (low-latency mode)
- Retrieve current capture status: MWGetVideoCaptureStatus
- Repeat steps 8, 9, and 10 until the last frame
- Save file
- Deregister message notifications: MWUnregisterNotify
- Close event: MWCloseEvent
- Stop capture: MWStopVideoCapture
- Release resources: MWCloseChannel, MWCaptureExitInstance
Result:


Flowchart:
