简体   繁体   English

SilverLight:如何从网络摄像机录制视频

[英]SilverLight: How to record a video from a web camera

I have searched how to use SILVERLIGHT to record video for days but got no luck. 我已经搜索了如何使用SILVERLIGHT录制视频几天,但没有运气。 Most articles related to SL only talk about how to record audio or snap a picture rather than recording a video file and save it somewhere. 与SL有关的大多数文章都只谈论如何录制音频或捕捉图片,而不是录制视频文件并将其保存在某处。

And I found there is no resources about it on Internet(I am surprised!!!)! 而且我发现Internet上没有相关资源(我很惊讶!!!)!

So could you provide me an example code with proper explanation? 因此,您能否提供示例代码并提供适当说明?

I am waiting for it. 我在等

PS: I do not want to use Flesh as none iPhone nor iPAD supports it. PS:我不想使用Flesh,因为iPhone和iPAD都不支持它。

Thanks 谢谢

Fortunately, Mike Taulty's source code can easily be updated to work with Silverlight 5. You can download the fixed source code and try it out ( Disclaimer: all code courtesy to Mike Taulty, I merely fixed SL5 compatability and ran a cleanup) . 幸运的是,可以轻松地更新Mike Taulty的源代码以使其与Silverlight 5一起使用。您可以下载固定的源代码并进行尝试免责声明:所有代码均由Mike Taulty提供,我只是固定了SL5兼容性并进行了清理) Use your favorite diff tool to see the changes I made. 使用您喜欢的差异工具来查看我所做的更改。

I have tested it, and it generates video files that can be viewed in VLC media player (after selecting build index to fix the corrupted index). 我已经对其进行了测试,它会生成可在VLC媒体播放器中查看的视频文件(在选择了构建索引以修复损坏的索引之后)。 As the file format is not 100% correct, the files can not be opened in Windows Media Player etc... but I'm sure that can be fixed. 由于文件格式不是100%正确,因此无法在Windows Media Player等中打开文件...但是我确定可以将其修复。

You should, however, be aware of the fact that Silverlight is not supported on iPhone, iPad, Android, and Windows Phone (Windows Phone apps are made on a special version of Silverlight, but can not run Silverlight applications in the browser). 但是,您应该意识到iPhone,iPad,Android和Windows Phone 支持Silverlight的事实(Windows Phone 应用程序是在Silverlight的特殊版本上制作的,但是无法在浏览器中运行Silverlight应用程序)。

Unfortunately, after undergoing hundreds of hours researching on the possible solution, I finally found the answer in a book called: Pro Silverlight 4 in C# (Matthew MacDonale, APress). 不幸的是,在研究了数百种可能的解决方案之后,我终于在一本书中找到了答案:C#中的Pro Silverlight 4(Matthew MacDonale,APress)。

According what is said on the page 436, although you can do it with Silverlight 4 (you have to write your own file header helper, store the row data as byte arrays and later on you have to convert them into a raw video data and what is worse is the audio and video are separated.), it is just not practical and worthy to do it. 根据第436页上的说法,尽管您可以使用Silverlight 4做到这一点(您必须编写自己的文件头帮助程序,将行数据存储为字节数组,然后再将其转换为原始视频数据,以及更糟糕的是,音频和视频是分开的。)这是不切实际的,值得这样做。 Because it requires reams of complex, handwritten code to convert it, and the conversion process is computationally expensive, which makes it extremely difficult to do in real time. 因为要转换它需要大量复杂的手写代码,并且转换过程在计算上是昂贵的,这使得实时实时处理变得极为困难。

So I guess this would be the conclusion of my question. 所以我想这将是我的问题的结论。 Now what seems still make sense for me is to find out why Microsoft doesn't support it and what is the new technology which is going to be used/ has been used to replace the SL. 现在,对我来说似乎仍然有意义的是,找出Microsoft不支持它的原因,以及将要使用的/已经用来替代SL的新技术是什么。

Is it HTML5? 是HTML5吗? But as far as I know, there is only a video tag in HTML which can only be used as a video player, but no tag to support to get the access of a web camera and save the captured video+audio at the same time as one file onto somewhere which could be a local hard drive or a network storage. 但据我所知,HTML中只有一个视频标签只能用作视频播放器,但没有标签支持同时访问网络摄像机并保存捕获的视频和音频。将一个文件放到可能是本地硬盘驱动器或网络存储的位置。

I hope all dear you could come up with some thoughtful advice. 希望亲爱的大家能提出一些周到的建议。

I am going to leave this question un-answered for a few days to see whether there could be someone who can come up with some fantastic solution. 我将在几天之内不回答这个问题,以查看是否有人可以提出一些出色的解决方案。

Thanks again. 再次感谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM