Applications Using GStreamer with V4L2 Source Plugin

System version: jetpack 5.1.2
The omxh264enc plugin was not found with the following command, was it deprecated in jetpack 5.1.2? Or do you need to install?

➜  ~ gst-launch-1.0 v4l2src num-buffers=200 device=/dev/video0 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1' ! videoconvert ! omxh264enc ! qtmu
x ! filesink location=test.mp4 -ev
WARNING: erroneous pipeline: no element "omxh264enc"

Use the following command to save files encoded in MP4 format, and the CPU usage is 70%.

➜  ~ gst-launch-1.0 v4l2src device=/dev/video0 \
! video/x-raw, width=1920, height=1080, framerate=30/1 \
! nvvidconv \
! nvv4l2h264enc bitrate=2000000 ! video/x-h264 \
! h264parse ! qtmux ! filesink location=camera.mp4

The GStreamer video streaming application I developed, when opening the mipi camera to capture images, the CPU usage rate of vi-output TP28 is very high,Reach 92 percent, how can I troubleshoot the problem of high vi-output CPU?
The screenshot is as follows:

Please try nvv4l2camerasrc instead of v4l2src.
Suppose you should be able find some sample by search in this forum.

Thanks

Hello, can I use nvv4l2camerasrc instead of v4l2src to reduce CPU usage?

I just used the following command line to display images normally
➜ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nv3dsink -e

Hi,
Your command looks good. Please run sudo jetson_clocks and sudo tegrastats to compare CPU usage of using v4l2src and nvv4l2camerasrc

1 Like

Hello, using the nvv4l2camerasrc command to open the CPU in the terminal does not occupy high, but I transferred to the application through appsink, and the view image is green screen,below are the element definitions in my C++ program

std::ostringstream ss;
ss <<"nvv4l2camerasrc device=/dev/video0 ! video/x-raw(memory:NVMM), width=1920, height=1080,interlace-mode=progressive, framerate=30/1, format=UYVY! nvvidconv ! video/x-raw(memory:NVMM), format=(string)NV12 ! appsink name=raw_sink max-buffers=1 drop=true";

Hi,
Please try

"nvv4l2camerasrc device=/dev/video0 ! video/x-raw(memory:NVMM), width=1920, height=1080,interlace-mode=progressive, framerate=30/1, format=UYVY! nvvidconv ! video/x-raw, format=(string)NV12 ! appsink name=raw_sink max-buffers=1 drop=true"

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.