GStreamer Motion Detection Bin Performance

From RidgeRun Developer Wiki



Previous: Performance Index Next: Troubleshooting






This section provides performance measurements for the rrmotiondetectionbin operating in various configurations. The following list describes different aspects of performance that were measured during the evaluation:

  • Frame rate: This indicates the number of frames that can be processed per second.
  • CPU utilization: This refers to the average percentage of CPU resources used by the pipeline.
  • GPU utilization: This refers to the average percentage of GPU resources used by the pipeline.

To measure these aspects RidgeRun's perf element and NVIDIA application tegrastats were used. The measurements were taken using Jetpack 4.5 on a Jetson Xavier NX and configured in power mode ID 5.The results of these measurements can be found in the following subsections.

Algorithms Configurations

The table below show the results of testing different motion detection algorithms, blob detection method and changing the processing format.

  • The motion detection algorithm was changed with the property motion_detector::motion and can take 2 values 'mog' or 'mog2'
  • The blob detection method was changed with the property cuda-blob-detection and can take 2 values true or false, true to use GPU based blob detection or false to use CPU based blob detection.
  • The processing format was changed with the property grayscale and can take 2 values: true or false, true to process the video in grayscale of false to process the value in RGBA.

The rest of the configurations uses the default values, noise reduction kernel size of 9 and sample frequency of 1.

4K Input Resolution

The measurements in this subsection were obtained from the following pipeline using a 4K input file:

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! queue ! rrmotiondetectionbin motion_detector::motion=$MOTION  cuda-blob-detection$BLOB_METHOD grayscale=$PROCESS_FORMAT ! perf ! fakesink sync=true

The rrmotiondetectionbin configuration were changed to determine its performance with different settings, changed with the corresponding element's properties.

Motion Detection Algorithm Blob Detection Method Processing Format Framerate CPU GPU
mog mog2 CPU GPU Grayscale RGBA
x x x 29.91 16.769 88.397
x x x 22.098 13.617 79.529
x x x 29.921 15.963 75.115
x x x 23.509 13.938 83.529
x x x 23.097 12 90.971

1080p Input Resolution

The measurements in this subsection were obtained from the following pipeline using a 4K input file downscaled to 1080p

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder !  nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080" !  queue ! rrmotiondetectionbin motion_detector::motion=$MOTION  cuda-blob-detection$BLOB_METHOD grayscale=$PROCESS_FORMAT ! perf print-cpu-load=true ! fakesink sync=true

The rrmotiondetectionbin configuration were changed to determine its performance with different settings, changed with the corresponding element's properties.

Motion Detection Algorithm Blob Detection Method Processing Format Framerate CPU GPU
mog mog2 CPU GPU Grayscale RGBA
x x x 29.927 10.423 48.391
x x x 29.921 8.74 51.807
x x x 29.925 10 29.615
x x x 29.921 10.423 40.629
x x x 29.928 10 51.08

Denoiser Kernel Size

To further analyze the impact of the denoiser we measured the performance for different kernel sizes, keeping the rest of configurations fixated as follows:

  • Motion detection algorithm: MOG
  • Blob detection: CPU
  • Sample Frequency: 1
  • Processing format: grayscale


4K Input Resolution

The following pipeline was used for these measurements:

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! queue ! rrmotiondetectionbin motion_detector::motion=mog motion_denoiser::size=$KERNEL_SIZE cuda-blob-detection=false ! perf print-cpu-load=true  ! fakesink sync=true


Denoiser Kernel Size Framerate CPU GPU
5 29.906 18.076 86.577
9 29.91 16.769 88.397
11 29.924 16.153 84.462

1080p Input Resolution

The following pipeline was used for these measurements:

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080" ! queue ! rrmotiondetectionbin cuda-blob-detection=false motion_detector::motion=mog motion_denoiser::size=$KERNEL_SIZE !  perf print-cpu-load=true ! fakesink sync=true
Denoiser Kernel Size Framerate CPU GPU
5 29.927 9.777 40.16
9 29.927 10.423 48.391
11 29.925 10 37.923

Motion Sampling Frequency

This subsections shows the performance changes caused by different sampling frequencies, keeping the rest of configurations fixated as follows:

  • Motion detection algorithm: MOG
  • Blob detection: CPU
  • Denoise kernel size: 9
  • Processing format: grayscale

4K Input Resolution

The following pipeline was used for these measurements:

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! queue ! rrmotiondetectionbin motion_detector::motion=mog motion_detector::sample-frequency=$FREQ motion_denoiser::size=9 cuda-blob-detection=false ! perf print-cpu-load=true  ! fakesink sync=true
Sample Frequency Framerate CPU GPU
1 29.91 16.769 88.397
2 30.232 11.44 56.292
4 30.448 8.72 40.739

1080p Input Resolution

The following pipeline was used for these measurements:

gst-launch-1.0 filesrc location=/home/nvidia/street.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! "video/x-raw(memory:NVMM),width=1920,height=1080" ! queue ! rrmotiondetectionbin cuda-blob-detection=false motion_detector::motion=mog motion_denoiser::size=9  motion_detector::sample-frequency=$FREQ !  perf print-cpu-load=true ! fakesink sync=true
Sample Frequency Framerate CPU GPU
1 29.927 10.423 48.391
2 30.561 8.038 41.9
4 30.572 7.038 22.778


Previous: Performance Index Next: Troubleshooting