This project is a simple camera application built using OpenCV,PyAudio,FFMPEG and Tkinter that can click images, record videos with audio and save them. The application looks like:
Few Points to note here are:
- The button "Click" clicks a picture and saves it in the current working folder as "Image_1.jpg".
- The button "Record" starts recording the audio and video until you press it again that stops the recoring. The video is saved as "Video0.mp4".
- Use "Exit" button to exit the application. Note: Using the Close application button on top right corner will not release the web-cam.
- You must not have any file named "Image_1.jpg" or "Video0.mp4" in order to save the images or recordings correctly.
You can install python(3.8.5) directly here or go to the page https://www.python.org/downloads/ and click "Download Python 3.8.5". Don't forget to check the box "Add To Path", once you launch the installation wizard.
To check if python is installed correctly and is added to your path, go to the command prompt/powershell/terminal on your system and type 'python'.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Fire command
pip list
on your cmd/powershell/terminal to check if pip is installed correctly on your system.
pip install opencv-python
Fire command
pip list
on your cmd/powershell/terminal and look for 'opencv-python' to check if opencv is installed correctly on your system.
pip install pyaudio
on your system cmd/powershell/terminal. To confirm pyaudio download, head to the terminal and type pip list
. Look for pyaudio module in the output.
- Head on over thhe link below http://ffmpeg.zeranoe.com/builds/
- Choose the file you want to download based on your system requirements (static version is recommended).
- After downloading, unzip the file on your local system
- Lastly, in order to use this utility anywhere, you will need to add FFMPEG to the path. For this, head over to the directory where you have extracted the file. Go to bin folder and copy the path. Now, search for "Edit the system environment variables" in Windows search bar, click on "Environment Variables", look for the option "Path"in System Variables section,click on it, click "New" and paste the path to "bin" folder.
ffmpeg
.
To run the application:
- Open cmd/powershell/terminal on your system and head over to the directory where you have cloned this repository.
- Type
python camera.py
You should see the application window opening.