是否可以将 2 个 webm 视频流合并为一个流(图中) [英] Is it possible to merge 2 webm video streams into one stream (in picture)

查看:80
本文介绍了是否可以将 2 个 webm 视频流合并为一个流(图中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以录制 2 个 webm 视频(使用 WebRTC),然后将它们合并为一个流(画中画).

示例:

<块引用>

记录 A 显示摄像机 A(流出)

记录 B 显示摄像机 B(流出)

流 A 显示一帧 A+B 作为合并流(两个人之间的采访)

解决方案

是的,它是通过使用 媒体录制 API.

首先,您必须创建一个 ,您将在其中绘制两个 元素.创建 MediaRecorder 时,您将传递画布流:new MediaRecorder(canvas.captureStream()).

在超时/间隔中,您将在画布中绘制两个视频:canvas.getContext("2d").drawImage(video, 0, 0, width, height);.>

Is it possible to record 2 webm videos (with WebRTC) and then merge them into one stream (picture in picture).

Example:

recording A shows camera A (streams out)

recording B shows camera B (streams out)

stream A shows one frame with A+B as merged stream (interview between two people)

解决方案

Yes, it is by using the Media Recording API.

First you have to create a <canvas> where you will draw the two <video> elements. When creating the MediaRecorder you will pass the canvas stream: new MediaRecorder(canvas.captureStream()).

In a timeout/interval you will draw the two videos in the canvas: canvas.getContext("2d").drawImage(video, 0, 0, width, height);.

这篇关于是否可以将 2 个 webm 视频流合并为一个流(图中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆