VCodecOneVpl C++ library v2.0.0

Low-latency video encoding and decoding library for H264, HEVC(H265) and JPEG codecs based on Intel OneVpl API.

Overview

VCodecOneVpl C++ library provides hardware video encoding/decoding for H264, HEVC and JPEG codecs for Intel HD Graphics. VCodecOneVpl class inherits interface and data structures from open source VCodec library and also includes Logger open source library. VCodecOneVpl uses oneVPL. The library provides simple programming interface to be implemented in different C++ projects. The library was written with C++17 standard. The libraries are supplied as source code only. The library is a CMake project.

class VCodecOneVpl : public VCodec {
public:
    /// Encode video frame.
    bool transcode(Frame& src, Frame& dst);
    /// Set parameter value.
    bool setParam(VCodecParam id, float value);
    /// Get parameter value.
    float getParam(VCodecParam id);
    /// Execute command.
    bool executeCommand(VCodecCommand id);
};

How to use

Source code bellow is simple application which encodes video frames (NV12 pixel format, pseudo code used) by H264 codec and writes results to file:

#include "VCodecOneVpl.h"
using namespace cr::video;

int main(void) {
    // Create codec object and set parameters.
    VCodecOneVpl codec;
    codec.setParam(VCodecParam::BITRATE_KBPS, 2500);
    codec.setParam(VCodecParam::GOP, 30);
    codec.setParam(VCodecParam::FPS, 30);
    // Create input NV12 and output H264 frames.
    Frame dstH264; dstH264.fourcc = Fourcc::H264;
    Frame srcNv12;
    // Create output file.
    FILE *out = fopen("out.h264", "w+b");
    // Encode and record 200 frames.
    for (int n = 0; n < 200; ++n) {
        // Get NV12 frame pseudo code.
        srcNv12 = getNextFrame();
        // Encode.
        if (!codec.transcode(srcNv12, dstH264))
            continue;
        // Write to file.
        fwrite(dstH264.data, dstH264.size, 1, out);
    }
    // Close file.
    fclose(outputFile);
    return 1;
}

Price and Terms

The VCodecOneVpl C++ library is supplied under a license in source code. Library pricing is available upon request info@constantrobotics.com

Downloads

VSourceOneVpl C++ library programmer’s manual: DOWNLOAD