SlideShare a Scribd company logo
1 of 4
Download to read offline
P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to
Automatically Record and Save Video Captured when the Webcam is connected
IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 200
Webcam Driver to Automatically Record and Save Video
Captured when the Webcam is connected
Pema Chodon1, 2
, Devi Maya Adhikari1, 3
, Gopal Chandra Nepal1, 4
, Rajen Biswa1, 5
, Sangay Gyeltshen1,6
,
Chencho1,7
1
Department of Electronics and Communication, College of Science and Technology, Royal University of
Bhutan, Phuentsholing, Bhutan
ABSTRACT
This paper presents software developed to be used with
a webcam. It was developed using Microsoft Visual
C++ 2010 and OpenCV 2.4.4 library files. It can be
used to record and save video automatically when the
webcam is connected to the computer. The program is
installed and made to run. It will keep checking if the
webcam is connected or not. When the webcam is
connected to the computer, the system detects it and
starts to record video captured by webcam. Once the
webcam is disconnected from the computer, the
program saves the previous recorded video and again, it
will check for webcam connection. The developed
software program can be used to automatically record
and save video captured when the webcam is connected
to the computer.
Keywords— Webcam, Algorithm, Visual C++,
OpenCV
1. INTRODUCTION TO MICROSOFT
VISUAL C++ AND OPENCV
The software program has been developed using
Microsoft Visual C++ 2010 integrating with OpenCV
2.4.4 library files. OpenCV library files allows generic
image/video loading, saving, and acquisition [1]. C++ is
regarded as a middle-level language, as it comprises a
combination of both high-level and low-level language
features. Thus OpenCV library files have been
integrated in Microsoft Visual C++ 2010 for capturing,
recording and video acquisition.
Microsoft Visual Studio is an integrated development
environment (IDE) from Microsoft. It is used to
develop console and graphical applications along with
Windows Form applications, web sites, web
applications, and web services for all platforms
supported by Microsoft Windows, Windows
Mobile, .NET Framework and .NET Compact
Framework [2]. Visual Studio supports
different programming languages by means of language
services, which allow the code editor and debugger to
support (to varying degrees) nearly any programming
language, provided a language-specific service exists.
From these supported languages we use Microsoft
Visual C++ 2010 express edition for writing our
program [3].
OpenCV (Free Open Source Computer Vision) is a
library of programming functions mainly aimed at real
time computer vision. It has a BSD license (free for
commercial or research use). OpenCV was originally
written in C but now has a full C++ interface and all
new development is in C++. There is also a full Python
interface to the library [4].
The OpenCV was selected due to following features:
 Open source computer vision library in
C/C++.
 Optimized and intended for real-time
applications.
 OS/hardware/window-manager independent.
 Generic image/video loading, saving, and
acquisition.
 Both low and high level API.
 Easy integration of its library files with MS
visual C++
As to let the software developed to run successfully,
integration of Microsoft Visual C++ with the OpenCV
library files was done. The library files included are [5]:
 opencv_core244.lib: This is the basic building
block of the library for understanding how to
manipulate the images on a pixel level.
International journal of Computing
Journal homepage: www.ifrsa.org
P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to
Automatically Record and Save Video Captured when the Webcam is connected
IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 201
 opencv_imgproc244.lib: This is for the image
processing (manipulation) functions inside
OpenCV
 opencv_highgui244.lib: How to read/save your
image/video files and how to use the built-in
graphical user interface of the library.
 opencv_ml244.lib: Use the powerful machine
learning classes for statistical classification,
regression and clustering of data.
 opencv_video244.lib: Use on your video
stream algorithms like: motion extraction,
feature tracking and foreground extractions.
 opencv_features2d244.lib: This is to use the
feature point detectors, descriptors and
matching framework found inside OpenCV.
 opencv_calib3d244.lib: Although most of our
images are in a 2D format they do come from
a 3D world. This is use to find out from the 2D
images information about the 3D world.
 opencv_objdetect244.lib: Detects peoples and
faces
 opencv_contrib244.lib: How to process images
and video streams with a model of retina filter
for details enhancement, spatio-temporal noise
removal, luminance correction and spatio-
temporal events detection.
 opencv_flann244.lib: It is used in Clustering
and Search in Multi-Dimensional Spaces. This
section documents OpenCV’s interface to the
FLANN library. FLANN (Fast Library for
Approximate Nearest Neighbours) is a library
that contains a collection of
algorithms optimized for fast nearest neighbour
search in large datasets and for high
dimensional features.
2. WORKING OF PROGRAM
The objective of this software is to automatically save
the video captured by the webcam when it is connected
to the computer. The system need not have to open the
webcam application and click on the button to record.
The program is made run in the system. As soon as
webcam is connected, it will automatically detect the
webcam and recording will take place.
A. Algorithm
The proposed program should follow the following steps
of algorithm:
1. Start the program: Gets date and current local
time in the format date_month_year hr_min.
2. Check whether the webcam is connected or not.
If the webcam is connected, start saving the
video until the webcam is disconnected. It uses
the following functions to record and save the
video captured by webcam:
i. cvCapture
ii. cvCreateCameraCapture
iii. cvQueryFrame(capture),
iv. cvGetCaptureProperty,
v. cvNamedWindow,
vi. CvVideoWriter,
vii. cvWriteFrame
viii. cvWaitKey
ix. cvReleaseVideoWriter
x. cvReleaseCapture
3. Save the video
4. Continue to check if the webcam is connected
and step 2 and 3 are repeated.
Int main( int argc, char** argv )
{
startcam:
time_t now = time(0);
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
strftime(buf,sizeof(buf)," %d_ %m_ %Y
%H_ %M", &tstruct);
string GetTime=buf;
string TimeinString=
GetTime.append(".avi");
char* p = new
char[TimeinString.length() + 1];
strcpy(p,
TimeinString.c_str());
cout<<"n Finishd Saving Video n";
cvDestroyWindow("Webcam");
goto startcam;
P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to
Automatically Record and Save Video Captured when the Webcam is connected
IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 202
B. Flow Chart
Start
Check if webcam is
connected
Start Recording the video
Save the Recorded the video
YES
NO
Figure 1: Flow Chart
C. Video streaming and saving
The program automatically captures and records the live
video when the webcam is connected to the computer.
The captured video is saved in the computer.
For the naming purpose of the saved video file a
function to call the computer’s system time with year,
month, date, hour and minute is used. The complete
name looks like “31_05_2013 15_16.avi”. This file
name is converted from string to character type and
passed to the video writer function of OpenCV library
file. As no path is given, the recorded video file is saved
in same directory as the program file.
3. TESTING THE PROGRAM
For testing the working of the program it was first
converted to the executable file so that it can be used
from any computer system independent of the MS
Visual C++ and OpenCV software.
Figure 2: When webcam is not connected
The program was kept running. When the program was
started, it immediately checks if the webcam is
connected to the system or not. The program will keep
on looping until it finds the webcam is being connected
to the system as shown in Figure 2.
When the webcam was connected to the system, the
program detects the webcam connection. The recording
of captured video by the webcam takes place shown in
Figure 3 [6].
Figure 3: When the webcam is connected and
recording
When the webcam is removed from the computer, the
software will finish saving video and the program again
proceed to check the status of webcam as shown in
Figure 4.
P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to
Automatically Record and Save Video Captured when the Webcam is connected
IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 203
Figure 4: After recording and webcam is removed
So every time when the webcam is connected to the
computer, the recording and saving takes place
automatically.
4. ANALYSIS
When the webcam is connected to the system, there was
time delay for the program to detect that the webcam
and to start recording the video. This is because the
program needs to check the computer’s hardware for the
availability of the webcam and if it is connected to the
system; the computer in turn has to load the drivers
when the webcam gets connected. The delay is
approximately 15 seconds.
5. FUTURE WORKS
There was certain delay in recording the video captured
by webcam. Also the executable software is not very
user friendly as the screen appears quite plain and user
may not prefer it. Considering above points, following
two future works are set to improve the performance of
the software:
 Work on software to reduce the delay time in
recording the video captured by webcam.
 Make the software more users friendly using
Graphical User Interface (GUI).
6. CONCLUSION
In this paper we have proposed a software program used
to record the video captured by a webcam automatically
when it is connected to a computer. The software
developed was tested and found to be working with
some time delay to start recording. Software will be
more efficient if this delay time could be minimized.
This software was actually developed for a PIR sensor
based security system where the webcam gets actuated
when PIR sensor detects an object in its detection range.
When the webcam is actuated, the software detects the
webcam is ON and starts to record video captured by the
webcam.
REFERENCES
[1] Anonymus, “OpenCV documentation,”
[Online] http://docs.opencv.org/index.html,
April 2013.
[2] Anonymous, “Tutorials Point,” [Online].
http://www.tutorialspoint.com/cplusplus/cpp_o
verview.htm
[3] Anonymous, “Mathematics and Computer
Science,” South Dakota School of Mines and
Technology. [Online].
http://www.mcs.sdsmt.edu/csc150/Handouts/V
isual%20C++%202010%20Tutorial.pdf, Jan.
2012
[4] Gady Agam, “Department of Computer
Science,” [Online].
http://www.cs.iit.edu/~agam/cs512/lect-
notes/opencv-intro/, Jan. 2007.
[5] Anonymous, “highgui. High-level GUI and
Media I/O,” [Online].
http://docs.opencv.org/modules/highgui/doc/hi
ghgui.html, April, 2013.
[6] P. Chodon, D. M. Adhikari, G. C. Nepal, R.
Biswa, S. Gyeltshen and Chencho, "Passive
Infrared (PIR) Sensor Based Security System,"
(IJEECS) International Journal of Electrical,
Electronics ad Computer Systems, vol. 14, no.
2, 2013.

More Related Content

Similar to Automatically Record Webcam Video

mini proj_batch1.pptx online secure file transfer system
mini proj_batch1.pptx online secure file transfer systemmini proj_batch1.pptx online secure file transfer system
mini proj_batch1.pptx online secure file transfer systemKorbanMaheshwari
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?LOGINPHP360
 
Use of Automation Codecs Streaming Video Applications Based on Cloud Computing
Use of Automation Codecs Streaming Video Applications Based on Cloud ComputingUse of Automation Codecs Streaming Video Applications Based on Cloud Computing
Use of Automation Codecs Streaming Video Applications Based on Cloud ComputingTELKOMNIKA JOURNAL
 
Real Time Moving Object Detection for Day-Night Surveillance using AI
Real Time Moving Object Detection for Day-Night Surveillance using AIReal Time Moving Object Detection for Day-Night Surveillance using AI
Real Time Moving Object Detection for Day-Night Surveillance using AIIRJET Journal
 
JiyongKim_HHMI report
JiyongKim_HHMI reportJiyongKim_HHMI report
JiyongKim_HHMI reportJiyong Kim
 
Programming Without Coding Technology (PWCT) Getting Started - The Time Machine
Programming Without Coding Technology (PWCT)  Getting Started - The Time MachineProgramming Without Coding Technology (PWCT)  Getting Started - The Time Machine
Programming Without Coding Technology (PWCT) Getting Started - The Time MachineMahmoud Samir Fayed
 
Language learning using augmented reality
Language learning using augmented realityLanguage learning using augmented reality
Language learning using augmented realityAmritanshu Sawarn
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?LOGINPHP360
 
Multimedia authoring tools and User interface design
Multimedia authoring tools and User interface designMultimedia authoring tools and User interface design
Multimedia authoring tools and User interface designSagar Rai
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationIRJET Journal
 
Cis247 a ilab 1 of 7 creating a user interface
Cis247 a ilab 1 of 7 creating a user interfaceCis247 a ilab 1 of 7 creating a user interface
Cis247 a ilab 1 of 7 creating a user interfacecis247
 
Cis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfaceCis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfacesdjdskjd9097
 
Delivering information to students 24/7 with Camtasia.
Delivering information to students 24/7 with Camtasia.Delivering information to students 24/7 with Camtasia.
Delivering information to students 24/7 with Camtasia.Kathleen Carlson
 
Iaetsd arm based remote surveillance and motion detection
Iaetsd arm based remote surveillance and motion detectionIaetsd arm based remote surveillance and motion detection
Iaetsd arm based remote surveillance and motion detectionIaetsd Iaetsd
 

Similar to Automatically Record Webcam Video (20)

VIRTUAL LAB
VIRTUAL LABVIRTUAL LAB
VIRTUAL LAB
 
mini proj_batch1.pptx online secure file transfer system
mini proj_batch1.pptx online secure file transfer systemmini proj_batch1.pptx online secure file transfer system
mini proj_batch1.pptx online secure file transfer system
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
 
Use of Automation Codecs Streaming Video Applications Based on Cloud Computing
Use of Automation Codecs Streaming Video Applications Based on Cloud ComputingUse of Automation Codecs Streaming Video Applications Based on Cloud Computing
Use of Automation Codecs Streaming Video Applications Based on Cloud Computing
 
Real Time Moving Object Detection for Day-Night Surveillance using AI
Real Time Moving Object Detection for Day-Night Surveillance using AIReal Time Moving Object Detection for Day-Night Surveillance using AI
Real Time Moving Object Detection for Day-Night Surveillance using AI
 
JiyongKim_HHMI report
JiyongKim_HHMI reportJiyongKim_HHMI report
JiyongKim_HHMI report
 
Programming Without Coding Technology (PWCT) Getting Started - The Time Machine
Programming Without Coding Technology (PWCT)  Getting Started - The Time MachineProgramming Without Coding Technology (PWCT)  Getting Started - The Time Machine
Programming Without Coding Technology (PWCT) Getting Started - The Time Machine
 
Sample report
Sample reportSample report
Sample report
 
Language learning using augmented reality
Language learning using augmented realityLanguage learning using augmented reality
Language learning using augmented reality
 
Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?Why is .Net Technology Recognised for Software Development?
Why is .Net Technology Recognised for Software Development?
 
Syncitall
SyncitallSyncitall
Syncitall
 
Multimedia authoring tools and User interface design
Multimedia authoring tools and User interface designMultimedia authoring tools and User interface design
Multimedia authoring tools and User interface design
 
F04402038042
F04402038042F04402038042
F04402038042
 
3 Review
3 Review3 Review
3 Review
 
E farming
E farmingE farming
E farming
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous Integration
 
Cis247 a ilab 1 of 7 creating a user interface
Cis247 a ilab 1 of 7 creating a user interfaceCis247 a ilab 1 of 7 creating a user interface
Cis247 a ilab 1 of 7 creating a user interface
 
Cis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interfaceCis247 i lab 1 of 7 creating a user interface
Cis247 i lab 1 of 7 creating a user interface
 
Delivering information to students 24/7 with Camtasia.
Delivering information to students 24/7 with Camtasia.Delivering information to students 24/7 with Camtasia.
Delivering information to students 24/7 with Camtasia.
 
Iaetsd arm based remote surveillance and motion detection
Iaetsd arm based remote surveillance and motion detectionIaetsd arm based remote surveillance and motion detection
Iaetsd arm based remote surveillance and motion detection
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 

Automatically Record Webcam Video

  • 1. P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to Automatically Record and Save Video Captured when the Webcam is connected IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 200 Webcam Driver to Automatically Record and Save Video Captured when the Webcam is connected Pema Chodon1, 2 , Devi Maya Adhikari1, 3 , Gopal Chandra Nepal1, 4 , Rajen Biswa1, 5 , Sangay Gyeltshen1,6 , Chencho1,7 1 Department of Electronics and Communication, College of Science and Technology, Royal University of Bhutan, Phuentsholing, Bhutan ABSTRACT This paper presents software developed to be used with a webcam. It was developed using Microsoft Visual C++ 2010 and OpenCV 2.4.4 library files. It can be used to record and save video automatically when the webcam is connected to the computer. The program is installed and made to run. It will keep checking if the webcam is connected or not. When the webcam is connected to the computer, the system detects it and starts to record video captured by webcam. Once the webcam is disconnected from the computer, the program saves the previous recorded video and again, it will check for webcam connection. The developed software program can be used to automatically record and save video captured when the webcam is connected to the computer. Keywords— Webcam, Algorithm, Visual C++, OpenCV 1. INTRODUCTION TO MICROSOFT VISUAL C++ AND OPENCV The software program has been developed using Microsoft Visual C++ 2010 integrating with OpenCV 2.4.4 library files. OpenCV library files allows generic image/video loading, saving, and acquisition [1]. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. Thus OpenCV library files have been integrated in Microsoft Visual C++ 2010 for capturing, recording and video acquisition. Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop console and graphical applications along with Windows Form applications, web sites, web applications, and web services for all platforms supported by Microsoft Windows, Windows Mobile, .NET Framework and .NET Compact Framework [2]. Visual Studio supports different programming languages by means of language services, which allow the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. From these supported languages we use Microsoft Visual C++ 2010 express edition for writing our program [3]. OpenCV (Free Open Source Computer Vision) is a library of programming functions mainly aimed at real time computer vision. It has a BSD license (free for commercial or research use). OpenCV was originally written in C but now has a full C++ interface and all new development is in C++. There is also a full Python interface to the library [4]. The OpenCV was selected due to following features:  Open source computer vision library in C/C++.  Optimized and intended for real-time applications.  OS/hardware/window-manager independent.  Generic image/video loading, saving, and acquisition.  Both low and high level API.  Easy integration of its library files with MS visual C++ As to let the software developed to run successfully, integration of Microsoft Visual C++ with the OpenCV library files was done. The library files included are [5]:  opencv_core244.lib: This is the basic building block of the library for understanding how to manipulate the images on a pixel level. International journal of Computing Journal homepage: www.ifrsa.org
  • 2. P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to Automatically Record and Save Video Captured when the Webcam is connected IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 201  opencv_imgproc244.lib: This is for the image processing (manipulation) functions inside OpenCV  opencv_highgui244.lib: How to read/save your image/video files and how to use the built-in graphical user interface of the library.  opencv_ml244.lib: Use the powerful machine learning classes for statistical classification, regression and clustering of data.  opencv_video244.lib: Use on your video stream algorithms like: motion extraction, feature tracking and foreground extractions.  opencv_features2d244.lib: This is to use the feature point detectors, descriptors and matching framework found inside OpenCV.  opencv_calib3d244.lib: Although most of our images are in a 2D format they do come from a 3D world. This is use to find out from the 2D images information about the 3D world.  opencv_objdetect244.lib: Detects peoples and faces  opencv_contrib244.lib: How to process images and video streams with a model of retina filter for details enhancement, spatio-temporal noise removal, luminance correction and spatio- temporal events detection.  opencv_flann244.lib: It is used in Clustering and Search in Multi-Dimensional Spaces. This section documents OpenCV’s interface to the FLANN library. FLANN (Fast Library for Approximate Nearest Neighbours) is a library that contains a collection of algorithms optimized for fast nearest neighbour search in large datasets and for high dimensional features. 2. WORKING OF PROGRAM The objective of this software is to automatically save the video captured by the webcam when it is connected to the computer. The system need not have to open the webcam application and click on the button to record. The program is made run in the system. As soon as webcam is connected, it will automatically detect the webcam and recording will take place. A. Algorithm The proposed program should follow the following steps of algorithm: 1. Start the program: Gets date and current local time in the format date_month_year hr_min. 2. Check whether the webcam is connected or not. If the webcam is connected, start saving the video until the webcam is disconnected. It uses the following functions to record and save the video captured by webcam: i. cvCapture ii. cvCreateCameraCapture iii. cvQueryFrame(capture), iv. cvGetCaptureProperty, v. cvNamedWindow, vi. CvVideoWriter, vii. cvWriteFrame viii. cvWaitKey ix. cvReleaseVideoWriter x. cvReleaseCapture 3. Save the video 4. Continue to check if the webcam is connected and step 2 and 3 are repeated. Int main( int argc, char** argv ) { startcam: time_t now = time(0); struct tm tstruct; char buf[80]; tstruct = *localtime(&now); strftime(buf,sizeof(buf)," %d_ %m_ %Y %H_ %M", &tstruct); string GetTime=buf; string TimeinString= GetTime.append(".avi"); char* p = new char[TimeinString.length() + 1]; strcpy(p, TimeinString.c_str()); cout<<"n Finishd Saving Video n"; cvDestroyWindow("Webcam"); goto startcam;
  • 3. P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to Automatically Record and Save Video Captured when the Webcam is connected IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 202 B. Flow Chart Start Check if webcam is connected Start Recording the video Save the Recorded the video YES NO Figure 1: Flow Chart C. Video streaming and saving The program automatically captures and records the live video when the webcam is connected to the computer. The captured video is saved in the computer. For the naming purpose of the saved video file a function to call the computer’s system time with year, month, date, hour and minute is used. The complete name looks like “31_05_2013 15_16.avi”. This file name is converted from string to character type and passed to the video writer function of OpenCV library file. As no path is given, the recorded video file is saved in same directory as the program file. 3. TESTING THE PROGRAM For testing the working of the program it was first converted to the executable file so that it can be used from any computer system independent of the MS Visual C++ and OpenCV software. Figure 2: When webcam is not connected The program was kept running. When the program was started, it immediately checks if the webcam is connected to the system or not. The program will keep on looping until it finds the webcam is being connected to the system as shown in Figure 2. When the webcam was connected to the system, the program detects the webcam connection. The recording of captured video by the webcam takes place shown in Figure 3 [6]. Figure 3: When the webcam is connected and recording When the webcam is removed from the computer, the software will finish saving video and the program again proceed to check the status of webcam as shown in Figure 4.
  • 4. P Chodon, Devi Maya Adhikari , G C Nepal, R Biswa, S Gyeltshen, Chencho| Webcam Driver to Automatically Record and Save Video Captured when the Webcam is connected IFRSA’s International Journal Of Computing |Vol 3|issue 3|July 2013 203 Figure 4: After recording and webcam is removed So every time when the webcam is connected to the computer, the recording and saving takes place automatically. 4. ANALYSIS When the webcam is connected to the system, there was time delay for the program to detect that the webcam and to start recording the video. This is because the program needs to check the computer’s hardware for the availability of the webcam and if it is connected to the system; the computer in turn has to load the drivers when the webcam gets connected. The delay is approximately 15 seconds. 5. FUTURE WORKS There was certain delay in recording the video captured by webcam. Also the executable software is not very user friendly as the screen appears quite plain and user may not prefer it. Considering above points, following two future works are set to improve the performance of the software:  Work on software to reduce the delay time in recording the video captured by webcam.  Make the software more users friendly using Graphical User Interface (GUI). 6. CONCLUSION In this paper we have proposed a software program used to record the video captured by a webcam automatically when it is connected to a computer. The software developed was tested and found to be working with some time delay to start recording. Software will be more efficient if this delay time could be minimized. This software was actually developed for a PIR sensor based security system where the webcam gets actuated when PIR sensor detects an object in its detection range. When the webcam is actuated, the software detects the webcam is ON and starts to record video captured by the webcam. REFERENCES [1] Anonymus, “OpenCV documentation,” [Online] http://docs.opencv.org/index.html, April 2013. [2] Anonymous, “Tutorials Point,” [Online]. http://www.tutorialspoint.com/cplusplus/cpp_o verview.htm [3] Anonymous, “Mathematics and Computer Science,” South Dakota School of Mines and Technology. [Online]. http://www.mcs.sdsmt.edu/csc150/Handouts/V isual%20C++%202010%20Tutorial.pdf, Jan. 2012 [4] Gady Agam, “Department of Computer Science,” [Online]. http://www.cs.iit.edu/~agam/cs512/lect- notes/opencv-intro/, Jan. 2007. [5] Anonymous, “highgui. High-level GUI and Media I/O,” [Online]. http://docs.opencv.org/modules/highgui/doc/hi ghgui.html, April, 2013. [6] P. Chodon, D. M. Adhikari, G. C. Nepal, R. Biswa, S. Gyeltshen and Chencho, "Passive Infrared (PIR) Sensor Based Security System," (IJEECS) International Journal of Electrical, Electronics ad Computer Systems, vol. 14, no. 2, 2013.