ipywebrtc is a jupyter interactive widget library which provides video streaming to the Jupyter notebook.
It provides means to capture videos/images/audio from the user camera, or from other widgets like a Video
or an ipyvolume plot.
Installation:
conda install -c conda-forge ipywebrtc
import ipywebrtc as webrtc
import ipyvolume as ipv
import ipywidgets as widgets
video = webrtc.VideoStream.from_file('Big.Buck.Bunny.mp4')
video
camera = webrtc.CameraStream()
camera
fig = ipv.figure(render_continuous=True)
back = ipv.plot_plane("back", texture=video)
right = ipv.plot_plane("right", texture=camera)
ipv.show()
right.texture = fig
room = webrtc.chat(room='scipy2018', stream=fig)
back.texture = room.streams[1]
recorder = webrtc.VideoRecorder(stream=fig, filename='record')
recorder
recorder.video.value[:1000]
room.close()
camera.close()
video.close()