videocompare

Compare multiple video pad buffers, with the first added pad being the reference. All video streams must use the same geometry. A message is posted to the application when the measurement of distance between frames falls under the desired threshold.

The application can decide what to do next with the comparison result. This element can be used to detect badges or slates in the video stream.

The src pad passthrough buffers from the reference sink pad.

Example pipeline

gst-launch-1.0 videotestsrc pattern=red ! videocompare name=compare ! videoconvert \
  ! autovideosink  videotestsrc pattern=red ! imagefreeze ! compare. -m

The message posted to the application contains a structure that looks like:

videocompare,
  pad-distances=(structure)< "pad-distance\,\ pad\=\(GstPad\)\"\\\(GstVideoAggregatorPad\\\)\\\ sink_1\"\,\ distance\=\(double\)0\;" >,
  running-time=(guint64)0;

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstAggregator
                    ╰──GstVideoAggregator
                        ╰──videocompare

Factory details

Authors: – Rafael Caricio

Classification:Filter/Video

Rank – none

Plugin – rsvideofx

Package – gst-plugin-videofx

Pad Templates

sink_%u

video/x-raw:
         format: { RGB, RGBA }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

Presencerequest

Directionsink

Object typeGstVideoAggregatorPad


src

video/x-raw:
         format: { RGB, RGBA }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

Presencealways

Directionsrc

Object typeGstVideoAggregatorPad


Properties

hash-algo

“hash-algo” Video-compare-hash-algorithm *

Which hashing algorithm to use for image comparisons

Flags : Read / Write

Default value : blockhash (4)


max-dist-threshold

“max-dist-threshold” gdouble

Maximum distance threshold to emit messages when an image is detected, by default emits only on exact match

Flags : Read / Write

Default value : 0


Named constants

Video-compare-hash-algorithm

Members

mean (0) – Mean: The Mean hashing algorithm.
gradient (1) – Gradient: The Gradient hashing algorithm.
vertgradient (2) – VertGradient: The Vertical-Gradient hashing algorithm.
doublegradient (3) – DoubleGradient: The Double-Gradient hashing algorithm.
blockhash (4) – Blockhash: The Blockhash (block median value perceptual hash) algorithm.

The results of the search are