#!/bin/bash

camera()
{
  export GST_DEBUG_NO_COLOR="1"
  export GST_DEBUG="0"
  exec gst-launch-1.0 rtspsrc "latency=1000" "location=rtsp://192.168.0.90/axis-media/media.amp?videocodec=h264&h264profile=main&resolution=${1}&fps=${2}" ! "application/x-rtp,media=video,encoding-name=H264" ! rtph264depay ! h264parse ! queue ! ducatih264dec ! queue ! waylandsink & 
}

ITER="0"
while [ "${ITER}" -lt "9" ]
do
  ITER=$(( $ITER + 1))
  camera 640x480 25 
  sleep 4
done
