A real-time wireless camera streaming platform built with Next.js, Socket.io, and WebRTC. Stream camera feeds from any device wirelessly to a central admin dashboard with full control and OBS integration.
- Stream from unlimited devices simultaneously
- Real-time video and audio transmission
- Automatic quality adaptation based on network conditions
- Support for mobile phones, tablets, laptops, and webcams
- Central control panel for all connected cameras
- Real-time stream statistics (FPS, bitrate, packet loss)
- Individual camera controls and settings
- Participant management with kick functionality
- Transform Options: Horizontal/vertical flip, 90ยฐ rotation
- Audio Selection: Choose which camera's audio to monitor
- Fullscreen Mode: Individual camera fullscreen viewing
- Stream Settings: Adjustable resolution, FPS, and bitrate
- Individual Camera Views: Separate URLs for each camera
- Browser Source Compatible: Direct integration with OBS Studio
- Transform Support: Flip and rotation settings preserved
- Clean Interface: Minimal UI for professional streaming
- WebRTC P2P: Low-latency peer-to-peer connections
- Automatic Reconnection: Handles network interruptions gracefully
- STUN/TURN Support: Works behind NAT and firewalls
- Responsive Design: Works on desktop and mobile devices
- Node.js 18+
- npm or yarn
- Modern web browser with WebRTC support
-
Clone the repository
git clone https://github.com/tomkoooo/tstream.git cd tstream -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:8080 - Create a room as admin
- Share the join link with camera devices
- Navigate to
- Go to the main page
- Click "Create Room"
- Set room name and password
- Share the generated link with participants
- Open the shared link on your device
- Enter the room password
- Allow camera and microphone access
- Configure stream settings (resolution, FPS, bitrate)
- Click "Start Streaming"
Main Dashboard:
- View all connected cameras in a grid layout
- Monitor real-time statistics for each stream
- Select which camera's audio to listen to
- Control individual camera settings
Per-Camera Actions:
- Fullscreen: Open camera in fullscreen mode
- OBS View: Generate individual URL for OBS Studio
- Transform: Flip horizontally/vertically, rotate 90ยฐ
- Audio Select: Choose as primary audio source
- Reconnect: Restart connection if issues occur
- Kick: Remove participant from room
- In admin dashboard, click โฎ โ "Individual View (OBS)"
- Copy the generated URL
- In OBS Studio:
- Add Browser Source
- Paste the URL
- Set resolution (e.g., 1920x1080)
- The camera feed will appear with applied transforms
Create a .env.local file in the root directory:
# Base URL for the application
NEXT_PUBLIC_BASE_URL=http://localhost:8080
# WebRTC Configuration
NEXT_PUBLIC_STUN_SERVERS=stun:stun.l.google.com:19302,stun:stun1.l.google.com:19302
# Optional: Custom TURN servers for better NAT traversal
NEXT_PUBLIC_TURN_SERVER_URL=turn:your-turn-server.com:3478
NEXT_PUBLIC_TURN_USERNAME=username
NEXT_PUBLIC_TURN_CREDENTIAL=passwordRecommended Settings by Use Case:
| Use Case | Resolution | FPS | Bitrate |
|---|---|---|---|
| Mobile/Preview | 480p | 15 | 500 kbps |
| Standard Quality | 720p | 30 | 2000 kbps |
| High Quality | 1080p | 30 | 4000 kbps |
| Ultra Quality | 1080p | 60 | 6000 kbps |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Client Device โ โ Next.js App โ โ Admin Dashboardโ
โ (Camera) โโโโโบโ + Socket.io โโโโโบโ (Control) โ
โ โ โ Server โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
WebRTC P2P Connection
- Frontend: Next.js 15.3.3, React 19, TypeScript
- Styling: Tailwind CSS 4, DaisyUI 5
- Real-time: Socket.io 4.8.1
- WebRTC: Native browser APIs
- Backend: Node.js with Socket.io server
tstream/
โโโ src/
โ โโโ app/
โ โ โโโ admin/[roomId]/ # Admin dashboard
โ โ โโโ join/[roomId]/ # Client streaming page
โ โ โโโ camera/[participantId]/ # Individual camera view
โ โ โโโ api/socket/ # Socket.io API endpoint
โ โโโ components/ # Reusable React components
โโโ server.js # Socket.io server
โโโ public/ # Static assets
โโโ package.json
# Development server
npm run dev
# Production build
npm run build
# Start production server
npm start
# Lint code
npm run lint- Room Creation: Admin creates room with Socket.io
- Client Join: Camera devices join room with password
- Stream Start: Client starts camera stream
- Admin Connection: Admin initiates WebRTC offer to streaming client
- P2P Established: Direct video/audio transmission begins
- Statistics: Real-time monitoring of connection quality
No Video Stream:
- Check camera permissions in browser
- Verify network connectivity
- Try reconnecting from admin panel
Connection Failed:
- Ensure STUN/TURN servers are accessible
- Check firewall settings
- Verify room password is correct
Poor Quality:
- Reduce resolution/bitrate in stream settings
- Check network bandwidth
- Try different STUN/TURN servers
Audio Issues:
- Verify microphone permissions
- Check audio source selection in admin panel
- Ensure browser supports audio streaming
Enable debug logging by opening browser console. The app provides detailed logs for:
- Socket.io connections
- WebRTC signaling
- Stream statistics
- Error conditions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for type safety
- Follow existing code style
- Add proper error handling
- Include debug logging for new features
- Test on multiple devices/browsers
This project is licensed under the MIT License - see the LICENSE file for details.
- WebRTC for real-time communication
- Socket.io for reliable signaling
- Next.js for the application framework
- DaisyUI for beautiful UI components
- Tailwind CSS for styling utilities
- ๐ Bug Reports: Open an issue
- ๐ก Feature Requests: Start a discussion
- ๐ง Contact: toth.tamas@sironic.hu
Made with โค๏ธ for seamless wireless streaming