VideoRecorder¶
A VideoRecorder allows you to record any stream object, e.g. from:
[1]:
from ipywebrtc import VideoStream, VideoRecorder
[2]:
video = VideoStream.from_url('./Big.Buck.Bunny.mp4')
[3]:
video
[4]:
recorder = VideoRecorder(stream=video)
recorder
[ ]:
video.playing = False
[ ]:
recorder.video
Use ‘record’ button for recording. Programatical control is available using the MediaRecorder.record trait.
[ ]:
recorder.recording = True
[ ]:
recorder.recording = False
Saving can be done by clicking the download button, or programmatically using the save method. If autosave is True, the recording will be saved directly to disk.
[ ]:
recorder.save('example.webm')
[ ]:
from ipywidgets import Video
example = Video.from_file('example.webm')
example