MWCapture SDK Linux  3.3.1.LAST_SVN_COMMIT_NUM
mw_venc

OverView

GPU-accelerated H.264 and H.265 encoding is now supported by SDKv3, using the module named mw_venc. It converts video into stream with H.264 or H.265 (HEVC) compression for network distribution or space-efficient local storage.

GPU hardware encoder engines for video processing include de-interlacing, resizing , cropping and more. This dedicated encoder supports hardware acceleration of the codecs, thus leaving the CPU free for other operations and the graphics engine bandwidth fully available for video rendering. GPU-accelerated encoding enables higher performance in transcoding applications, and can be used in a flexible variety of motherboard configurations.

mw_venc, new in version 3.3.1, is now integrated into the SDK and will be maintained and updated with the SDK in the future.

Key features

mw_venc supports GPU-accelerated H.264 and H.265 encoding of video captured through Magewell capture devices. This feature is supported on GPUs from Nvidia, Intel and AMD. Performance will vary depending on the GPU vendor and model, as well as the motherboard configuration. Suggested configurations will be provided in a test report.

Note that in order to get the best performance from the GPU, the latest driver for the GPU hardware will be required. Please obtain and install the latest driver from your GPU manufacturer.

Features of mw_venc are as follows.

  1. Support for hardware-based encoding of video into H.264/H.265 files

    Please ensure that your GPU supports H.264 and H.265 hardware coding. For details, refer to your GPU vendor's hardware documentation.

  2. Use the following interfaces to enumerate and choose among available hardware encoding devices.

    List GPUs and obtain hardware information using mw_venc_get_gpu_num and mw_venc_get_gpu_info_by_index.

    Create an encoder and start encoding on the GPU specified by the index value using mw_venc_create_by_index.

  3. Custom encoding parameters for various scenarios.

    You can specify custom encoding parameters when creating each encoder instance, allowing you to fit your needs. You can specify profile, bit rate, resolution, frame rate, and even advanced settings including stream control mode and slice number. You can also use the default settings provided by mw_venc_get_default_param to create an encoder. For detailed parameters refer to mw_venc_param_t.

    mw_venc can also change encoding parameters during encoding. You can obtain the value of specified parameters using mw_venc_get_property, and modify the values during encoding using mw_vnc_set_property. For encoding parameters that can be modified, refer to mw_venc_property_t. Some parameters might not be able to be modified during in-progress encoding because the differences between GPU vendors, models and configurations are so varied and complex.

  4. Multi-stream encoding on a single GPU.

    You can create several encoders on a specified GPU using mw_venc_create_by_index. Encoders for H.264 or H.265 videos, or with different encoder settings such as resolutions and bit rates, can be created and can encode video streams simultaneously.

    The limit on the number of encoders supported simultaneously varies depending on the GPU hardware specifications. See your GPU vendor's documentation for detailed information.

  5. Multi-stream encoding on different GPUs

    You can create several encoders on different GPUs using mw_venc_create_by_index. Encoders, for H.264 or H.265, or with different settings such as resolutions and bit rates, can be created and can produce video streams simultaneously, and can work independently without interfering with each other.

System Requirements

vaapi needs to be installed for intel and AMD. cuda is used for nvidia. A newer OS (e.g. ubuntu 16.04 above) is recommended to recognize GPU and have better support for libva and vaapi compilement and build for Linux.

Guidline

API and data structure

C/C++ interfaces are supported by mw_venc.

Interfaces are as follows.

The data structures and definitions of functions related to hardware encoding are in the following files.

The data structures and detailed descriptions of functions related to hardware encoding are as follows.

Examples

VideoEncode is provided as an example, which supports to capture, render, encode, and save videos into H264 or H265 files.