Save jepg iamges using multifilesink on jetson tx2

I am trying to take snapshot from rtsp on jetson tx2, it worked fine.

Command:
gst-launch-1.0 -e rtspsrc location=rtsp://admin:Cms123456@192.168.1.64/h264/ch1/main/av_stream latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvjpegenc ! multifilesink location=test_%03d.jpeg

  I am getting images in the specified directory. This command can capture 20 pictures per second as the rtsp live stream is 20fps. But I want to get picture every 5sec.I think

there are two ways maybe. I can try to change the video rate or add a delay element to the pipeline. I try but failed(I am a newcomer for gstreamer).

  Could someone give some advice about these problems, thank you very much!

You may try something like this:

gst-launch-1.0 rtspsrc location=rtsp://admin:Cms123456@192.168.1.64/h264/ch1/main/av_stream latency=0 ! rtph264depay ! h264parse ! omxh264dec ! 'video/x-raw, format=NV12' ! videorate ! 'video/x-raw, framerate=1/5' ! videoconvert ! 'video/x-raw, format=I420' ! nvjpegenc ! multifilesink location=test_%03d.jpeg

Hi Honey_Patouceul, Thanks for your reply. It worked fine.

But the cpu usage for gst-launch-1.0 process is about 45%.

Is there any way of reducing the cpu usage?

You may try to boost your jetson with :

sudo nvpmodel -m 0
sudo /home/nvidia/jetson_clocks.sh

Thanks Honey_Patouceul, it works! :D