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:
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).
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.
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.
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.