开发者

Is there a way to edit the video received from webcam via Expression Encoder SDK before streaming?

开发者 https://www.devze.com 2023-04-01 09:14 出处:网络
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 trick

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 help开发者_如何学Cs 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();


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号