From f38845967a0b2b13ac3681f4b3290ae6f1e87fac Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 30 Mar 2018 18:12:42 +0200 Subject: [PATCH 1/1] Add ges-videocrop-effect.sh Add an example of how to apply a videocrop effect in a GES pipeline. --- shell/ges-videocrop-effect.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 shell/ges-videocrop-effect.sh diff --git a/shell/ges-videocrop-effect.sh b/shell/ges-videocrop-effect.sh new file mode 100755 index 0000000..177af86 --- /dev/null +++ b/shell/ges-videocrop-effect.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Example of how to apply a videocrop effect in a GES pipeline. +# +# Crop and Scale the circular pattern, and put into the white rectangle of the +# smtpe pattern. + +set -e + +CROP_TOP=40 +CROP_BOTTOM=80 +CROP_LEFT=100 +CROP_RIGHT=110 + +POSX=52 +POSY=180 + +WIDTH=320 +HEIGHT=240 + +SCALED_WIDTH=160 +SCALED_HEIGHT=120 + +H_RATIO=$((WIDTH / SCALED_WIDTH)) +V_RATIO=$((HEIGHT / SCALED_HEIGHT)) + +ges-launch-1.0 \ + +test-clip smpte s=0 d=2 \ + +test-clip circular s=0 d=2 set-alpha 0.9 \ + set-posx $POSX \ + set-posy $POSY \ + +effect videocrop set-top $CROP_TOP set-bottom $CROP_BOTTOM set-left $CROP_LEFT set-right $CROP_RIGHT \ + set-width $((SCALED_WIDTH - CROP_LEFT / H_RATIO - CROP_RIGHT / H_RATIO)) \ + set-height $((SCALED_HEIGHT - CROP_TOP / V_RATIO - CROP_BOTTOM / V_RATIO)) -- 2.1.4