we are attempting to use the C++ API to connect to a Teledyne gig-e-camera and record videos with it. We are on Windows 10 and compiling with CMake and g++.
Connecting to the camera and grabbing images is working fine. We accomplish this with
Cvb::String path(CVB_LIT("%CVB%/drivers/GenICam.vin")); path = Cvb::ExpandPath(path); auto device = Cvb::DeviceFactory::Open(path); auto stream = device->Stream(0); stream->Start(); auto waitResult = stream->WaitFor(std::chrono::seconds(10)); auto img = waitResult.Image;
However, we are not able to record videos with the C++ API. Looking at the documentation, we are trying to use the Recorder class which is found in
// Path std::string video_path = "here.avi"; // Size int video_height = 512; int video_width = 512; Cvb::Size2D <int> video_size(video_height, video_width); // Format auto recorder_format = Cvb::Movie2::RecorderPixelFormat::Color; // Create Recorder Cvb::Movie2::Recorder recorder(video_path, video_size, recorder_format);
Unfortunately, when we try to compile this, we get linker errors that look like this:
CMakeFiles\gig_e_cam.dir/objects.a(gig_e_cam.cpp.obj):gig_e_cam.cpp:(.text$_ZN3Cvb5V_1_16Movie28RecorderC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS0_6Size2DIivEENS1_19RecorderPixelFormatENS1_16RecorderSettingsE[_ZN3Cvb5V_1_16Movie28RecorderC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS0_6Size2DIivEENS1_19RecorderPixelFormatENS1_16RecorderSettingsE]+0x828): undefined reference to `Movie2StartRecording'
My questions are:
- are we on the right track with the
Movie2::RecorderClass if we want to grab videos, both for streaming and saving to disk? If yes, how is it connected to the
streamobject from above?
- What is causing this linker Error?
Any help would be much appreciated.