Hello evenyone, I am new in gstreamer. I have a pipeline which is workable in my cmd. And now I have to put it to C/C++, how can I change it to C/C++? Also, I have to change the beginning src to appsrc.
fdsrc fd = 0 ! video/x-h264,width=1920,height=1080,framerate=30/1,streamformat=(string)byte-stream ! h264parse config-interval=1 ! nvv4l2decoder ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink sync=false
My through is.
GstElement *pipeline = gst_pipeline_new("pipeline");
GstElement *appsrc = gst_element_factory_make("appsrc", "appsrc");
GstElement *h264parse = gst_element_factory_make("h264parse", "h264parse");
GstElement *decoder = gst_element_factory_make("nvv4l2dec", "decoder");
GstElement *nvvidconv = gst_element_factory_make("nvvidconv", "nvvidconv");
GstElement *videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
GstElement *appsink = gst_element_factory_make("appsink", "appsink");
g_object_set(G_OBJECT(h264parse), "config-interval", 1, NULL);
g_object_set(G_OBJECT(appsrc), "caps",
gst_caps_new_simple("video/x-h264",
"width", G_TYPE_INT, 1920,
"height", G_TYPE_INT, 1080,
"framerate", GST_TYPE_FRACTION, 30, 1,
"stream-format", G_TYPE_STRING, "byte-stream",
NULL), NULL);
g_object_set(G_OBJECT(appsink), "caps",
gst_caps_new_simple("video/x-raw",
"format", G_TYPE_STRING, "BGR",
NULL), NULL);
g_object_set(appsink, "emit-signals", TRUE, "sync", FALSE, NULL);
g_signal_connect(appsink, "new-sample", G_CALLBACK(on_new_sample), NULL);
gst_bin_add_many(GST_BIN(pipeline), appsrc, h264parse, decoder, nvvidconv, videoconvert, appsink, NULL);
gst_element_link_many(appsrc, h264parse, decoder, nvvidconv, videoconvert, appsink, NULL);
But seems I skip the video/x-raw, format=(string)BGRx
and video/x-raw,format=BGR
, but I dont know how to put into the c pipeline. Can anyone help me, thanks!!