nvvidconv top cpu usage Jetson TX2

hello,
I have tried the following command to capture mp4 video file.
gst-launch-1.0 -v v4l2src device=“/dev/video0” ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)I420’ ! omxh264enc ! ‘video/x-h264, stream-format=(string)byte-stream’ ! h264parse ! qtmux ! filesink location=test.mp4 -e

top usgage for that:( CPU–>>93.4 )

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2955 nvidia 20 0 627476 14588 11188 S 93.4 0.2 0:14.34 gst-launch-1.0

top usgage for only capture UYVYSensor gstreamer pipeline:( CPU–>>0.3 )
gst-launch-1.0 -v v4l2src device=“/dev/video0” ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080’ ! fakesink

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2965 nvidia 20 0 253004 8292 6352 S 0.3 0.1 0:00.22 gst-launch-1.0

and top usgage for capture and nvvidconv gstreamer pipeline:( CPU–>>92.1 )

gst-launch-1.0 -v v4l2src device=“/dev/video0” ! ‘video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)I420’ ! fakesink

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2973 nvidia 20 0 254748 8892 6856 S 92.1 0.1 0:05.56 gst-launch-1.0

My Board Info is:
Jetson TX2-4GB
L4T:28.1
v4l2 bus format:MEDIA_BUS_FMT_UYVY8_1X16


$ v4l2-ctl -V

Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ‘UYVY’
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default
YCbCr Encoding : Default
Quantization : Default
Flags :


could you tell me What is the reason for top cpu usage of gstreamer nvvidconv in Jetson TX2??

Hi,
You may also profile with ‘sudo tegrastats’.

What you observe is normal since there is a memcpy in

'video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080' ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)I420'

It copies UYVY ‘video/x-raw’ buffer to ‘video/x-raw(memory:NVMM)’ buffer and then convert it to I420. Copying ‘video/x-raw’ to ‘video/x-raw(memory:NVMM)’ takes certain CPU loading.

We have optimized the case in tegra_multimedia_api. You may refer to 12_camera_v4l2_cuda sample.

DaneLLL,Thank you for your help
According to this link,
https://devtalk.nvidia.com/default/topic/1049473/jetson-tx2/what-is-the-difference-between-video-x-raw-memory-nvmm-and-video-x-raw-/post/5327307/#5327307

video/x-raw is CPU buffer.
video/x-raw(memory:NVMM) is DMA buffer.

But,same gstreamer command in nvidia Jetson TX1,cpu useage rate is 42%,The Image is attached

gst-launch-1.0 -v v4l2src device="/dev/video0" ! "video/x-raw,width=1920,height=1080, format=(string)UYVY" ! nvvidconv ! 'video/x-raw(memory:NVMM), format=I420' ! queue ! omxh264enc ! h264parse ! matroskamux ! filesink location=test_4k_h264_1.mkv -e

Why is this command less cpu usage for board tx1 with the same YUV driver?

Thanks for any help you can recommend me.

Hi,
Please also run ‘suo jetson_clocks’ to run in fixed CPU clocks. By default the CPU clocks vary due to loading.
Also please compare ‘sudo tegrastats’