Unfortunately the driver is not quite compatible with the method of using Gstreamer/V4L2 as it is done in this jetson-inference code.
We have connected the HDMI2CSI board to a HDMI source (1280x720p60 UYVY) on input HDMI-In B.
The gst-camera application does work with the following modification.
$ git diff
diff --git a/camera/gstCamera.cpp b/camera/gstCamera.cpp
index 22e981e..7940da8 100644
--- a/camera/gstCamera.cpp
+++ b/camera/gstCamera.cpp
@@ -277,6 +277,7 @@ void gstCamera::checkBuffer()
// buildLaunchStr
bool gstCamera::buildLaunchStr()
{
+
// gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! \
// nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! fakesink silent=false -v
std::ostringstream ss;
@@ -284,17 +285,18 @@ bool gstCamera::buildLaunchStr()
//#define CAPS_STR "video/x-raw(memory:NVMM), width=(int)2592, height=(int)1944, format=(string)I420, framerate=(fraction)30/1"
//#define CAPS_STR "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1"
- if( onboardCamera() )
+ if( false ) //onboardCamera() )
{
ss << "nvcamerasrc fpsRange=\"30.0 30.0\" ! video/x-raw(memory:NVMM), width=(int)" << mWidth << ", height=(int)" << mHeight << ", format=(string)NV12 ! nvvidconv flip-method=2 ! "; //'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! ";
ss << "video/x-raw ! appsink name=mysink";
}
else
- {
+ {/*
ss << "v4l2src device=/dev/video" << mV4L2Device << " ! ";
ss << "video/x-raw, width=(int)" << mWidth << ", height=(int)" << mHeight << ", ";
- ss << "format=RGB ! videoconvert ! video/x-raw, format=RGB ! videoconvert !";
- ss << "appsink name=mysink";
+ ss << "format=UYVY ! videoconvert ! video/x-raw, format=RGB ! videoconvert !";
+ ss << "appsink name=mysink";*/
+ ss << "v4l2src device=/dev/video2 ! video/x-raw, width=1280, height=720, framerate=60/1, format=UYVY ! videoconvert ! video/x-raw, format=NV12 ! videoconvert ! appsink name=mysink";
}
mLaunchStr = ss.str();
Basically we use a custom GStreamer pipeline with the input source set to /dev/video2 and the resolution set to 1280x720 (which is what the application seems to expect) and the correct format conversion.
Rebuild the application (make in the build directory) and start it with these commands:
$ sudo modprobe tc358840
$ DISPLAY=:0 aarch64/bin/gst-camera
Edit: removed ^M newline characters from diff