#!/bin/sh


for i in `seq 0 7`
do
  gst-launch videotestsrc pattern=ball num-buffers=10 ! \
    video/x-raw-yuv,format=\(fourcc\)UYVY ! \
    tee ! queue max-size-buffers=3 ! colorspace ! .original ssim ! \
    colorspace ! fakesink -v \
    tee0. ! queue max-size-buffers=3 ! interlace field-pattern=1:1 ! \
    deinterlace method=$i fields=all ! \
    colorspace ! \
    ssim0.modified0 | grep application/x-videomeasure | \
    sed 's/.*mean=.float.\([0-9.]*\),.*/'$i' \1/'

  echo
done

exit 0

method=greedyl

gst-launch -v videotestsrc pattern=ball num-buffers=100 ! \
  video/x-raw-yuv,format=\(fourcc\)I420 ! \
  tee ! queue max-size-buffers=3 ! .original ssim ! \
  ffmpegcolorspace ! pngenc snapshot=false ! multifilesink location=%05d.png \
  tee0. ! queue max-size-buffers=3 ! interlace field-pattern=1:1 ! \
  deinterlace method=$method fields=all ! \
  ssim0.modified0

exit 0

