Gstreamer performance on AGX Xavier

Hi evereyone,

I try to use Gstreamer for video encoding on my AGX Xavier board, My goal is to use the best encoding technique available. For my tests, I use the following instruction:

gst-launch-1.0 multifilesrc location="./image_raw/frame%01.jpg" index=0 caps="image/jpeg,framerate=20/1" ! jpedec ! videoconvert ! videorate ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! omxh264enc control-rate=0 qp-range=0,1:0,1:0,1 quant-i-frame=0 quant-p-frame=0 ! mp4mux ! filesink location=test_video.mp4

The images I use for encoding are in 4k quality.

This instruction works very well, but my problem is that when I look for the CPU and GPU consumption, it gives me a means value of 25 % for CPU and 3 % for GPU (I’m in max performance mode).

As far as I understand, this website : Jetson Linux API Reference: Main Page | NVIDIA Docs explains that Gstreamer inderectly use GPU hardware component in order to work.

So my question is : is it normal to have a such low level of GPU consumption using Gstreamer, and is it possible to boost it ?

Thanks for sharing knowledge !

Gstreamer itself only use CPU, but some plugins may use GPU (such as nvivafilter) or dedicated HW (nvvidconv, nvv4l2decoder, nvv4l2*enc, omxh264enc, …).

You may try to leverage HW decoding with :

gst-launch-1.0 -e multifilesrc location="img_%05d.jpg" index=0 caps="image/jpeg,framerate=20/1" ! nvjpegdec ! omxh264enc ! mp4mux ! filesink location=test_video.mp4

# Or this one but you would have to provide width and height:
gst-launch-1.0 -e multifilesrc location="img_%05d.jpg" index=0 caps="image/jpeg,width=320, height=240, framerate=20/1" ! nvv4l2decoder mjpeg=1 ! omxh264enc ! mp4mux ! filesink location=test_video.mp4

Then tegrastats should show NVDEC and HWDEC usage. No GPU usage from these pipelines.

Hi @C.LB

As @Honey_Patouceul, GStreamer uses CPU for administrative tasks and most elements. However, elements such as the filtering ones, may use GPU. For video encoding/decoding, the Jetson boards are likely to have accelerator for those tasks, offloading the processing from the CPU/GPU to more specialised hardware units. That’s why you cannot observe the usage in CPU/GPU.

Best regards,
Leon.

Hi,
For JPEG decoding, please try nvv4l2decoder mjpeg=1 as Honey Patouceul has suggested. And use nvv4l2h264enc for video encoding since we have deprecated omx plugins.