VideoRecorder

A VideoRecorder allows you to record any stream object, e.g. from:

In [1]:
from ipywebrtc import VideoStream, VideoRecorder
In [2]:
video = VideoStream.from_url('./Big.Buck.Bunny.mp4')
In [3]:
video
In [4]:
recorder = VideoRecorder(stream=video)
recorder
In [ ]:
video.playing = False
In [ ]:
recorder.video

Use ‘record’ button for recording. Programatical control is available using the MediaRecorder.record trait.

In [ ]:
recorder.recording = True
In [ ]:
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.

In [ ]:
recorder.save('example.webm')
In [ ]:
from ipywidgets import Video

example = Video.from_file('example.webm')
example