OpenCV Python Tutorial For Beginners 4 – How to Read, Write, Show Videos from Camera in OpenCV

///OpenCV Python Tutorial For Beginners 4 – How to Read, Write, Show Videos from Camera in OpenCV

OpenCV Python Tutorial For Beginners 4 – How to Read, Write, Show Videos from Camera in OpenCV

FavoriteLoadingAdd to favorites

In this video on OpenCV Python Tutorial For Beginners, I am going to show How to Read, Write, Show Videos from Camera in OpenCV.
We will see How to read video, display video and save video,
How to capture from Camera and display it, we will see these functions : cv.VideoCapture(), cv.VideoWriter(). So we will Capture Video from Camera using opencv. So let us see How to process images of a video, frame by frame in video streaming using Opencv python.

The list of available codes can be found in fourcc.org –

Gist of code I used in this video (Display the webcam in Python using OpenCV (cv2)) –

VideoCaptureProperties

Python: cv.CAP_PROP_FRAME_WIDTH: Width of the frames in the video stream.

Python: cv.CAP_PROP_FRAME_HEIGHT: Height of the frames in the video stream.

Color image loaded by OpenCV is in BGR mode. But Matplotlib displays in RGB mode.

pip is a package management system used to install and manage software packages written in Python.
OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. opencv is available on Mac, Windows, Linux. Works in C, C++, and Python.
it is Open Source and free. opencv is easy to use and install.

Starting with an overview of what the course will be covering, we move on to discussing morphological operations and practically learn how they work on images. We will then learn contrast enhancement using equalization and contrast limiting. Finally we will learn 3 methods to subtract the background from the video and implement them using OpenCV.

At the end of this course, you will have a firm grasp of Computer Vision techniques using OpenCV libraries. This course will be your gateway to the world of data science.

Feel the real power of Python and programming! The course offers you a unique approach of learning how to code by solving real world problems.

#ProgrammingKnowledge #ComputerVision #OpenCV
★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ ⚫️
Java Programming Course ➡️ ⚫️
Bash Shell Scripting Course ➡️ ⚫️
Linux Command Line Tutorials ➡️ ⚫️
C Programming Course ➡️ ⚫️
C++ Programming Course ➡️ ⚫️
PHP Programming Course ➡️ ⚫️
Android Development Course ➡️ ⚫️
C# Programming Course ➡️ ⚫️
JavaFx Programming Course ➡️ ⚫️
NodeJs Programming Course ➡️ ⚫️
Jenkins Course For Developers and DevOps ➡️ ⚫️
Scala Programming Tutorial Course ➡️ ⚫️
Bootstrap Responsive Web Design Tutorial ➡️ ⚫️
MongoDB Tutorial Course ➡️ ⚫️
QT C++ GUI Tutorial For Beginners ➡️

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare –
Data Science – |
Machine Learning – |
Artificial Intelligence – |
MERN Stack E-Degree Program – |
DevOps E-degree – |
Data Analytics with R – |
AWS Certification Training – |
Projects in Java – |
Machine Learning With TensorFlow – |
Angular 8 – Complete Essential Guide –
Kotlin Android Development Masterclass –
Learn iOS Programming Building Advance Projects –

★★★ Follow ★★★
My Website –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

source

By |2020-02-06T01:39:46+00:00February 6th, 2020|Python Video Tutorials|44 Comments

44 Comments

  1. yashwardhan singh sisodia February 6, 2020 at 1:39 am - Reply

    how to get sound in videos

  2. TOBY RAN February 6, 2020 at 1:39 am - Reply

    my camera doest pop-up

  3. Siva sai February 6, 2020 at 1:39 am - Reply

    sound is not recording for me any fixes???

  4. Code-Wise February 6, 2020 at 1:39 am - Reply

    Thank you, you have students and followers from all around the world. Mexico is Here 🇲🇽

  5. Basista Basnet February 6, 2020 at 1:39 am - Reply

    Brother, this video is not for beginners. Please replace that video title.

  6. Hinduja Velupula February 6, 2020 at 1:39 am - Reply

    At the last clip the streamed gray video was converted to rgb how was it done ?

  7. Fahad Faridi February 6, 2020 at 1:39 am - Reply

    sir i think there is a channel name #acodebiz and he is stealing your videos????

  8. Can we get 500 subs with no vids? February 6, 2020 at 1:39 am - Reply

    Could someone explain why ret is equal to True? I thought that it would hold cap.read(), which is the image from the webcam is it not?

  9. Astik Anand February 6, 2020 at 1:39 am - Reply

    If your video is not getting saved/played even after code is running and the file is created then refer https://stackoverflow.com/questions/50043573/opencv-video-not-getting-saved/59471890#59471890.

  10. Shafique sayed February 6, 2020 at 1:39 am - Reply

    After execution of the program video is not playing

  11. Simon R. February 6, 2020 at 1:39 am - Reply

    When opening the video from the camera, it often takes a very long time to open, or just not at all. Fixes??

  12. RnF Channel February 6, 2020 at 1:39 am - Reply

    can you explain how to auto-capture using ultrasonic sensor as trigger ?

  13. hamza shahid February 6, 2020 at 1:39 am - Reply

    Sir how to read and show images using loops

  14. Константин Писаный February 6, 2020 at 1:39 am - Reply

    Anybody know why the video is saved in color (not grey) and how to make it work as intended?

  15. silky srinivas February 6, 2020 at 1:39 am - Reply

    WHAT INTERFACE ARE YOU USING

  16. Red Pill February 6, 2020 at 1:39 am - Reply

    Anyone else finds extremely soothing, when he says "Destroy all Windows ? "

  17. keyur joshi February 6, 2020 at 1:39 am - Reply

    hello, I tried running the same code and it opens the window to show the webcam results but at the end it doesn't save the video.

  18. Asma Agoubi February 6, 2020 at 1:39 am - Reply

    cap.release()

    ^

    IndentationError: unindent does not match any outer indentation level
    please help me what is my problem?

  19. Shreyash Dubey February 6, 2020 at 1:39 am - Reply

    USE out=cv2.VideoWriter('output.avi',fourcc,20.0,(640,480),0) FOR CAPTURING AND SAVING GRAYSCALE VIDEO

  20. f0w February 6, 2020 at 1:39 am - Reply

    expected an indented block in python
    im getting this error when im trying to save
    before that everything works like a charm!

  21. Jaka Phoenix February 6, 2020 at 1:39 am - Reply

    Hi, I'm currently studying python and opencv.
    I just wrote the code like in this video, but there is a warning message like this:

    [ WARN:0] global C:projectsopencv-pythonopencvmodulesvideoiosrccap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

    what exactly is the meaning of that warning message? thank you for your help.

  22. shauvik chandra karmakar February 6, 2020 at 1:39 am - Reply

    I have a problem because when I am executing the code no video is captured, my laptop is only capturing a static image in spite of giving the capturevideo command

  23. Quranic Science February 6, 2020 at 1:39 am - Reply

    Amazing

  24. Mohsin Shanavas February 6, 2020 at 1:39 am - Reply

    every time i run the code it shows frame(not responding)

  25. Mohamed Amine Labidi February 6, 2020 at 1:39 am - Reply

    i tried to save the video on gray but it didnt work.

  26. Keerthi Nandigam February 6, 2020 at 1:39 am - Reply

    Why is the out.avi file not playing for me? When I used VLC, it just doesn't show anything and when I tried to open using windows films and tv, it says the format is not supported

  27. AneL GurunG February 6, 2020 at 1:39 am - Reply

    Hi, every time I run this, lena.jpg image opens up instead of my video. What could be the reason? I passed 0,1,-1,2 in VideoCapture too

  28. Tanmay S February 6, 2020 at 1:39 am - Reply

    how to write video on grayscale. Pls help me

  29. Michael Schöne February 6, 2020 at 1:39 am - Reply

    Hey saw your videos today. Very nice! I like ur openCV tuts GJ!
    I´ll check the rest too. Thanks man. 🙂

    sorry for my bad eng i have to learn no time for corrections 😛

  30. parimal mahindrakar February 6, 2020 at 1:39 am - Reply

    literally that semicolon bothering me

  31. Jagdish Chavan February 6, 2020 at 1:39 am - Reply

    i followed each and every line as mentioned still i am getting error [ WARN:1] terminating async callback after this also if i press exc then only the frame moves forward and file format is not recognized still last video every thing was ok any one plz can help

  32. Saim Ali February 6, 2020 at 1:39 am - Reply

    sir out.write for after the conversion into gray also the same result.So how i save video in gray color???

  33. Paul McWhorter February 6, 2020 at 1:39 am - Reply

    When I try and write "gray" the converted frames, the .avi file is not playable . . . no errors but video will not play.

  34. Light Worm February 6, 2020 at 1:39 am - Reply

    How can I check that the video I wanna open is not already playing?

  35. Light Worm February 6, 2020 at 1:39 am - Reply

    Thank you. RGB video file was converted to grayscale video

  36. Abhay Aggarwal February 6, 2020 at 1:39 am - Reply

    my webcame is not opening while following your code can you please help how to fix it

  37. R Star February 6, 2020 at 1:39 am - Reply

    only capture image

  38. Andy Tannie February 6, 2020 at 1:39 am - Reply

    lmao xvid

  39. Virtual February 6, 2020 at 1:39 am - Reply

    4:54 you can just show your face

  40. Hypotik February 6, 2020 at 1:39 am - Reply

    ty for tutorial

  41. Anwayee Roy Choudhury February 6, 2020 at 1:39 am - Reply

    Why I have to install opencv for every new project that I create?

  42. amr mahmoud February 6, 2020 at 1:39 am - Reply

    the code through error for me I dont know why

  43. Shahrukh Khan February 6, 2020 at 1:39 am - Reply

    Hello sir.

    This tutorial very helpful for me as I tried the same program on my laptop. But unfortunately I am getting error for library 'cv2'. I install installed all library but getting same error.

    Could you please guide me to fix this?

  44. Abdulaziz Kodirov February 6, 2020 at 1:39 am - Reply

    That semicolon is bothering me

Leave A Comment

*