简体   繁体   中英

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. 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.

And I found there is no resources about it on Internet(I am surprised!!!)!

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.

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) . 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). 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.

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).

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).

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. 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.

Is it 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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