Question on adjusting frame rate of pipeline

Howling wong watertreader at hotmail.com
Mon Oct 11 10:17:17 UTC 2021


Hi

I have a question on frame rate on gstreamer in coding. I have set a caps filter after the video src (v4l2src)

A code snippet
GstCaps *caps;
       caps   =  gst_caps_new_simple("video/x-raw",
                                                           "width",   G_TYPE_INT, 640,
                                                           "height",  G_TYPE_INT, 480,
                                                           "framerate",   GST_TYPE_FRACTION, 30, 1,
                                                           "is-live", G_TYPE_BOOLEAN, TRUE,
                                                            NULL);

if((gst_element_link_filtered(src,
                                              caps))!=TRUE)
{
                  g_print(" Could not link pipeline\n");
                  gst_object_unref (GST_OBJECT (pipeline));
                 return 0;
}

I have 3 branches to the source (1) Display (2) Records (3) sending video elsewhere. But it is only at caps, I define the size of video and the frame rate to collect

Video play smoothly.  However when I changed to a lower value of framerate to 25, the video refuse to play. I wonder why? isnt the lower framerate would have lesser stress on the system resource


A little other experiment that I have done using command line:

Pipeline play
>> gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! autovideosink

Pipeline do not play
>> gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=640, height=480, framerate=25/1 ! videoconvert ! autovideosink

Would like suggestion on what to do next

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20211011/f2410148/attachment-0001.htm>


More information about the gstreamer-devel mailing list