#!/bin/bash

if [ $# -ne 1 ]; then
    echo $0: usage: video.sh [0-5] to open /dev/videoX
    exit 1
fi
dev=$(echo /dev/video$1)

WIDTH=3840
HEIGHT=2160
FPS=30


/home/ubuntu/gst_1.9.1/out/bin/gst-inspect-1.0 --gst-plugin-path=. ./librxproc_plugin.0.1.arm64.so

/home/ubuntu/gst_1.9.1/out/bin/gst-launch-1.0 --gst-plugin-path=. v4l2src device=$dev io-mode=GST_V4L2_IO_USERPTR ! 'video/x-bayer,width='$WIDTH',height='$HEIGHT',framerate='$FPS'/1,format=rggb'  ! rxcudaupload  ! rxcudadebayer ! rxcudasink


