If possible, we recommend to use gstreamer-1.0. Mentioned higher CPU usage is because of raw->nv format conversion.
If we can pass NVMM buffers (NV format) to encoder then we will not see higher CPU load. Following experiment will help understand better.
I have generated a mjpeg file with 3000 buffers. This file is decoded using OSS jpegdec. Output of jpegdec is fed to jpegenc.
gst-launch-1.0 filesrc location= enc640x480_mjpeg_3000.mp4 ! qtdemux ! jpegdec ! jpegenc ! filesink location=test_out.jpg -e
Tegrastats results below:
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [3%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [1%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [1%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 449/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,1%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 449/3854MB (lfb 733x4MB) SWAP 0/0MB (cached 0MB) cpu [0%,100%,0%,0%]@1912 EMC 4%@1600 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
Now the same file is decoded using nvjpegdec. Output of this is NVMM buffer which is fed to nvjpegenc.
gst-launch-1.0 filesrc location= enc640x480_mjpeg_3000.mp4 ! qtdemux ! nvjpegdec ! nvjpegenc ! filesink location=test_out.jpg -v -e
Tegrastats results below:
RAM 447/3854MB (lfb 732x4MB) SWAP 0/0MB (cached 0MB) cpu [3%,54%,0%,0%]@825 EMC 14%@665 AVP 1%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 446/3854MB (lfb 732x4MB) SWAP 0/0MB (cached 0MB) cpu [7%,3%,54%,0%]@921 EMC 14%@665 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 447/3854MB (lfb 732x4MB) SWAP 0/0MB (cached 0MB) cpu [4%,54%,0%,0%]@825 EMC 14%@665 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 732x4MB) SWAP 0/0MB (cached 0MB) cpu [2%,56%,0%,0%]@825 EMC 14%@665 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 448/3854MB (lfb 732x4MB) SWAP 0/0MB (cached 0MB) cpu [4%,32%,23%,1%]@825 EMC 14%@665 AVP 0%@80 VDE 0 GR3D 0%@76 EDP limit 1912
RAM 446/3854MB (lfb 731x4MB) SWAP 0/0MB (cached 0MB) cpu [14%,22%,0%,23%]@204 EMC 14%@665 AVP 0%@115 VDE 0 GR3D 0%@76 EDP limit 1912
As an be seen if NVMM buffers are provided to nvjpegenc, then we do not increase CPU utilization. In summary, the higher CPU load is because of the raw->nv conversion. This is expected result.