Make A Security Camera With Python

  Рет қаралды 231,510

Tech With Tim

Tech With Tim

Күн бұрын

Welcome back to another video! In this video, I'm going to show how to create a security camera system using OpenCV. We'll be detecting a face or body in the footage so a webcam or external camera that can connect to your computer is needed. We'll be using that camera through OpenCV and detecting a face or body before recording.
💻 AlgoExpert is the coding interview prep platform that I used to ace my Microsoft and Shopify interviews. Check it out and get a discount on the platform using the code "techwithtim" algoexpert.io/techwithtim
📄 Resources 📄
OpenCV Tutorial Series: • OpenCV Python Tutorials
Code In This Video: github.com/techwithtim/Python...
OpenCV FourCC's: www.fourcc.org/codecs.php
OpenCV HaarCascades: github.com/opencv/opencv/tree...
Fix Pip (Mac): • How to Install Pygame ...
Fix Pip (Windows): • How to Install Pygame ...
⭐️ Timestamps ⭐️
00:00 | Overview
01:15 | OpenCV Setup
02:43 | Displaying Webcam Video
06:35 | Detecting Faces and Bodies
12:46 | Drawing Faces On Video
16:09 | Saving And Recording Video
20:25 | Security Camera Logic
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
💰 Courses & Merch 💰
💻 The Fundamentals of Programming w/ Python: tech-with-tim.teachable.com/p...
👕 Merchandise: teespring.com/stores/tech-wit...
🔗 Social Medias 🔗
📸 Instagram: / tech_with_tim
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-ruscica-82631b179
🌎 Website: techwithtim.net
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
🎬 My KZfaq Gear 🎬
🎥 Main Camera (EOS Canon 90D): amzn.to/3cY23y9
🎥 Secondary Camera (Panasonic Lumix G7): amzn.to/3fl2iEV
📹 Main Lens (EFS 24mm f/2.8): amzn.to/2Yuol5r
🕹 Tripod: amzn.to/3hpSprv
🎤 Main Microphone (Rode NT1): amzn.to/2HrZxXc
🎤 Secondary Microphone (Synco Wireless Lapel System): amzn.to/3e07Swl
🎤 Third Microphone (Rode NTG4+): amzn.to/3oi0v8Z
☀️ Lights: amzn.to/2ApeiXr
⌨ Keyboard (Daskeyboard 4Q): amzn.to/2YpN5vm
🖱 Mouse (Logitech MX Master): amzn.to/2HsmRDN
📸 Webcam (Logitech 1080p Pro): amzn.to/2B2IXcQ
📢 Speaker (Beats Pill): amzn.to/2XYc5ef
🎧 Headphones (Bose Quiet Comfort 35): amzn.to/2MWbl3e
🌞 Lamp (BenQ E-reading Lamp): amzn.to/3e0UCr8
🌞 Secondary Lamp (BenQ Screenbar Plus): amzn.to/30Dtafi
💻 Monitor (BenQ EX2780Q): amzn.to/2HsmUPZ
💻 Monitor (LG Ultrawide 34WN750): amzn.to/3dSD7tS
🎙 Mic Boom Arm (Rode PSA 1): amzn.to/30EZw9m
🎚 Audio Interface (Focusrite Scarlet 4i4): amzn.to/2TjXsih
💸 Donations 💸
💵 One-Time Donations: www.paypal.com/donate?hosted_...
💰 Patreon: / techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
- Tech With Tim
- Security
- OpenCV
- Security Camera
- Detecting Faces
- Python
⭐️ Hashtags ⭐️
#TechWithTim #SecurityCamera

Пікірлер: 191
@Nostra.Damus14
@Nostra.Damus14 2 жыл бұрын
I think the best programming tutorial a youtuber can make is teaching how to read a module documentation efficiently and intuitively.
@tonystark3399
@tonystark3399 2 жыл бұрын
Absolutely true. If you find any please share it with mam/ sir
@animaluchisommicheal7622
@animaluchisommicheal7622 2 жыл бұрын
Couldn't agree more!!
@ZahidHasan-cc8tf
@ZahidHasan-cc8tf 2 жыл бұрын
Yes!
@tonymudau3005
@tonymudau3005 2 жыл бұрын
I see some bots in these chats ... really good bots ... check the comments carefully
@TechMalaya
@TechMalaya 2 жыл бұрын
yes, I am agree because this is the hardest part
@shftn2gear97
@shftn2gear97 2 жыл бұрын
The stuff you do for this community at no charge is just amazing. Thanks, Tim!
@janisvelbergs6394
@janisvelbergs6394 2 жыл бұрын
Tim, you are the best. I hope there will be continue of this series (at least part two): 1.) Manage files (delete records older than some period) 2.) Notification on e-mail about new record 3.) ... and more features with Python Tim, thank you for your KZfaq content! ;)
@benfou2140
@benfou2140 2 жыл бұрын
Easy to find. Tim is just introducing the subject
@vishwanath-ts
@vishwanath-ts 2 жыл бұрын
Tim you're doing a great job!! Keep up the good work!!👍🏻
@sagshah10
@sagshah10 2 жыл бұрын
Great video as always Tim, I cant even imagine how stressful it must be to try to code and explain, but just thought I mention that for future it might help to include comments on your code as it will help reduce the amount of explanation you would need to do, and is usually better practice right. Thanks again for your awesome content.
@wrangleroffroad4318
@wrangleroffroad4318 2 жыл бұрын
I like the way you explain and present your code, especially at the end of video wrapping up is really helpful. Thank you for awesome content!
@hedimak999
@hedimak999 2 жыл бұрын
you are such a great explainer dude ! honestly the video is simple to understand , concise and very very informative !!! you helped me a lot !
@shanerobins1329
@shanerobins1329 2 жыл бұрын
Tim, thanks for the example, very good.
@ChiefRemoteOfficer
@ChiefRemoteOfficer 2 жыл бұрын
Damn, that is some good stuff. That CV library looks comprehensive. Thanks for sharing!
@FreshBrothersCZ
@FreshBrothersCZ Жыл бұрын
Very well explained, good job man!
@melissaleigh3013
@melissaleigh3013 2 жыл бұрын
Tim, this is sooooo cool
@prestonwallitsch8636
@prestonwallitsch8636 2 жыл бұрын
This is really cool!
@tonymudau3005
@tonymudau3005 2 жыл бұрын
Thanks Tim... you are an amazing gent 🙏
@RunTheProgram
@RunTheProgram 2 жыл бұрын
when he creates a variable more than 10 letters long, you know his a legend
@konstantinosadamis2130
@konstantinosadamis2130 2 жыл бұрын
great work tim!
@theGoogol
@theGoogol 2 жыл бұрын
Learning Python ... subbed because your content turns out to be HQ lessons.
@Dalan76
@Dalan76 2 жыл бұрын
Great tutorial !!
@tanmaypatel4152
@tanmaypatel4152 2 жыл бұрын
Nice video, Tim👍
@kitgary
@kitgary 2 жыл бұрын
This guy is one of the best developer in the world!
@Bruh-sp2bj
@Bruh-sp2bj 2 жыл бұрын
Hes good at best not really the best
@johnwig285
@johnwig285 2 жыл бұрын
@@Bruh-sp2bj He said ONE of the best not the best. Ffs.
@Bruh-sp2bj
@Bruh-sp2bj 2 жыл бұрын
@@johnwig285 not even one of the best ffs. Decent
@FnanAsfaha
@FnanAsfaha 9 ай бұрын
I like it you are actually a genius
@CKTEH9898
@CKTEH9898 2 жыл бұрын
I think I had complete the feature mention earlier in the vedio, but i will still follow this series to seek the better way of doing it.
@4bt862
@4bt862 2 жыл бұрын
The best Python guy that creates a social engineering tools
@CallumForster
@CallumForster 2 жыл бұрын
What module do I need to make the import command colour be red and not the pink colour it usually is
@BeRaikwal
@BeRaikwal 2 жыл бұрын
dude i just wanna take ur blessing ahahahaha U ARE SO GOOD AT IT
@ihatethesensors
@ihatethesensors 2 жыл бұрын
Very very interesting!
@rcsteimer
@rcsteimer 2 жыл бұрын
To make your video start faster add this code to define some of the video parameters. It will cut the start of the video in half or more. cam=cv2.VideoCapture(1,cv2.CAP_DSHOW) cam.set(cv2.CAP_PROP_FRAME_WIDTH, width) cam.set(cv2.CAP_PROP_FRAME_HEIGHT,height) cam.set(cv2.CAP_PROP_FPS, 20) cam.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc(*'mp4v'))
@cjay9615
@cjay9615 2 жыл бұрын
Legend, thank you
@mak448a
@mak448a 6 ай бұрын
Who misses this Tim who didn't make hyper-stimulating videos?
@heineken2295
@heineken2295 2 жыл бұрын
thx for the tutorial)))
@soapcarvingasmr7686
@soapcarvingasmr7686 2 жыл бұрын
Best Developer in the World
@WHOAMI-xx3lx
@WHOAMI-xx3lx 9 ай бұрын
thank you so much
@manu-gt9gr
@manu-gt9gr 2 жыл бұрын
this the type of videos i wana watch, thanks bro!
@trevormckellen5613
@trevormckellen5613 2 жыл бұрын
after the opencv tutorials. this is just what i need
@amiralihomayoni6243
@amiralihomayoni6243 2 жыл бұрын
Typical comment on his videos
@suphotnarapong355
@suphotnarapong355 Жыл бұрын
Thank you very much
@Raahim
@Raahim 2 жыл бұрын
i literally just looked up how to detect motion with python on my 2nd monitor.... looked over on my 1st monitor youtube, and this video popped up!
@harrypoon2438
@harrypoon2438 2 жыл бұрын
I would love to see you talk about using a camera wirelessly (for instance using a raspberry pi with an esp32 cam)
@Joe-zg9eq
@Joe-zg9eq 2 жыл бұрын
Ig what you can do is give it a lot of storage and set up a ssh system so that you can wirelessly control your raspberry pi and thus you could see the recordings from anywhere in the world
@CharlieCocalon
@CharlieCocalon Жыл бұрын
Im following.
@septimusseverus252
@septimusseverus252 2 жыл бұрын
This channel is simply a treasure
@samsonnxumalo392
@samsonnxumalo392 Жыл бұрын
Thanks Tim
@tonyd2776
@tonyd2776 2 жыл бұрын
I’m 43 yrs old and want to be as smart and articulate as this kid when I grow up
@sovereignlivingsoul
@sovereignlivingsoul Ай бұрын
excellent video, thanks for sharing, with that last statement regarding showing the video frame, i use a raspberry pi, could you set a key press that will show the current video, as if you wake up to a sound and hit the key to show the camera live view
@thinkfacts2225
@thinkfacts2225 2 жыл бұрын
tim you are amazing love from india
@rickysonarcix9830
@rickysonarcix9830 2 жыл бұрын
very cool 😎
@ilikeyoursmile6215
@ilikeyoursmile6215 2 жыл бұрын
Hey Tim, What is your Color Theme do you use? Mine are kinda boring I want to change to something and I think what you're using is gonna work.
@podcastdzfan
@podcastdzfan 2 жыл бұрын
you re the best
@youssefelamrani7905
@youssefelamrani7905 2 жыл бұрын
heey Tim great video, which is better : build our own classifier or use the built in classifiers for safety and robustness reasons like if someone is building a bank security system, and how can we use this open cv code to interact with a real camera like in banks, thanks budy
@justchris846
@justchris846 2 жыл бұрын
Do you have a tutorial showing how to set up visual studio code?
@ziyad7780
@ziyad7780 2 жыл бұрын
Amazing
@LayprangTradder
@LayprangTradder 2 жыл бұрын
Thank bro..
@fastmamajama
@fastmamajama Ай бұрын
awesome stuff. i wrote a camera app in android but it is really hard. i got a camera in my roof that records things that fly over my house. i want to set up a python camera that will record only birds but the end goal is record ufos. that kinda script would be priceless for the ufo community.
@Venaber
@Venaber 2 жыл бұрын
Thank you
@HamzaArslan
@HamzaArslan 2 жыл бұрын
Me when my code doesn't run properly: 13:29 Me when my code does work: 13:28
@cdkw8254
@cdkw8254 2 жыл бұрын
Lol
@kolboy2028
@kolboy2028 2 жыл бұрын
hey tim, great video. can you please tell me how can I record the audio along with the video?
@ryanwalker4660
@ryanwalker4660 Жыл бұрын
I followed along and got a working security program written in python, awesome thank you very much. I've just started learning Python but I've watched a few of your videos, the others being the python curses/ncurses tutorials, awesome videos and explanation of the examples. Thank you. *** how can I redirect where the video gets saved, as of now all files are saved in the directory where the script resides in, thanks.
@LamethHUN
@LamethHUN 2 жыл бұрын
Great video! One small bug: You are using the same cascade for body and face: faces = face_cascade.detectMultiScale(gray, 1.3, 5) bodies = face_cascade.detectMultiScale(gray, 1.3, 5)
@Hog-n
@Hog-n 2 жыл бұрын
My detectMultiScale isnt working it just gives me an error
@ABODY734
@ABODY734 2 жыл бұрын
@@Hog-n same here :(
@AndreiDante
@AndreiDante 2 жыл бұрын
Can you make a body tracer that gives same input as a keyboard? For example: if you lower your upper body to the right (keeping legs in the same place, facing the camera), this move would be equivalent to you pressing right arrow key. Is that possible in pure python?
@deshansalitha2477
@deshansalitha2477 2 жыл бұрын
thanks for project
2 жыл бұрын
Great stuff. Possible bug on line 25.
@tcgvsocg1458
@tcgvsocg1458 2 жыл бұрын
Its really good! Can you show how to creat a screen recorder in python
@bereck7735
@bereck7735 2 жыл бұрын
Nice
@tejasvmaheshwari5658
@tejasvmaheshwari5658 2 жыл бұрын
Could you please make a video on easing-functions?
@emanuelcara316
@emanuelcara316 2 жыл бұрын
How can we generate data from this program? For example to generate data in a database, location or how many different people where spotted in different time period?
@lolexXD.
@lolexXD. 9 ай бұрын
Can u make when u turn pc on to you get notification on phone that your computer turned on?
@JAHNAVITBBTCS
@JAHNAVITBBTCS 2 жыл бұрын
Sir once we record the recording will be save to our local system. How can we upload or store the recording made by the webcam to cloud?
@colourfultoreador8467
@colourfultoreador8467 2 жыл бұрын
cool video
@hammad8954
@hammad8954 2 жыл бұрын
Great Video! could make a part two in which the webcam detects a person and opens a door if the right person's face is detected. It would be really cool!
@eaircelle3263
@eaircelle3263 2 жыл бұрын
Hello Tim, sorry, but nothing more than the many tutorials on this subject. I would have hoped from you that you would divide the screen for four cameras, that you say after 5 seconds start cam 1, the body is in front of cam 2 so it starts after the first one goes off if it detects a body. I would have wanted you to show how the video can take a photo when you detect the face ... ect but you still the best;)
@hectorbarrera9496
@hectorbarrera9496 2 жыл бұрын
Excellent video, thank you, so I have one question, can I do the same with an ip camera?
@mhdmodocluber9591
@mhdmodocluber9591 2 жыл бұрын
It’s okay, but how can I transmit image by RTSP protocol?
@wrestelman1
@wrestelman1 2 жыл бұрын
Any idea on how to make it work where it doens't record YOU but everyone else?
@mocerlaalacbaino
@mocerlaalacbaino 2 жыл бұрын
"this is your daily dose of internet"
@theplant4046
@theplant4046 Жыл бұрын
Question what if camera detect a person wears mask like hiding his face does program start recording?
@kakissakis1997i
@kakissakis1997i 2 жыл бұрын
hello TIM you are the best youtuber/programmer python spesialist for me..i am a new programmer i lvoe python and i am making tons of your videos to practise and get any better in this..so if you can make a video of this camera project to make it even better?perhaps send an email notification on your phone or somethink like that? thx a lot
@joiker2pen
@joiker2pen 2 жыл бұрын
Where do business save these video recordings usually? on a local server or in some cloud? if the cloud how do they connect the cameras to there?
@DarkGharren
@DarkGharren 2 жыл бұрын
Normally you would save it on a local device. I don't really see the point in having it in a cloud, unless maybe you employ a separate security firm that needs access to the data. You also probably wouldn't stream directly to a cloud (raw video data is huge), it makes more sense to encode the data locally and then send the completed file to the cloud.
@Motopysch
@Motopysch Жыл бұрын
How can it detect the difference between family persons faces and real theft persons??
@kadirgurani2162
@kadirgurani2162 2 жыл бұрын
Could you add some code to detect somebody ‘s face and this give some output like opening a door???
@disrael2101
@disrael2101 2 жыл бұрын
your explanation skills are exceptional.. you know exactly when it start become confusing and then you stop and explain it.. every line is explained.. i couldn't ask for a better tutorial.. i literally feel it's like a private tutorial 1on1.. exceptional work.. just one question on line 38 when the result is false isn't it just goes to the if statement on the line above aka line 37 and hence it will never check if there's a 'new' body/face? or when the if is false it returns to the upper most scope?
@agneaybnair9519
@agneaybnair9519 2 жыл бұрын
Hey Tim can you please create a video on regular expressions in python
@nospill_kunai6192
@nospill_kunai6192 2 жыл бұрын
What if I wanted to make a face ID thing, where my computer would do something when I enter it's camera?
@seyedmohsen2306
@seyedmohsen2306 Жыл бұрын
Hi How about audio How read video and audio together
@svoper3338
@svoper3338 2 жыл бұрын
Does this work with a phone camera
@evilwizard7931
@evilwizard7931 2 жыл бұрын
I had to fix the pipX install on my friends windows box, python nor was pip wasn't in the path & pipenv wasn't installed. The hardest part for me was trying to find out where python (& pipenv) lives on windows so I could just add them myself to the system environment. Once the windows system knows where python is, the Tim way works. I was thinking you should write a python module app script to try the various methods of install, then realised, you'd need to have installed that module to use it (segfault: redo from start lol)
@crimsonflash-eo2xs
@crimsonflash-eo2xs Жыл бұрын
What algorithm does this use?
@stevehoward8671
@stevehoward8671 2 жыл бұрын
What about using a stream from an IP camera?
@ABODY734
@ABODY734 2 жыл бұрын
Hi amazing video like always but i have an error after writing { faces = face_cascade.detectMultiScale(gray, 1.3, 5) } if i remove this line it's works what should i do ?
@borceacasian7425
@borceacasian7425 2 жыл бұрын
what IDE are you using in combination with tabnine?
@TeoHandle
@TeoHandle 2 жыл бұрын
Sublime Text bro
@solmanpalestinian
@solmanpalestinian 2 жыл бұрын
Can you make a program to detect thermal cameras?
@deveshchourasia6355
@deveshchourasia6355 Жыл бұрын
i am getting an error with cv2.vediocapture shows an error ' vedio capture is not an attribute of cv2 , Open cv verison 4.6.0, please help me to resolve
@nicolapesce8911
@nicolapesce8911 2 жыл бұрын
it doesn't save the videos at the end of the recordings. I already checked in the folder when the code is saved.
@isakkack5816
@isakkack5816 2 жыл бұрын
I get this error error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale' dose anybody know how to fix it
@steveburrows4747
@steveburrows4747 2 жыл бұрын
what coding platform did u use, please I really want to do this and I love your vids
@65RADEK56
@65RADEK56 2 жыл бұрын
He used python
@mantravora6119
@mantravora6119 6 ай бұрын
If i do it laptop, will it require external camera or not?
@HappyPraise
@HappyPraise 2 жыл бұрын
Pog video
@vaidhyanathansm7625
@vaidhyanathansm7625 2 жыл бұрын
Aren't we supposed to use body_cascade (for bodies) in line 23 ?
@keerthichandrac7364
@keerthichandrac7364 2 жыл бұрын
Yes
@EverythingandroidTech
@EverythingandroidTech 2 жыл бұрын
I was about to comment that lol
@kyngcytro
@kyngcytro 2 жыл бұрын
Yesssss
@cll-dy8bd
@cll-dy8bd 2 жыл бұрын
I have no idea what this guy is saying, but im really interested
@raymondperez7970
@raymondperez7970 Жыл бұрын
Import cv2 doesn’t work for me, what else can I do? I love your videos
@zambiealex8473
@zambiealex8473 2 жыл бұрын
cv2 not found, even with installing multiple opencv's.
@emanuelbarreira2007
@emanuelbarreira2007 2 жыл бұрын
to end the delay of turn on the camera, jus do this: cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
@emanuelbarreira2007
@emanuelbarreira2007 2 жыл бұрын
i dont know why it works, but it works
@SztiviBig
@SztiviBig Жыл бұрын
correkt
@youssefelamrani7905
@youssefelamrani7905 2 жыл бұрын
i have a problem in line 23, i'm using Collab and it gives me this error : OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor
@exquisitecorpse666
@exquisitecorpse666 2 жыл бұрын
same, did you solve this problem?
@anairaphadke9333
@anairaphadke9333 2 жыл бұрын
@@exquisitecorpse666 I was able to..
@thedarkglovemusic
@thedarkglovemusic Жыл бұрын
@@anairaphadke9333 Dude! How?!
@yusraapeerun4083
@yusraapeerun4083 2 жыл бұрын
I try to run the code, the light of my camera is on but I do not see any window pop up where I can see myself. Can someone please help me out
Building A Security System In Python...🚨
17:56
Tech With Tim
Рет қаралды 49 М.
LEARN OPENCV in 3 HOURS with Python | Including 3xProjects | Computer Vision
3:09:08
Murtaza's Workshop - Robotics and AI
Рет қаралды 3,2 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 14 МЛН
Самое Романтичное Видео ❤️
00:16
Глеб Рандалайнен
Рет қаралды 4,9 МЛН
How Hackers Hack CCTV Cameras
15:00
zSecurity
Рет қаралды 743 М.
Учим Python за 1 час! #От Профессионала
59:01
Хауди Хо™ - Просто о мире IT!
Рет қаралды 10 МЛН
Pygame in 90 Minutes - For Beginners
1:35:22
Tech With Tim
Рет қаралды 1 МЛН
IP camera stream using RTSP and openCV python
4:09
Yahiya Mulla
Рет қаралды 85 М.
Camera Recording Tool in Python
7:46
NeuralNine
Рет қаралды 14 М.
Motion Detection Alarm System in Python
19:20
NeuralNine
Рет қаралды 37 М.
5 Mini Python Projects - For Beginners
1:41:08
Tech With Tim
Рет қаралды 2,8 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 14 МЛН