1

I'm trying to build an application with WPF, application basically needs to get the video from your webcam and stream it (this part is much like Skype, and I've already done this part) but the tricky part is I want users to be able to play with their video streams. Like they should be able to draw a mustache (mustache is just an example, it can be anything.. like a virtual white board) and the client on the otherside should be able to see it, and also if possible manipulate it.

I know it could probably be more easier with silverlight but WPF is a must. I would greatly appreciate any help! Please show me a way.. Thanks.

Here is the code i use to gather the stream if it helps you in anyway, but i'm open to anything, any change;

_job = new LiveJob();
EncoderDevice videoDev = null;
foreach (EncoderDevice ved in EncoderDevices.FindDevices(EncoderDeviceType.Video))
    if (ved.Name == VideoDevices.SelectedItem.ToString())
        videoDev = ved;

EncoderDevice audioDev = null;
foreach (EncoderDevice aed in EncoderDevices.FindDevices(EncoderDeviceType.Audio))
    if (aed.Name == AudioDevices.SelectedItem.ToString())
        audioDev = aed;
LiveDeviceSource deviceSource = _job.AddDeviceSource(videoDev, audioDev);

_job.ActivateSource(deviceSource);

PullBroadcastPublishFormat outputFormat = new PullBroadcastPublishFormat();
outputFormat.BroadcastPort = 8080;
_job.PublishFormats.Add(outputFormat);

_job.StartEncoding();
umutto
  • 7,460
  • 4
  • 43
  • 53
  • 1
    When you say the client can manipulate it, do you mean 'move the moustache' (i.e. it's treated as a distinct object, separate to the video feed), or do you just mean that you want them to be able to draw too? – George Duckett Aug 31 '11 at 07:32
  • Thanks for the reply! I want both to be active on the whiteboard thingy, so they should be able to draw. But your answer seems fulfilling enough and made me change my thoughts after hearing that from someone else. – umutto Aug 31 '11 at 07:41

1 Answers1

1

My suggestion is build a set of paint/manipulation commands, have those send down the wire separately to the video, and reconstruct it the other end, overlaying the results. This would allow for easy 2-way interaction as they'd both be sending their changes separately, they could easily 'undo' actions, perform non-bitmap manipulations etc.

Such commands could be; Draw a bezier curve along these points with this brush, apply a warp transform here, with these parameters, draw a circle here, summon the moustache here etc.

George Duckett
  • 31,770
  • 9
  • 95
  • 162
  • Thanks for the answer! I was considering doing the same thing, but wrapping them all in the same stream seemed like another choice, and couldn't decide. But thinking now the redo, undo possibilities that seems more logical. – umutto Aug 31 '11 at 07:39