GigE Dummy camera container

Is there anyone here that has created a dummy camera docker container or is this possible to do with the CVB library?

Hi @antonkristensen

what do you mean by “dummy camera” docker container?
We have some people using docker with CVB for various tasks. That said, we are not Docker experts but maybe if you describe what you want to do, we might have some ideas for you to test.

Cheers
Chris

Basically having a container that acts like a genie camera, so you spin up the container and then it gets picked up as a camera by the host.

So, that should not be too much of a problem.
Have you already had a look into our GEVServer examples?
You can use this and create a simple console application that starts up a server and streams images either from a folder or a emu file or even simply a testpattern.

This server behaves like a camera that you can use on any host with CVB.

Sounds great! I had a search and looked into it, do you guys have any kinds of example of starting one of these up? preferably with cvbpy.

@antonkristensen I have a stripped down version of a GevServer that I still had in one of my testprojects.
Edit: I just saw, you requested a py version of the example.
For this just have a look into the tutorials folder of CVB, there is a QmlGevServer Example.
You should easily be able to remove the QT related stuff and get started.
For now I think c++ should be the prefered version here as it is less limited once you want to perform real bandwith and performance tests on your clients.
As I dont know more about you use case, I cant really help you on making the right decision here.
Feel free to use it to get started:

#include <iostream>
#include <cvb/gevserver/server.hpp>
#include <cvb/gevserver/stream.hpp>

int main(int argc, char *argv[])
{
    auto path = Cvb::InstallPath();
    path += CVB_LIT("Tutorial/Clara.bmp"); // using images as source for the server
    path = Cvb::ExpandPath(path);
    auto img = Cvb::Image::Load(path);
    std::vector<std::unique_ptr<Cvb::Image>> imgVector;
    imgVector.push_back(std::move(img));    // add as many images as you like

    Cvb::GevServer::ServerPtr server;

    try    
    {
        server = Cvb::GevServer::Server::CreateWithConstSize(
            img->Size(),
            Cvb::ColorModel::RGBGuess,
            Cvb::DataType::FromNativeType<bool>(),
            Cvb::GevServer::DriverType::Filter);

        server->SetUserVersion("CameraEmulation");
        server->NodeMap()->SetXmlFileVersion(Cvb::GenApi::NodeMap::GenApiVersion(1, 1, 2));
        auto address = Cvb::GevServer::LogicalNetworkInterface::GetAllAvailable().at(0).IPAddress();
        server->Start(address);
        std::cout << "Started server on IP address " << address;
        server->Stream()->SetResendBuffersCount(0);
        auto vec_index = imgVector.begin();
      while (true)
        {
            try           
            {
                server->Stream()->TrySend(*img);
            }
            catch (std::exception)
            {
            }
        }
        return 0;
    }
    catch (const std::exception &error)
    {
        std::cout << error.what() << std::endl;
    }
}

Use the following cmake:

cmake_minimum_required(VERSION 3.5)
project(Minimal_GEV)
set (CMAKE_CXX_STANDARD 14)
#find CVBfile(TO_CMAKE_PATH "$ENV{CVB}/cmake" CVB_MODULE_PATH)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CVB_MODULE_PATH}")
find_package(CVB REQUIRED)
add_executable(${PROJECT_NAME} main.cpp )
target_link_libraries(${PROJECT_NAME} CVB::CvbGevServer)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
if(UNIX)
    target_link_libraries(${PROJECT_NAME} pthread)
endif()

Cheers
Chris