Question on adjusting frame rate of pipeline

Marianna Smidth Buschle msb at qtec.com
Mon Oct 11 10:44:51 UTC 2021


Try adding --gst-debug=*:3 to the failing command line.

If you are getting a non-negotiated error then it is because your source 
doesn't support a fps of 25.

Fx my webcam only supports 10/1:

msb at QTEC-P53-MSB-Debian:~/QtecGit/python-tests$ gst-launch-1.0 v4l2src ! 
video/x-raw, framerate=5/1 ! fakesink --gst-debug=*:3
PAUSERER rørledning ...
Rørledningen kører, og behøver ikke at blive PREROLL'ed ...
Rørledningen er PREROLL'ed ...
Rørledning sættes til AFSPIL ...
New clock: GstSystemClock
0:00:00.132050019 18347 0x55e8e83d6f00 WARN basesrc 
gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: Internal data 
stream error.
0:00:00.132109933 18347 0x55e8e83d6f00 WARN basesrc 
gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: streaming stopped, 
reason not-negotiated (-4)
FEJL: fra element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal 
data stream error.
Yderligere fejlsøgningsinformation:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): 
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000560010
Rørledning sættes til NUL ...
Rørledning frigøres ...

If you install v4l-utils you can use: v4l2-ctl -d <videodev> --all

And it will tell you what it supports:

Video input : 0 (Camera 1: ok)
Format Video Capture:
     Width/Height      : 1280/720
     Pixel Format      : 'YUYV' (YUYV 4:2:2)
     Field             : None
     Bytes per Line    : 2560
     Size Image        : 1843200
     Colorspace        : sRGB
     Transfer Function : Default (maps to sRGB)
     YCbCr/HSV Encoding: Default (maps to ITU-R 601)
     Quantization      : Default (maps to Limited Range)
     Flags             :
Crop Capability Video Capture:
     Bounds      : Left 0, Top 0, Width 1280, Height 720
     Default     : Left 0, Top 0, Width 1280, Height 720
     Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height 
720, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height 
720, Flags:
Streaming Parameters Video Capture:
     Capabilities     : timeperframe
     Frames per second: 10.000 (10/1)

Best Regards

Marianna

> 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

-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”

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


More information about the gstreamer-devel mailing list