Hi rfracer,
I’m facing similar performance issues. Could you please share your current OpenCV VideoCapture object instantiation code ? What is the net fps performance that you get with this code ?
In my case following line from with in OpenCV application -
VideoCapture cap1("nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)I420, framerate=(fraction)60/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink");
creates considerable lag. Further more with “tegrastats” tool I see that this line jacks up the EMC freq really high, and I get few errors during my run. The video frames on HDMI also seem to lag considerably.
RAM 1977/3995MB (lfb 210x4MB) cpu [47%,53%,81%,17%]@1734 EMC 28%@1600 AVP 2%@12 NVDEC 192 MSENC 192 GR3D 41%@153 EDP limit 1734
RAM 1977/3995MB (lfb 210x4MB) cpu [22%,41%,66%,37%]@1734 EMC 26%@1600 AVP 2%@12 NVDEC 192 MSENC 192 GR3D 35%@153 EDP limit 1734
RAM 1976/3995MB (lfb 210x4MB) cpu [35%,87%,28%,55%]@1734 EMC 28%@1600 AVP 2%@12 NVDEC 192 MSENC 192 GR3D 39%@153 EDP limit 1734
RAM 1977/3995MB (lfb 210x4MB) cpu [47%,75%,40%,89%]@1734 EMC 32%@1600 AVP 2%@12 NVDEC 192 MSENC 192 GR3D 43%@153 EDP limit 1734
I see following warnings
(cv_hello:4814): GStreamer-CRITICAL **: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed
(cv_hello:4814): GStreamer-CRITICAL **: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed
(cv_hello:4814): GStreamer-CRITICAL **: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed
(cv_hello:4814): GStreamer-CRITICAL **: gst_structure_get_int: assertion 'structure != NULL' failed
(cv_hello:4814): GStreamer-CRITICAL **: gst_structure_get_int: assertion 'structure != NULL' failed
(cv_hello:4814): GStreamer-CRITICAL **: gst_structure_get_fraction: assertion 'structure != NULL' failed
I feel that I am having surplus memcpy operation in my opencv gstreamer pipe. Could someone please point out how to optimize that ?
On the other hand, when I preview video directly from gst-launch command line, my CPU and external memory controller freq doesnt get cranked to high value. I do not see any drop in fps either.
gst-launch-1.0 nvcamerasrc fpsRange="60.0 60.0" sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)60/1' ! nvtee ! nvvidconv flip-method=0 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e
RAM 1936/3995MB (lfb 228x4MB) cpu [44%,37%,18%,24%]@518 EMC 17%@665 AVP 26%@12 NVDEC 192 MSENC 192 GR3D 0%@76 EDP limit 1734
RAM 1936/3995MB (lfb 228x4MB) cpu [32%,42%,35%,31%]@403 EMC 20%@665 AVP 21%@12 NVDEC 192 MSENC 192 GR3D 0%@76 EDP limit 1734
RAM 1936/3995MB (lfb 228x4MB) cpu [32%,43%,35%,37%]@710 EMC 22%@665 AVP 16%@12 NVDEC 192 MSENC 192 GR3D 14%@76 EDP limit 1734
RAM 1937/3995MB (lfb 228x4MB) cpu [35%,34%,43%,36%]@307 EMC 22%@665 AVP 16%@12 NVDEC 192 MSENC 192 GR3D 0%@76 EDP limit 1734
Thanks,