title: OpenCV VdeoWriter problems - RGB columns in the video
body: <p>I'm trying to do some video processing but can't figure out how to output the result. I need an RGB video. When I write code like this, I expect the output to be a white 200x100 rectangle:</p>
  <pre><code>oy = 100
  ox = 200
  wri = cv2.VideoWriter(&quot;output/vid.avi&quot;, cv2.VideoWriter_fourcc(*&quot;MJPG&quot;), 30.0, (ox, oy))
  
  testarr = np.empty((oy, ox, 3))
  testarr.fill(255.0)
  
  for i in range(500):
      wri.write(testarr)
  </code></pre>
  <p>But instead, I get this:</p>
  <p><a href="https://i.stack.imgur.com/MCMCq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MCMCq.png" alt="enter image description here" /></a></p>
  <p>I tried using <code>MJPG</code>(they say it's the safest option), <code>XVID</code>, <code>DIVX</code> and changing the video format, everything is the same.</p>
  <p>I don't even know which part causes the problem: should I be looking for a different codec? or maybe I'm using wrong array structure?</p>