title: Numpy array as video in Jupyter Notebook
body: <p>I have a set of edge images that I have extracted from videos (using <code>cv2.Canny</code>). So the size of the array is <code>TxHxW</code>. Where <code>T</code> is time steps, and the following parameters are height and width.</p>
  
  <p>Currently the way that I display the output on a <strong>Jupyter Notebook</strong> is with the following code:</p>
  
  <pre><code>from IPython.display import HTML
  import imageio
  
  imageio.mimwrite('test2.mp4', edges, fps=30)
  HTML("""
  &lt;video width="480" height="360" controls&gt;
    &lt;source src="{0}"&gt;
  &lt;/video&gt;
  """.format('./test2.mp4'))
  </code></pre>
  
  <p>I feel life the writing to file is probably unnecessary and that there might be a better way. If there is please let me know. The emphasis is on displaying in a Jupyter notebook.</p>
  
  <p>If you need a testcase let <code>edges = np.random.randn(100, 80, 80)</code>.</p>
  
  <h2>Solution 1:</h2>
  
  <p>Thanks to the comment from @Alleo below. With Ipython 7.6+ you can do the following:</p>
  
  <pre><code>import imageio; 
  from IPython.display import Video; 
  imageio.mimwrite('test2.mp4', edges, fps=30); 
  Video('test2.mp4', width=480, height=360) #the width and height option as additional thing new in Ipython 7.6.1
  </code></pre>
  
  <p>This still needs you to write to file though.</p>