Hello Everybody,
In my project I need to push video frames generated with VisionWorks to a gStreamer pipe. After long reserach I did not find any direct support for it in VisionWorks. I tried to pass via openCV but it fails on error:
— code fragment ---- (I left only relevant lines)
// initialise writer with gstreamer pipeline
cv::VideoWriter writer("appsrc ! … ", 0, (double)30, cv::Size(config.frameWidth, 2*config.frameHeight), true);
// create vx_frame
vx_image bigFrame = vxCreateImage(context,config.frameWidth, config.frameHeight, config.format);
// frame calculation/manipulation
// frame conversion to openCV Mat
cv::Mat bigframe_cv = nvx_cv::VXImageToCVMatMapper(
bigFrame, 0, NULL, VX_READ_AND_WRITE, VX_MEMORY_TYPE_HOST).getMat();
imwrite(“bigframe.png”,bigframe_cv);
writer << bigframe_cv;
— END code fragment ----
this code fails wit a Runtime error:
OpenCV Error: Unsupported format or combination of formats (cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 3.) in CvVideoWriter_GStreamer::writerFrame, file /opt/opencv-2.4.13/modules/highgui/src/cap_gstreamer.cpp, line 1564
terminate called after throwing an instance of ‘cv::Exception’
what(): /opt/opencv-2.4.13/modules/highgui/src/cap_gstreamer.cpp:1564: error: (-210) cvWriteFrame() needs images with depth = IPL_DEPTH_8U and nChannels = 3. in function CvVideoWriter_GStreamer::writerFrame
The output through imwrite command is correct.
Can somebody advise how I can push frames to gstreamer pipe ? Ideally that works directly from VisionWorks, but also a fix using openCV will be very appreciated.
I use Tegra TX1 with latest L4T
VisionWorks library info:
VisionWorks version : 1.5.3
OpenVX Standard version : 1.1.0
OpenCV opencv-2.4.13 compiled with gstreamer support
Great thanks for ideas
Robert