Giter VIP home page Giter VIP logo

madcam's Introduction

MadCam

MadCam is a web-based security camera application that streams video from a webcam connected to your laptop or desktop. The application is built using Flask for the backend and React for the frontend. It displays the video feed in real-time, along with the current date and time in the Persian calendar.

Prerequisites

Before you start, ensure you have the following installed:

Installation

1. Clone the Repository

git clone https://github.com/yourusername/MadCam.git
cd MadCam

2. Install Python Dependencies

pip install flask opencv-python flask-cors

3. Build the React Frontend

Navigate to the root of the project where package.json is located and run:

npm install
npm run build

This will create a production-ready build of the React frontend, placing the output in the build/ directory inside the public/ folder.

Running the Application

1. Configure Your Webcam

In the webcam.py file, you'll find the following lines:

camera_name = "Microsoft® LifeCam HD-3000"
camera_index_or_path = find_camera_by_name(camera_name)

If you're using a different webcam, you'll need to replace "Microsoft® LifeCam HD-3000" with the name of your webcam. To find the correct name, you can check your system’s device manager or webcam software.

2. Start the Flask Backend

In the root directory (where webcam.py is located), run:

python webcam.py

This will start the Flask server on http://localhost:8080 by default, serving both the backend and the frontend.

3. Accessing the App Locally

Open your web browser and go to:

http://localhost:8080

4. Accessing the App Remotely

To access your webcam stream remotely:

  1. Port Forwarding: Set up port forwarding on your router to forward external requests on port 8080 to your local machine’s IP address (192.168.1.x:8080).

  2. Public IP Access: Access the app using your public IP address and the forwarded port. Example:

    http://<your-public-ip>:8080
    

Troubleshooting

Common Issues

  • Blank Screen: Ensure the Flask server is running and the camera is configured correctly.
  • Camera Not Detected: Verify that your webcam is connected and working correctly. Update the camera_name in webcam.py if necessary.
  • Port Forwarding Not Working: Check your router’s settings and firewall rules.

Logs

  • Flask Logs: Check the terminal where webcam.py is running for any errors.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.


madcam's People

Contributors

itsmadson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.