使用来自网络摄像头的HTML输入类型文件捕获便携式摄像机录制视频 [英] Record video with HTML input type file capture camcorder from webcam

查看:69
本文介绍了使用来自网络摄像头的HTML输入类型文件捕获便携式摄像机录制视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的公司中,我的任务是建立一个网站,用户可以在其中录制视频,将被发送到服务器,将完成一些工作,并且用户最终会收到一封电子邮件,其中包含嵌入了该视频的微型网站的链接.

经过研究,我得出的结论是,至少在目前,这是不可能的,在iPad上使用getUserMedia捕获视频.

所以解决方案非常简单,我只使用带有accept ="video/*; capture = camcorder"的输入元素.

 <输入类型="file" accept ="video/*; capture = camcorder"> 

到目前为止,太好了.正如我在

这就是为什么在台式机上使用Flash视频录制客户端+媒体服务器是唯一可以在浏览器和平台之间正常工作的解决方案的原因.

还有一些商业解决方案,包括 HDFVR (HTML Media Capture + Flash)和

<input type="file" accept="video/*;capture=camcorder">

So far, so good. As I've read on this page, that it is also possible to capture a video from webcam with this technique, i thought that it is an adequat cross-browser solution.

But after some testing, i can just select an already recorded video on desktop browsers.

Did I misinterprete that article? Or am I just doing it wrong?

Cheers, Mohammer

解决方案

In short you ended up using HTML Media Capture Standard which works by overloading the <input type="file"> element and adding new values for the accept parameter.

The great thing about it is that it works great on most mobile browsers (except for recording only the mic on iOS). Support is implemented at least in:

  • Safari and Chrome on iOS 6+
  • Internet and Chrome on Android 3+

Which pretty much covers anyone, however, depending on the device, you will end up with .mp4 (Android), .mov (iOS) and .3gp files.

The not so great thing about it is that it defaults to a plain old file selector when used on a desktop OS instead of opening Photo Booth for example.

Surprisingly the standard's draft included an image of how video capturing through some sort of Photo Booth app would look on a desktop:

Which is why on the desktop a Flash video recording client + media server is the only solution that works well across browsers and platforms.

There are also commercial solutions including HDFVR (HTML Media Capture + Flash) and Pipe which does a lot more including the conversion to .mp4, pushing to your S3/FTP and webhooks.

这篇关于使用来自网络摄像头的HTML输入类型文件捕获便携式摄像机录制视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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