astro-blendDEV / hasher.py
Moibe
Display image as result too
e756b69
raw
history blame
383 Bytes
import base64
import io
import os
def convert_video_to_base64(filename):
with open(filename, "rb") as f:
video_bytes = f.read()
base64_string = base64.b64encode(video_bytes)
return base64_string.decode("utf-8")
if __name__ == "__main__":
filename = "result.mp4"
base64_string = convert_video_to_base64(filename)
print(base64_string)