Why does the "nvv4l2camerasrc" output green screen?

#include
#include <gst/gst.h>
using namespace std;

int main(int argc, char *argv)
{
GstElement *pipeline, *source, *converter, *sink;
GstBus *bus;
GstMessage *msg;
GMainLoop *loop;
GstStateChangeReturn ret;
//initialize all elements
gst_init(&argc, &argv);
pipeline = gst_pipeline_new(“pipeline”);
source = gst_element_factory_make(“nvv4l2camerasrc”, “source”);
converter = gst_element_factory_make(“nvvidconv”, “converter”);
sink = gst_element_factory_make(“nv3dsink”, “sink”);

//check for null objects
if (!pipeline || !source || !converter || !sink)
{
    cout << "not all elements created: pipeline[" << !pipeline << "]"
         << "source[" << !source << "]"
         << "converter[" << !converter << "]"
         << "sink[" << !sink << "]" << endl;
    return -1;
}

//set video source
g_object_set(G_OBJECT(source), "device", argv[1], NULL);
cout << "==>Set video source." << endl;
g_object_set(G_OBJECT(sink), "sync", FALSE, NULL);
cout << "==>Set video sink." << endl;

gst_bin_add_many(GST_BIN(pipeline), source, converter, sink, NULL);
std::cout << "**************" << std::endl;
GstCaps *cap_source;
cap_source = gst_caps_from_string("video/x-raw(memory:NVMM),format=UYVY,width=1920,height=1080,interlace-mode=progressive,framerate=30/1");
std::cout << "------------" << std::endl;

// cap_source = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "(string)UYVY",
//                                  "width", G_TYPE_INT, "(int)1920", "height", G_TYPE_INT, "(int)1080", "framerate",
//                                  GST_TYPE_FRACTION, "(fraction)30/1", 1, NULL);
// GstCapsFeatures *feature = gst_caps_features_new("memory:NVMM", NULL);
// gst_caps_set_features(cap_source, 0, feature);

if (!gst_element_link_filtered(source, converter, cap_source))
{
    g_printerr("Fail to gst_element_link_filtered source -- converter\n");
    return -1;
}
gst_caps_unref(cap_source);

std::cout << "**************" << std::endl;
GstCaps *cap_sink;
cap_sink = gst_caps_from_string("video/x-raw(memory:NVMM),format=NV12");
std::cout << "------------" << std::endl;

if (!gst_element_link_filtered(converter, sink, cap_sink))
{
    g_printerr("Fail to gst_element_link_filtered converter -- sink\n");
    return -1;
}
gst_caps_unref(cap_sink);

cout << "==>Link elements." << endl;

//set the pipeline state to playing
ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE)
{
    cout << "Unable to set the pipeline to the playing state." << endl;
    gst_object_unref(pipeline);
    return -1;
}
cout << "==>Set video to play." << endl;

//get pipeline's bus
bus = gst_element_get_bus(pipeline);
cout << "==>Setup bus." << endl;

loop = g_main_loop_new(NULL, FALSE);
cout << "==>Begin stream." << endl;
g_main_loop_run(loop);

g_main_loop_unref(loop);
gst_object_unref(bus);
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);

}