0
Skip to Content
Home
RapidPixel SDK
Consulting
Constant Robotics
Constant Robotics
Home
RapidPixel SDK
Consulting
Constant Robotics
Constant Robotics
Home
RapidPixel SDK
Consulting
Home VSourceV4L2 C++ lib. Video capture and video source control based on V4L2 API
vsource4l2_thumbai.png Image 1 of
vsource4l2_thumbai.png
vsource4l2_thumbai.png

VSourceV4L2 C++ lib. Video capture and video source control based on V4L2 API

€1,500.00

VSourceV4L2 C++ library version 2.1.5 provides video capture and video source (V4L2 compatible video sources) control function based on V4L2 API for Linux.

We sell source code of this library as is, without future updates and technical support according to perpetual non-exclusive license. You pay once and can use this library in your software and hardware products without limits. Please read the license agreement before purchasing: LICENSE. You can buy technical support service for this product.

Add To Cart

VSourceV4L2 C++ library version 2.1.5 provides video capture and video source (V4L2 compatible video sources) control function based on V4L2 API for Linux.

We sell source code of this library as is, without future updates and technical support according to perpetual non-exclusive license. You pay once and can use this library in your software and hardware products without limits. Please read the license agreement before purchasing: LICENSE. You can buy technical support service for this product.

Technical support service technical_support_thumbai.png (Copy) technical_support_thumbai.png (Copy)
Technical support service
from €700.00
Options:

VSourceV4L2 C++ library version 2.1.5 provides video capture and video source (V4L2 compatible video sources) control function based on V4L2 API for Linux.

We sell source code of this library as is, without future updates and technical support according to perpetual non-exclusive license. You pay once and can use this library in your software and hardware products without limits. Please read the license agreement before purchasing: LICENSE. You can buy technical support service for this product.

Purchase options

You can buy the software by bank transfer. Bank transfer available only for companies. To buy software by bank transfer please send us request to info@constantrobotics.com. Also, you can buy technical support service for this product.

Downloads

Programmer’s manual: DOWNLOAD

Overview

VSourceV4L2 C++ library provides video capture and video source (V4L2 compatible video sources) control function based on V4L2 API. The library supports stepwise and discrete devices. The library inherits interface from open source VSource interface class. VSource.h file contains data structures VSourceParams class (contains video source params and provides methods for serialization / deserialization params), VSourceCommand enum (describes video source action commands), VSourceParam enum (describes video source params) and includes VSourceV4L2 class declaration. VSourceV4L2 depends on: Libcamera API, VSource interface class (provides interface for video sources, source code included, Apache 2.0 license) and open source Logger library (provides method to write logs, source code included, Apache 2.0 license). The library provides auto detection of supported resolution, format and fps. If particular devices doesn't support requested pixel format, resolution or fps, the library will set most appropriate parameters. The library supports C++17 standard.

Simple interface

namespace cr
{
namespace video
{
/**
 * @brief Video source class based on V4L2 API.
*/
class VSourceV4L2 : public VSource
{
public:

    /// Class constructor.
    VSourceV4L2();

    /// Class destructor.
    ~VSourceV4L2();

    /// Get string of current library version.
    static std::string getVersion();

    /// Open video source.
    bool openVSource(std::string& initString) override;

    /// Init video source.
    bool initVSource(VSourceParams& params) override;

    /// Get open status.
    bool isVSourceOpen() override;

    /// Close video source.
    void closeVSource() override;

    /// Get new video frame.
    bool getFrame(Frame& frame, int32_t timeoutMsec = 0) override;

    /// Set video source param.
    bool setParam(VSourceParam id, float value) override;

    /// Get video source param value.
    float getParam(VSourceParam id) override;

    /// Get video source params structure.
    void getParams(VSourceParams& params) override;

    /// Execute command.
    bool executeCommand(VSourceCommand id) override;

    /// Decode and execute command.
    bool decodeAndExecuteCommand(uint8_t* data, int size) override;
};
}
}

Simple example

#include <iostream>
#include "VSourceV4L2.h"

int main(void)
{
    // Init video source.
    cr::video::VSource* source = new cr::video::VSourceV4L2();
    std::string initString = "/dev/video0";
    if (!source->openVSource(initString))
        return -1;

    // Main loop.
    cr::video::Frame frame;
    while (true)
    {
        // Wait new frame 1 sec.
        if (!source->getFrame(frame, 1000))
            continue;

        std::cout << "New frame " << frame.frameId <<
        " (" << frame.width << "x" << frame.height << ") cycle time : " <<
        (int)source->getParam(cr::video::VSourceParam::CYCLE_TIME_MKS) <<
        " mksec" << std::endl; 
    }
    
    return 1;
}

You Might Also Like

VOutputV4L2 C++ lib. Simple interface to write video frame to V4L2 output devices
VOutputV4L2 C++ lib. Simple interface to write video frame to V4L2 output devices
€600.00
VSourceOpenCv C++ lib. Video capture and video source control based on OpenCV
VSourceOpenCv C++ lib. Video capture and video source control based on OpenCV
€200.00
VSourceLibCamera C++ lib. Video capture and video source control based on Libcamera API
VSourceLibCamera C++ lib. Video capture and video source control based on Libcamera API
€1,500.00

ABOUT US

ConstantRobotics conducts scientific research in video processing, control protocols, and data exchange. Our diverse team of engineers develops software libraries and applications to simplify complex problems. Customers can test our libraries on their own data before making a purchase. Detailed documentation is available on our website. Our main focus is creating real-time algorithms that run on any platform.

CONTACTS

ConstantRobotics Sp. z o.o. Warsaw, Poland, VAT ID: PL5252930273, info@constantrobotics.com

LICENSES FOR SOFTWARE

Our software libraries are distributed under perpetual licenses. We don't restrict distribution of software libraries as a part of your hardware and software products. Our library prices are the same for all our clients and are based on the following principle: you can create a counterpart of our algorithms with the same or better characteristics, but the cost of your own research will be significantly higher than buying ready-made libraries. By purchasing our libraries you get a solution with proven performance. Two licenses are available for our products: a perpetual license for the compiled version of the library and a perpetual license for the source code. You pay once at the time of purchase. Download licenses:

  • LICENSE FOR SOURCE CODE OF SOFTWARE

  • LICENSE FOR COMPILED VERSION OF SOFTWARE

SEND US MESSAGE

Thank you! We will connect you soon.


© 2025 ConstantRobotics

Privacy Policy | Terms & Conditions | Archive