title: Create a new camera source using OpenCV Python (Camera Driver Using Python)
body: <p>Does anyone know a way to create a camera source using python? So for example I have 2 cameras:</p>
  <ol>
  <li>Webcam</li>
  <li>USB Cam</li>
  </ol>
  <p>Whenever I use any web application or interface which requires camera, I have an option to select a camera source from the above two mentioned.</p>
  <p>What I want to achieve is that I am processing real time frames in my python program with a camera portal of my own like this:</p>
  <pre><code>import numpy as np
  import cv2
  
      while True:
          _,frame = self.cam.read()
          k = cv2.waitKey(1)
          if k &amp; 0xFF == ord('q'):
              self.cam.release()
              cv2.destroyAllWindows()
              break
          else:
              cv2.imshow(&quot;Frame&quot;,frame)
  </code></pre>
  <p>Now I want to use this <code>frame</code> as a camera source so next time whenever I open a software or web app which requires camera then it show option as follows:</p>
  <ol>
  <li>Webcam</li>
  <li>USB Cam</li>
  <li>Python Cam (Or whatever be the name)</li>
  </ol>
  <p>Does anyone has any advice or hint on how to go about that? I have seen some premium softwares which generate their own camera source but they're written in c++. I was wondering if this could happen in python or not.</p>
  <p>Here is an example of the same:</p>
  <p><a href="https://i.stack.imgur.com/Oj4qS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Oj4qS.png" alt="enter image description here" /></a></p>
  <p>As you can see there are multiple camera source there. I want to add one camera source which displays the frames processed by python in its feed.</p>