Receiving each second frame in pipeline

Hello!

I run plain pipeline for receiving videodata in JetsonNano:
gst-launch-1.0 v4l2src device=/dev/video0 ! “video/x-raw, format=(string)UYVY, width=(int)640, height=480” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420” ! omxh264enc qp-range=35,35:35,35:-1,-1 ! mpegtsmux ! udpsink clients=192.168.223.103:6000 sync=false

On client side I have this pipeline:
udpsrc name=udpsrc0 ! tsdemux name=tsdemux0 ! queue name=queue0 ! h264parse name=h264parse0 ! avdec_h264 name=avdec_h264-0 ! videoconvert name=videoconvert0 ! appsink name=appsink0

I use CAM_30_CUNANO (NVIDIA Jetson Nano Camera | AR0330 MIPI CSI Camera) on JetsonNano side.

On JetsonNano side the command “v4l2-ctl --list-formats-ext” outputs:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘UYVY’
Name : UYVY 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 2304x1296
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 2304x1536
Interval: Discrete 0.026s (38.000 fps)

So camera has predefined fps (60 fps for 640x480).
My question is:
Is it possible to chage something in pipeline text on JetsonNano side that to take each second, third frame? Because for my case on client side it is need less fps of video stream.

Thanks!

Hi,
Not sure but you should need to set certain controls to v4l2src to run the source in different framerate. Or try videorate plugin.
https://gstreamer.freedesktop.org/documentation/videorate/index.html?gi-language=c

1 Like

DaneLLL,
Thank you for your answer!
I tried to use videorate plugin in my pipeline:
gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw, format=(string)UYVY, width=(int)640, height=480, framerate=60/1" ! videorate drop-only=true ! video/x-raw,framerate=15/1 ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)I420" ! omxh264enc qp-range=35,35:35,35:-1,-1 ! mpegtsmux ! udpsink clients=192.168.223.103:6000 sync=false

I add: videorate drop-only=true ! video/x-raw,framerate=15/1 to my previous pipeline version and it works properly.

Now I can force decrease fps from videocamera up to desire value while the camera has only 60 fps option.

Thank you!