No preview is shown with nvgstcapture-1.0

I am using nvgstcapture-1.0 for recording videos. My camera is Raspberry Pi HQ (IMX477) camera and I am able to record videos up to 4K@30Hz with nvgstcapture-1.0. However, I am not able to see any preview of the video on the screen. On the other hand, when working with gstreamer I am able to see the video on my screen. Here is the output:

GST_ARGUS: 2592 x 1944 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 2560 x 1440 FR = 40.000000 fps Duration = 25000000 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 1
Output Stream W = 1920 H = 1080
seconds to Run = 0
Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
gpcr
w = 640, h = 480

Didn’t you integrate the driver and device tree to the system?

What’s the output for v4l2-ctl -all and v4l2-ctl --list-formats-ext

v4l2-ctl --all:

Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, imx477 8-001a
Bus info : platform:54080000.vi:4
Driver version: 4.9.201
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 4: no power)
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ‘RG10’
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :

Camera Controls

                 group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                sensor_mode 0x009a2008 (int64)  : min=0 max=0 step=0 default=0 value=1 flags=slider
                       gain 0x009a2009 (int64)  : min=0 max=0 step=0 default=0 value=16 flags=slider
                   exposure 0x009a200a (int64)  : min=0 max=0 step=0 default=0 value=23871 flags=slider
                 frame_rate 0x009a200b (int64)  : min=0 max=0 step=0 default=0 value=30000001 flags=slider
                bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=1
            override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=1
               height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                 size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
           write_isp_format 0x009a2068 (bool)   : default=0 value=0
   sensor_signal_properties 0x009a2069 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
    sensor_image_properties 0x009a206a (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
  sensor_control_properties 0x009a206b (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
          sensor_dv_timings 0x009a206c (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
           low_latency_mode 0x009a206d (bool)   : default=0 value=0
           preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
               sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=4 flags=read-only

v4l2-ctl --list-formats-ext:

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'RG10'
	Name        : 10-bit Bayer RGRG/GBGB
		Size: Discrete 4032x3040
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 2560x1440
			Interval: Discrete 0.025s (40.000 fps)

What about below command.

export DISPLAY=:0
gst-launch-1.0 nvarguscamerasrc ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12" ! nvvidconv ! xvimagesink sync=false

There is a redundant comma after NV12 (corrected). Other than that it works and I am able to see the stream.

OK, maybe you can try to configure the same resolution for nvgstcapture-1.0 to try.

Tried nvgstcapture-1.0 with --prev-res=4 and --video-res=4 (4: 1920x1080). Still no preview.

Could you try overlay sink.

export DISPLAY=:0
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12' ! nvoverlaysink -e

Here is the output:
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 4032 x 3040 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 2592 x 1944 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 2560 x 1440 FR = 40.000000 fps Duration = 25000000 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 1
Output Stream W = 1920 H = 1080
seconds to Run = 0
Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.

Any preview on HDMI display?

No preview.

Looks like nvoverlaysink element have problem on your system. What’s the different for your system.

What information can help to understand the problem?

Any reason need to use nvgstcapture-1.0?

Much easier to use compared to gst-launch-1.0.

Do have no idea due to there’s no any error.