Converting RGB to greyscale

Dears,

I’m trying to convert my RGB camera to greyscale, i have used this command but unfortunatlly it didnt work. if there any alternatives?
cap = cv2.VideoCapture(‘nvarguscamerasrc ! video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12 ! nvvidconv ! appsink’, cv2.CAP_GSTREAMER)
bash: syntax error near unexpected token `(’

Note: I’m trying to convert it to greyscale for calibration purposes using Kalibr in ros

BR,
Hessa

Hi,
Please run the command and share the prints for reference:

$ v4l2-ctl --list-formats-ext

The nvarguscamerasrc plugin is for Bayer sensor through hardware ISP engine. If you use RGB camera, you should use v4l2src plugin.