Hi,
I have a hdmi → csi convert board TC358743 . Here is formats output with
v4l2-ctl -d /dev/video0 --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'RGGB'
Name : 8-bit Bayer RGRG/GBGB
Index : 1
Type : Video Capture
Pixel Format: 'RG10'
Name : 10-bit Bayer RGRG/GBGB
Index : 2
Type : Video Capture
Pixel Format: 'BG10'
Name : 10-bit Bayer BGBG/GRGR
Index : 3
Type : Video Capture
Pixel Format: 'RG12'
Name : 12-bit Bayer RGRG/GBGB
Index : 4
Type : Video Capture
Pixel Format: 'UYVY'
Name : UYVY 4:2:2
Index : 5
Type : Video Capture
Pixel Format: 'NV16'
Name : Y/CbCr 4:2:2
Index : 6
Type : Video Capture
Pixel Format: 'UYVY'
Name : UYVY 4:2:2
And success test with gst-launch-1.0 with follow command
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=1920, height=1080, format=UYVY' ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12' ! nvtee ! nvivafilter cuda-process=true pre-process=true post-process=true customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink display-id=0 -e
Then I can get the image from my own hdmi device .
And now I want to use opencv VideoCapture with Gstreamer to capture the video . Here is my code
VideoCapture capture("v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,format=(string)UYVY ! nvvidconv ! video/x-raw(memory:NVMM),width=1920,height=1080,format=(string)I420 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink");
if (!capture.isOpened())
{
cout << "capture device failed to open!" << endl;
return 1;
}
But I get the output is capture device failed to open! .
My opencv version is 3.3 with gstreamer plugin.
Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: YES
-- avcodec: YES (ver 56.60.100)
-- avformat: YES (ver 56.40.101)
-- avutil: YES (ver 54.31.100)
-- swscale: YES (ver 3.1.101)
-- avresample: NO
-- GStreamer:
-- base: YES (ver 1.8.3)
-- video: YES (ver 1.8.3)
-- app: YES (ver 1.8.3)
-- riff: YES (ver 1.8.3)
-- pbutils: YES (ver 1.8.3)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- OpenNI2: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- Aravis SDK: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: NO/YES
-- XIMEA: NO
-- Xine: NO
-- Intel Media SDK: NO
-- gPhoto2: NO
How can I modify to make it work.
Anything suggestions are appreciate !