title: Python: How to use ffmpeg to read videos(video file or rtsp) and display them using OpenCV?
body: <p>I know that if we want to read video file or USB camera or rtsp stream, we can use <code>cv2.VideoCapture</code>.<br>
  But for some reason, I want to use ffmpeg to do the thing and process obtained images using opencv. So the pseudocode would be:</p>
  
  <pre class="lang-py prettyprint-override"><code>import cv2
  import ffmpeg
  
  videoFile = 'XXX.mp4'
  
  video = ffmpeg.XXX(videoFile)
  
  while True:
      frame = video.read() # this read() function is made up by me
      frameCV = ffmpeg2cv(frame) # this ffmpeg2cv() function is made up by me
  
      cv2.imshow('frame', frameCV)
  </code></pre>
  
  <p>I have searched a something like <a href="https://github.com/kkroening/ffmpeg-python" rel="nofollow noreferrer">https://github.com/kkroening/ffmpeg-python</a>. But I still not know how to do this. I think ffmpeg is too hard and there are few online docs unlike opencv. So please help.</p>