Metadata-Version: 2.1
Name: webStreamViewer
Version: 1.0.0
Summary: opencv-style image display that displays the image/stream on a local webserver instead of a screen.
Home-page: https://github.com/TzurSoffer/webVideoViewer/tree/main
Author: Tzur Soffer
Author-email: tzur.soffer@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: license.txt
Requires-Dist: numpy
Requires-Dist: simplejpeg
Requires-Dist: flask

# README for Web Viewer

## Introduction
The WebVideoViewer is a Python application that allows you to create subpages with live video streams from a webcam or other source. It uses the Flask framework to handle web requests and displays video frames in real-time.

## Requirements
- Python 3.x
- OpenCV (cv2) library
- Flask library

## Installation
1. Clone the repository or download the code files.
2. Install the required dependencies by running the following command:
   ```
   pip install opencv-python flask
   ```

## Usage
1. Import the necessary modules:
   ```python
   import webViewer
   ```

2. Create an instance of the `VideoStream` class:
   ```python
   app = webViewer.VideoStream()
   ```

3. Start the Flask web server on a specified port (default is 80):
   ```python
   app.run()
   ```

4. Continuously capture frames from the webcam and update subpages:
   ```python
   cap = cv2.VideoCapture(0)
   
   while True:
       _, frame = cap.read()
       gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
       app.imshow("frame", frame)
       app.imshow("gray", gray)
   ```

5. Access the subpages:
   - The home page lists all the available subpages. Visit the root URL (e.g., `http://localhost:80/`) to see the home page.
   - Each subpage displays a live video stream. Add the subpage name to the root URL (e.g., `http://localhost:80/video1`) to access a specific subpage.

## Customization
You can customize the following aspects of the Flask Subpage App:

- **Templates**: The app uses HTML templates to render the home page and subpages. By default, it looks for the templates in the `templates` folder relative to the script's location. You can specify custom template paths when creating a `VideoStream` instance:
   ```python
   app = VideoStream(homePageTemplate="path/to/home.html", subpageTemplate="path/to/subpage.html")
   ```

- **Port**: The default port for the Flask web server is 80. If you want to use a different port, specify it when creating a `VideoStream` instance:
   ```python
   app = VideoStream(port=5000)
   ```


## License

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT). Feel free to modify and use it according to your needs.

## Acknowledgments

-

 This application was inspired by the Flask video streaming tutorial from the [Official Flask Documentation](https://flask.palletsprojects.com/)
- OpenCV - Open Source Computer Vision Library: [https://opencv.org/](https://opencv.org/)
- Flask - A micro web framework written in Python: [https://flask.palletsprojects.com/](https://flask.palletsprojects.com/)
