locked
How to apply effect to MediaCapture

    Question

  • 1. I try to add effect to MediCapture but it doesn't work. Here is my code:

    mediaCaptureMgr = new Windows.Media.Capture.MediaCapture();

    mediaCaptureMgr.initializeAsync(captureInitSettings).then(function (result) {

     var effect = new Windows.Foundation.Collections.PropertySet();

     effect["effect"] = "Fisheye";

     mediaCaptureMgr.addEffectAsync(

    Windows.Media.Capture.MediaStreamType.videoPreview,

    "Microsoft.Samples.PolarEffect", 

    effect

      );

    video = id("previewVideo" + sdkSample.scenarioId);

    video.src = URL.createObjectURL(mediaCaptureMgr, false);

    video.play();

    }, errorHandler);

     

    I have add PolarTransform.dll info to the package.appxmanifest file.

     

    2. If I apply the effect to MediaCapture successfully, when I capture a photo or a video using this MediaCapture, will the photo/video has the effect applied to the MediaCapture?

    I tried to add effect to the video control associate with the MediaCapture. The preview can have that effect, but when I capture a photo or a video, the photo/video doesn't have that effect.

     

    Thanks


    • Edited by yiling.yin Thursday, December 22, 2011 9:13 AM
    Thursday, December 22, 2011 9:07 AM

Answers

  • Hello Yiling,

    The behavior you are seeing is expected. Accoridng to your code you are only adding the effect to the preview channel. If you want to capture the effect you must add it to the capture channel. In your call to the “AddEffectAsync” method change the “MediaStreamType” to “VideoRecord”. 

    I hope this helps,

    James

    Windows Media SDK Technologies
    Microsoft Developer Services
    http://blogs.msdn.com/mediasdkstuff/

    Friday, December 30, 2011 11:35 PM
    Moderator

All replies

  • 1. I try to add effect to MediCapture but it doesn't work. Here is my code:

    mediaCaptureMgr = new Windows.Media.Capture.MediaCapture();

    mediaCaptureMgr.initializeAsync(captureInitSettings).then(function (result) {

     var effect = new Windows.Foundation.Collections.PropertySet();

     effect["effect"] = "Fisheye";

     mediaCaptureMgr.addEffectAsync(

    Windows.Media.Capture.MediaStreamType.videoPreview,

    "Microsoft.Samples.PolarEffect", 

    effect

       );

    video = id("previewVideo" + sdkSample.scenarioId);

    video.src = URL.createObjectURL(mediaCaptureMgr, false);

    video.play();

    }, errorHandler);

     

    I have add PolarTransform.dll info to the package.appxmanifest file.

     

    2. If I apply the effect to MediaCapture successfully, when I capture a photo or a video using this MediaCapture, will the photo/video has the effect applied to the MediaCapture?

    I tried to add effect to the video control associate with the MediaCapture. The preview can have that effect, but when I capture a photo or a video, the photo/video doesn't have that effect.

     

    Thanks

    • Merged by Bob_Bao Friday, December 23, 2011 9:41 AM duplicate
    Friday, December 23, 2011 3:01 AM
  • Hello Yiling,

    The behavior you are seeing is expected. Accoridng to your code you are only adding the effect to the preview channel. If you want to capture the effect you must add it to the capture channel. In your call to the “AddEffectAsync” method change the “MediaStreamType” to “VideoRecord”. 

    I hope this helps,

    James

    Windows Media SDK Technologies
    Microsoft Developer Services
    http://blogs.msdn.com/mediasdkstuff/

    Friday, December 30, 2011 11:35 PM
    Moderator