How to play an .mp4 or .avi video in Google Colab?
I tried using the following code:
from IPython.display import HTML
from base64 import b64encode
mp4 = open('video.mp4','rb').read()
data_url = "data:video/mp4;base64," + b64encode(mp4).decode()
HTML("""
<video width=400 controls>
<source src="%s" type="video/mp4">
</video>
""" % data_url)
Don't know why after executing this, the video doesn't play.There is no network issue in my place. Please help. Also, Is there any other way by which i can play .mp4 or avi video in Colab?
screenshot of code in colab notebook and the received output
Thank You