This example uses the canvas.captureStream method to capture the video from a video element. The audio is captured using the Web Audio API and combined with the video stream to create a MediaStream.

Press start if the video does not play automatically:

Input video

Sound plays to the default audio output

MediaStream output