This Python project implements an IP Camera Player using PyQt5 and OpenCV. It allows users to view real-time video streams from IP cameras via RTSP, providing features such as zoom, pan, fullscreen toggle, and snapshot capture with timestamp. The app uses a threaded approach to manage video streaming, ensuring smooth UI performance. User settings, including camera configuration, are persisted across sessions. A loading animation is displayed during stream initialization. The application also includes basic error handling and status updates, ensuring the user is informed of any issues or stream progress during runtime
- Features
- Requirements
- Installation
- Usage
- Key Components
- Configuration
- Error Handling
- License
- Acknowledgments
- Version History
- Known Issues
- Support
- Development Notes
- Download the Executable
- Real-time Video Streaming: Connect to and stream from RTSP-enabled IP cameras
- Camera Settings Management:
- Easy configuration of camera connection parameters
- Persistent storage of camera settings
- Support for different video resolutions (1080p, 720p, 480p)
- Video Controls:
- Start/Stop streaming
- Pause/Resume stream
- Take snapshots with timestamp
- Advanced Viewing Features:
- Zoom in/out using mouse wheel
- Pan the zoomed image by clicking and dragging
- Double-click for fullscreen mode
- User Interface:
- Clean and intuitive interface
- Status bar with connection details
- Loading animation during stream initialization
- Python 3.6+
- PyQt5
- OpenCV (cv2)
- NumPy
- Clone the repository:
git clone https://github.com/yourusername/ip-camera-player.git
cd ip-camera-player- Install the required packages:
pip install -r requirements.txt- Run the application:
python ip_camera_player.py-
Configure your camera:
- Click the "Settings" button
- Enter your camera's details:
- Protocol (e.g., rtsp)
- Username
- Password
- IP Address
- Port (default: 554 for RTSP)
- Stream Path
- Video Resolution
-
Control the stream:
- Click "Start" to begin streaming
- Use "Pause" to freeze the stream
- Click "Stop" to end the stream
- Use "Snapshot" to capture the current frame
-
Navigate the video:
- Use the mouse wheel to zoom in/out
- Click and drag to pan when zoomed in
- Double-click for fullscreen mode
- Manages the main application window and UI components
- Handles video stream display and user interactions
- Manages camera settings and configuration persistence
- Provides a dialog for configuring camera connection parameters
- Validates and saves camera settings
- Allows direct stream initiation from settings dialog
- Handles video stream capture in a separate thread
- Manages stream state (running, paused, stopped)
- Emits signals for frame updates and error conditions
- Provides visual feedback during stream initialization
- Uses GIF animation for loading indicator
The application automatically saves the following settings:
- Protocol
- Username
- Password
- IP Address
- Port
- Stream Path
- Video Resolution
Settings are persisted between sessions using QSettings.
The application includes comprehensive error handling for:
- Connection failures
- Stream initialization timeouts
- Invalid camera settings
- Frame capture errors
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PyQt5 for the GUI framework
- OpenCV for video capture capabilities
- Contributors and testers who helped improve this application
- 1.0.0 (Current)
- Initial release
- Basic streaming functionality
- Camera settings management
- Zoom and pan capabilities
- Snapshot feature with timestamp
- Stream initialization may take longer on some networks
- Some IP cameras might require specific stream paths
- Zoom performance may vary based on system capabilities
For support, please open an issue in the GitHub repository or contact the maintainers.
For developers looking to modify or extend the application:
StreamThreadcaptures frames and emits signals- Main window receives and processes frames
- UI updates occur in the main thread
- Error handling through dedicated signal channels
- Follow the existing error-handling patterns
- Use separate threads for long-running operations
- Maintain the MVC-like structure
- Add appropriate documentation
- Follow PEP 8 guidelines
- Use type hints for function parameters
- Document complex logic with inline comments
- Maintain consistent error-handling patterns
To make it easier for users to run the project without needing to set up a development environment, we've provided an executable version of the IP Camera Player.
You can download the executable from the following link:
https://drive.google.com/file/d/1n3SFtSbMknIix4lOmja2aC4tnA3yDfKu/view?usp=sharing
