#!/bin/bash DELAY=$1 COUNTER=0 while true ; do COUNTER=$(($COUNTER+1)) gst-launch v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=img-$COUNTER.png sleep $DELAY done