×

Discussion Board

Results 1 to 15 of 18

Hybrid View

  1. #1
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    [Split]record a video of the filtered camera source

    Hi, would be great if you could provide a sample project of how recording a filtered preview works.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    526

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    Are you trying to record that as a video or for separate frames as images?

  3. #3
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    I am trying to record a video of the filtered camera source.

  4. #4
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    You can check this out:

    https://github.com/limefrogyank/Medi...reNokiaEffects

    The recording settings have to be adjusted for your particular device. They are not agnostic yet.

  5. #5
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    How does one add a project to the Code Samples section on Nokia's developer site?

  6. #6
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    I realized there were some missing files in my repository. (First time I've ever used GitHub.) Anyways, I think they are good now.

  7. #7
    Nokia Developer Administrator
    Join Date
    Dec 2013
    Posts
    308

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    Quote Originally Posted by leemcpherson View Post
    How does one add a project to the Code Samples section on Nokia's developer site?
    Hi Lee,

    I've just forked your project into the Nokia Developer Community Project. Was that what you meant?

    Great project by the way. A lot of people around here were really excited to see this. People have been asking for something like this for a long time.

    Jen
    How can I help?

    jennifer.jobart@microsoft.com

  8. #8
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    Hi Lee, thanks for your work on getting filters to record via MFT, it works great. For my app I want to use the ChromaKey filter but it seems to have no effect to the video when enabled, I am assuming the alpha channel is being ignored? Any ideas? thanks again.

  9. #9
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    I'm pretty sure these video formats (NV12 and YUY2) don't have alpha channels. They use a luminance byte and two or more color bytes (or other ratios) in order to construct an image. It's not RGB and it's definitely not RGBA.
    So you can't just expect the output to have a transparent section for a xaml control underneath to show through.

    What you'll need to do is use the Blend Filter in combination with the ChromaKeyFilter. You run the Chromakey filter on the input video and then blend that layer on top of a custom background that you provide as another IImageConsumer. My current setup using the IPropertySet is not going to be able to handle this, so you'll need to add to it somehow so that you can put in a custom background for the BlendFilter to render on top of. It's all got to be done inside of the C++ component.

  10. #10
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    Hi, I have made a start and got it working with a test ColorImageSource for the background, I am now trying to figure out how to pass a StorageFileImageSource from the C# side over to the C++? Cheers.

  11. #11
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: Windows Phone 8.1 Windows.Media.Capture API and Preview Frames

    Hi, I could setup remote debug to my Surface? so you can have a look, it is the preview that seems to have issues, if I save out the preview source to a bmp it has the correct camera image but unfiltered, I also implemented lowlag recording but that does not make much difference.
    The preview just does not update with the camera feed, I can get it to record and it records the camera correctly but with no filters...? Thanks

  12. #12
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: [Split]record a video of the filtered camera source

    Hi, I have just tried the sample code on a Surface RT tablet and the camera preview seems to just loop over the first few frames and not update live from the camera? Anyone have any ideas? I have tried it with no filters applied and its still the same, also with the device front and back camera. Thanks.

  13. #13
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: [Split]record a video of the filtered camera source

    Can you try a different resolution? I've never run into a problem with the preview, but sometimes some of the recording modes just did not work. They would run as if something was happening but the file generated would be unreadable. Maybe the preview mode is doing something similar. I was not able to test this on an RT tablet, but since it worked on a phone, I assumed it would be ok.

  14. #14
    Registered User
    Join Date
    Jun 2014
    Posts
    8

    Re: [Split]record a video of the filtered camera source

    Hi, I have tried the resolution at the lowest supported (640x360) and it makes no difference?, with a filter enabled the preview flashes between frames from the camera feed... Not sure what else it could be, also just to note the Surface RTcamera format is YUY2. Thanks.

  15. #15
    Regular Contributor
    Join Date
    Oct 2013
    Location
    Pennsauken, NJ, USA
    Posts
    121

    Re: [Split]record a video of the filtered camera source

    I wish I could test it myself and step through the code... but I don't have a Surface tablet at all. If you'd like to send one to me...?

    Another thing I thought of: when I crashed the app on my Lumia, the phone wouldn't behave properly until I performed a device reset. It really messes up the device. It might be worth it to do a full reset on your Surface and then try the app using the lowest resolution from the beginning... (hardcode it so it defaults to the lowest). You could also reduce the canvas size so that the video doesn't take up the entire screen.

    Other than that, I couldn't say what is happening for sure. The phones use a "Low-Latency" recording mode for normal video recording. I haven't been able to find out exactly what that is, but I'm guessing there's a special piece of hardware that bypasses the regular CPU and converts the camera video to the right format and dumps it onto your file system. If you use a filter, it suddenly has to process all the video using the CPU and is MUCH slower. Perhaps the Surface can't even handle video at 640x360 without using the low-latency mode...

Similar Threads

  1. Replies: 6
    Last Post: 2010-04-03, 10:49
  2. How to use CMMFDevVideoRecord to record video from camera?
    By Romeo1978 in forum Symbian Media (Closed)
    Replies: 8
    Last Post: 2010-02-01, 07:57
  3. [split] Video over GSM (was: Re: retrieve GSM cell id )
    By abdelbakiguesmi in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2009-03-06, 08:48
  4. How can we record video from Camera using J2ME?Can we do it?
    By aditya.binju in forum Mobile Java General
    Replies: 4
    Last Post: 2006-07-28, 08:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×