Hi, I have coded a function which will create a video in realtime using moviepy… I want to show it using streamlit with out saving the video … As saving the video will take time … I am not able to do that as I am not able to use moviepy videofile clip in stream lit … Can anyone please help or guide me …
I am getting this error if I directly play the video
RuntimeError: Invalid binary data format: <class ‘moviepy.video.VideoClip.VideoClip’>
and this error if I convert to bytes.io
TypeError: expected str, bytes or os.PathLike object, not BytesIO (I am getting this error when I am trying to convert to bytesio … )
Here is my code
video_clip=video_clip.resize(DISPLAY)
fps = 24
output_buffer = BytesIO()
video_clip.write_videofile(output_buffer, fps=fps, codec=“libx264”, audio_codec=“aac”)
output_buffer.seek(0)
st.video(output_buffer)
is there any other way to preview the video without saving in streamlit
Thanks in Advance …