# avvideocompare

avvideocompare accepts two input video streams with the same width, height, framerate and format. The two incoming buffers are compared to each other via the chosen compare method (e.g. ssim or psnr).

If the stats-file property is specified, then the computed result for each frame comparison will be written to the file, or stdout if stats-file is '-'.

The first incoming buffer is passed through, unchanged, to the srcpad.

## Sample pipelines

    gst-launch-1.0 videotestsrc num-buffers=100          \
      ! video/x-raw,format=NV12                          \
      ! videobalance brightness=0.005 hue=0.005          \
      ! avvideocompare method=psnr stats-file=- name=cmp \
      ! fakesink videotestsrc ! video/x-raw,format=NV12  \
      ! cmp.

    gst-launch-1.0 videotestsrc num-buffers=100                  \
      ! tee name=orig ! queue ! avenc_mjpeg                      \
      ! jpegparse ! avdec_mjpeg                                  \
      ! avvideocompare method=ssim stats-file=stats.log name=cmp \
      ! fakesink orig. ! queue ! cmp.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──avvideocompare

## Factory details

Authors: – U. Artie Eoff <ullysses.a.eoff>

Classification: – `Filter/Compare/Video`

Rank – none

Plugin – libav

Package – GStreamer FFMPEG Plug-ins

</ullysses.a.eoff>

## Pad Templates

### `sink_1`

    video/x-raw:
             format: { ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB16, GRAY8, NV12, NV21, YUY2, UYVY, I420, Y42B, Y444, VUYA, P010_10LE, Y410, P012_LE, Y212_LE, Y412_LE }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `sink_2`

    video/x-raw:
             format: { ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB16, GRAY8, NV12, NV21, YUY2, UYVY, I420, Y42B, Y444, VUYA, P010_10LE, Y410, P012_LE, Y212_LE, Y412_LE }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/x-raw:
             format: { ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB16, GRAY8, NV12, NV21, YUY2, UYVY, I420, Y42B, Y444, VUYA, P010_10LE, Y410, P012_LE, Y212_LE, Y412_LE }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – src

Object type – GstPad

## Properties

### method

    “method” Ffmpeg-vid-cmp-method *

Method to compare video frames

Flags : Read / Write

Default value : ssim (0)

### stats-file

    “stats-file” gchararray

Set file where to store per-frame difference information, '-' for stdout

Flags : Read / Write

Default value : NULL

## Named constants

### Ffmpeg-vid-cmp-method

#### Members

`ssim` (0) – SSIM
`psnr` (1) – PSNR

Since : 1.24

The results of the search are