Jetson Nano, opencv, gstreamer, grayscale

I am trying to stream IR images from Intel Realsense D435i camera and images are basically 8bit uncompressed grayscale. So far I have issues with creating gsteamer pipeline.

This is the code:

        std::string gst_pipeline = fmt::format(
            "appsrc ! video/x-raw,format=GRAY8,width={},height={} ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420’ ! omxh264enc iframeinterval=100  control-rate=2 bitrate=1000000 ! 'video/x-h264,stream-format=byte-stream ! rtph264pay mtu=1400 ! udpsink host={} port={} sync=false async=false",
            _ctx->cam_w, _ctx->cam_h, _ctx->client_ip_address, _ctx->client_port
            );
        std::cout << "gst_pipeline: " << gst_pipeline << std::endl;
        int codec = cv::VideoWriter::fourcc('4', '0', ' ', ' '); // grayscale as in https://softron.zendesk.com/hc/en-us/articles/207695697-List-of-FourCC-codes-for-video-codecs
        video_writer.open(gst_pipeline, CAP_GSTREAMER, 0, (double)_ctx->fps, cv::Size(_ctx->cam_w, _ctx->cam_h), true);

This is the error:

gst_pipeline: appsrc ! video/x-raw,format=GRAY8,width=848,height=480 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)I420’ ! omxh264enc iframeinterval=100  control-rate=2 bitrate=1000000 ! 'video/x-h264,stream-format=byte-stream ! rtph264pay mtu=1400 ! udpsink host=192.168.192.25 port=9000 sync=false async=false

(jetracer:4687): GStreamer-CRITICAL **: 17:12:13.198: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

(jetracer:4687): GStreamer-CRITICAL **: 17:12:13.201: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

(jetracer:4687): GStreamer-CRITICAL **: 17:12:13.210: gst_element_link_pads_filtered: assertion 'GST_IS_BIN (parent)' failed
[ WARN:0] global /home/serhiy/opencv/modules/videoio/src/cap_gstreamer.cpp (1422) open OpenCV | GStreamer warning: error opening writer pipeline: syntax error
Could not open the output video file for write

You would try to remove single quotes from your pipeline code.
Quotes are required with gst-launch in order to prevent shell from interpreting these, but should be avoided for code.

Shame on me for not noticing it. Now pipeline creates.

Thank you.