AVCapture2

Supported Hardware Devices: Pro Capture cards, USB Capture devices

Contents Demonstrated in the Sample:

  1. Preview captured video and monitor captured audio
  2. Freely select video capture devices and their corresponding audio devices
  3. Freely switch capture parameters: resolution, frame rate, color space
  4. Support multi-channel capture: simultaneously capture one or two audio/video streams and render them separately

Call Logic:

  1. Obtain version information, initialize and enumerate devices: MWGetVersion, MWCaptureInitInstance, MWRefreshDevice, MWGetChannelCount
  2. Filter supported devices based on device information and interface information: MWGetChannelInfoByIndex
  3. Create a video rendering layer and overlay it on the current window: createPreviewLayer
  4. Open channel: MWGetDevicePath, MWOpenChannelByPath
  5. Create audio renderer: MWAudioRenderCreate, MWAudioRenderStart
  6. Start video capture: MWCreateVideoCapture
  7. Start audio capture: MWCreateAudioCapture
  8. Enter main thread loop
  9. Click menu to switch audio/video channels or capture parameters:
    1. Stop audio capture: MWDestroyAudioCapture
    2. Stop video capture: MWDestroyVideoCapture
    3. Destroy audio renderer: MWAudioRenderStop, MWAudioRenderDestroy
    4. Close channel: MWCloseChannel
    5. Open channel and capture/render according to set channel and capture parameters: steps 4, 5, 6, 7
  10. After clicking the close button, exit capture and release resources:
    1. Stop audio capture: MWDestroyAudioCapture
    2. Stop video capture: MWDestroyVideoCapture
    3. Destroy audio renderer: MWAudioRenderStop, MWAudioRenderDestroy
    4. Close channel: MWCloseChannel
    5. Destroy instance: MWCaptureExitInstance.

Result:

Result Display 1

Result Display 2

Result Display 3

Result Display 4

Flowchart:

AVCapture2 Flowchart

results matching ""

    No results matching ""

    results matching ""

      No results matching ""