I have made programs for my windows phone that displays the camera feed on the screen. I have also sent/received data using the Sockets namespace. Is it possible to “combine” these to create a live video feed from the camera that can be connected to by a computer on my LAN?
Share
Well, this is a very interesting question. In fact, it normally should be possible to create a live stream – but – and this is the “hard” point: You have to do it on your own, so you have to care about everything you need for a real live stream.
In detail, it’s not very complicate to realise a kind of live-stream. Think about what you need:
1a) Image-Source (normally of course the cam)
1b) kind of Image-Copier
2) Streaming-Server
3) Streaming-Client
So if we talk about Windows Phone, you have many .NET classes available who are doing some work for you. For a good start you should consider the following reference:
http://msdn.microsoft.com/en-us/library/ff637518%28VS.92%29.aspx
If we go more into detail, you have to perform the following tasks:
1) Get your camera image ready
2) Copy the content of your video-brush/canvas ui-element into a stream
3) write the stream to a temp file
4) upload the temp-file over the server to the clients
5) go into a loop and start over by 3.
The big think in this case is, to get the video-brush copy done, so for this have a look at the connnected msdn reference for the video-brush
http://msdn.microsoft.com/en-us/library/cc189009%28VS.95%29.aspx
To have a good starting point for copying the content of the video-brush into a stream consider this document
http://msdn.microsoft.com/en-us/library/bb404773.aspx#anchor_videobrush_relationship
by using the media element as a host for the “live-pictures”.
Another, better, but of course, more complicated way is to implement your own version of the video brush. Read this article to learn how to copy the preview-camera buffer
http://msdn.microsoft.com/en-us/library/microsoft.devices.photocamera.getpreviewbufferycbcr%28VS.92%29.aspx
So, i hope, i was able to give you an idea, how to implement your solution.
p.s.:
If you are able to speak german, I’ve kind of book recommendation for you:
http://amzn.to/wxfEzd
I’m the author of this book 😉