title: How to use webcam using opencv in PyCharm remote SSH Interpreter (SFTP) - Python
body: <p>How webcam can be accessed from local PC to remote server in order to do remote development?
  My remote server configuration is</p>
  
  <ul>
  <li>Ubuntu 16.04 </li>
  <li>OpenCV 4 </li>
  <li>Python 3.6</li>
  </ul>
  
  <p>I'm using PyCharm 2019.1.3 in my local PC to use as remote development. All the other configurations, code (debugging) etc. is working fine, just camera is not accessing.</p>
  
  <ul>
  <li>All the files (code and data) are on my remote server</li>
  <li>The development (adding/editing files) will happen at the remote server</li>
  <li>The code will execute on remote server from local PC</li>
  </ul>
  
  <p>I searched on internet and some related questions but it's for Docker <a href="https://stackoverflow.com/questions/44852484/access-webcam-using-opencv-python-in-docker">Access webcam using OpenCV (Python) in Docker?</a>  and another <a href="https://answers.opencv.org/question/199105/videoio-error-v4l-cant-open-camera-by-index-0/" rel="nofollow noreferrer">https://answers.opencv.org/question/199105/videoio-error-v4l-cant-open-camera-by-index-0/</a><br>
  But didn't solve my problem.</p>
  
  <pre><code>if video_file is not None:
      video = cv2.VideoCapture(video_file)
      assert video.isOpened()
  else:
      if disable_vidgear:
          video = cv2.VideoCapture(camera_id)
          assert video.isOpened()
      else:
          video = CamGear(camera_id).start()
  </code></pre>
  
  <p>I'm passing video_file (file name and path) and camera_id (which is 0) in arguments. It works fine if code is in local PC.</p>
  
  <p>When I run the code on server, I got this error "VIDEOIO ERROR: V4L: can't open camera by index 0".
  I tried with different index (-1, 0, 1, 2 etc) and same error.</p>
  
  <p>I hope to get some valuable suggestions from experts.</p>