Skip to content

Instantly share code, notes, and snippets.

@SeaOfOcean
Created September 28, 2017 02:31
Show Gist options
  • Save SeaOfOcean/50f0ab0648f307bc5380a0c9664bdaee to your computer and use it in GitHub Desktop.
Save SeaOfOcean/50f0ab0648f307bc5380a0c9664bdaee to your computer and use it in GitHub Desktop.
import io
import base64
from IPython.display import HTML
video = io.open(output_path, 'r+b').read()
encoded = base64.b64encode(video)
HTML(data='''<video alt="test" controls>
<source src="data:video/mp4;base64,{0}" type="video/mp4" />
</video>'''.format(encoded.decode('ascii')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment