A Next.js application for controlling PTZ (Pan, Tilt, Zoom) cameras through NATS messaging.
- Camera selection (1-6)
- Pan control (-55° to 55°)
- Tilt control (-20° to 20°)
- Zoom control (0 to 16000)
- Real-time validation
- NATS message publishing
- Node.js 18 or higher
- NATS Server
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd ptz-control- Install dependencies:
npm install- Install shadcn/ui components:
npx shadcn-ui@latest init
npx shadcn-ui@latest add button select input label card toast- Create
.env.localin root directory:
NATS_URL=nats://localhost:4222 # Replace with your NATS server URL- Start NATS server:
nats-server- Run development server:
npm run devAccess at http://localhost:3000
├── app/
│ ├── api/
│ │ └── nats/
│ │ └── route.ts # NATS API endpoint
│ └── page.tsx # Main PTZ control interface
├── components/
│ └── ui/ # shadcn/ui components
├── .env.local # Environment variables
└── package.json
- Select a camera from the dropdown
- Enter Pan, Tilt, and Zoom values within specified ranges
- Click "Move Camera" to send command
- Watch for feedback toast notifications
- Next.js 14
- React 18
- shadcn/ui
- NATS.js
- TypeScript
- Tailwind CSS