Skip to main content

Webcams made easy

Project description

ecapture

Downloads Downloads Downloads

Image Capture Demo

First run the following command in a cmd window

pip install ecapture

Then, Create a new python script

Open the script

Import the module

from ecapture import ecapture as ec

Capture using webcam

(ec.capture(0,False,"img.jpg"))

The capture function takes three arguments:

Camera index(first connected webcam will be of index 0. The next webcam will be of index 1)

Window name (It can be a variable or a string. If you don't wish to see the window, type False)

ec.capture(0,False,"img.jpg")

Save name (It can be a variable or a string. If you don't wish to save the image, type False)

ec.capture(0,"test",False)

The full code

from ecapture import ecapture as ec

ec.capture(0,"test","img.jpg")

Delayed Image Capture Demo

Create a new python script

Open the script

Import the module

from ecapture import ecapture as ec

Capture the image using webcam

ec.delay_imcapture(0,"Image","Demo.jpg",2)

The delay_imcapture function takes four arguments:

Camera index(first connected webcam will be of index 0. The next webcam will be of index 1)

Window name (It can be a variable or a string)

ec.delay_imcapture(0,"Video","Demo.jpg",2)

Save name (It can be a variable or a string. If you don't wish to save the image, type False)

ec.delay_imcapture(0,"Video",False,2)

The delay(The time till capturing the image)

ec.delay_imcapture(0,"Video","Demo.jpg",2)

The full code

from ecapture import ecapture as ec

ec.delay_imcapture(0,"Video","Demo.jpg",2)

Video Capture Demo

Create a new python script

Open the script

Import the module

from ecapture import ecapture as ec

Capture the video using webcam

ec.vidcapture(0,"Video","Demo.avi","q")

The vidcapture function takes four arguments:

Camera index(first connected webcam will be of index 0. The next webcam will be of index 1)

Window name (It can be a variable or a string)

ec.vidcapture(0,"Video","Demo.avi","q")

Save name (It can be a variable or a string. If you don't wish to save the video, type False)

ec.vidcapture(0,"Video",False,"q")

Exit key (The key you press to stop recording the video. It can be ("q", "x", "a" or any other letter))

ec.vidcapture(0,"Video","Demo.avi","x")

The full code

from ecapture import ecapture as ec

ec.vidcapture(0,"Video","Demo.avi","q")

Auto Video Capture Demo

Create a new python script

Open the script

Import the module

from ecapture import ecapture as ec

Capture the video using webcam

ec.auto_vidcapture(0,"Video","Demo.avi",5)

The auto_vidcapture function takes four arguments:

Camera index(first connected webcam will be of index 0. The next webcam will be of index 1)

Window name (It can be a variable or a string)

ec.auto_vidcapture(0,"Vid","Demo.avi",5)

Save name (It can be a variable or a string. If you don't wish to save the video, type False)

ec.auto_vidcapture(0,"Video",False,5)

Exit time (The time until stopping recording of the video. It can be (5, 10, 15, 20 or any number of seconds in between)

ec.auto_vidcapture(0,"Video","Demo.avi",10)

The full code

from ecapture import ecapture as ec

ec.auto_vidcapture(0,"Video","Demo.avi",5)

Motion Detection

Create a new python script

Open the script

Import the module

from ecapture import motion as md

Check for movement using webcam

md.motion_detect(0,"x",0.85,"Detection")

The motion_detect function takes four arguments:

Camera index(first connected webcam will be of index 0. The next webcam will be of index 1)

Key to stop checking for motion. It can be ("q", "x", "a" or any other letter)

Window name (It can be a variable or a string. If you don't wish to see the window, type False)

Threshold(any value from 0-1)If threshold is set to high value(0.6-1), even the slightest movement will be detected. And if threshold is set to a low value(0-0.59), only more rapid monement will be detected

The full code

from ecapture import motion as md

md.motion_detect(0,"x",0.85,"Detection")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ecapture-0.1.8-py3-none-any.whl (6.8 kB) Copy SHA256 hash SHA256 Wheel py3
ecapture-0.1.8.tar.gz (3.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page