Media extensions sample

This sample demonstrates how to use media extensions to apply effects to video, decode video, and create media streams using scheme handlers.

 
 
 
 
 
(8)
20,993 times
Add to favorites
4/2/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Debugging load errors
    1 Posts | Last post January 30, 2015
    • I'm trying to get libmpeg2 to load in Windows Phone, however it is as if the library never gets loaded. I've made my WinPhone port here: https://github.com/dotmorten/libmpeg2-winrt 
      It is based on the WinRT version which works great (on ARM too), and used this sample to compare differences between WinRT and WinPRT project settings. I'm completely at a loss why my DLL won't load. How do I go about discovering why this isn't loading? I don't see anything in the output to indicate any issue (I did add the inProcessServer tag just like I did in my WinRT app).
  • The MPEG1Source sample has major flaws
    2 Posts | Last post December 10, 2014
    • It is supposed to show how to write an Async MF Source. But this filter is not really async. The first thing that is done in DispatchOperation is: It locks the source. The first thing that all public methods on both the source and the streams do: They lock the source. While requests are indeed served from a different thread, nothing in this source filter really runs asynchronously. This also means: If your ReadData() method takes a little longer than usual, all requests are blocked. Even if the SampleQueue of your streams have enough samples queued to serve a request, it is blocked because it tries to lock the Source (which is locked during the whole ReadData call). I have tried to write a decoder filter based on this sample and it starts to stutter as hell as soon as I copy/move some files on my HDD during the playback. Increasing the sample queue size did not help at all – the sample queue is already filled but the samples are not served because the source is locked reading. The whole code needs major rework, including multiple different locks, to allow real async usage and to allow smooth playback even in case of read data delays. This is really bad. I do not understand how this can be shown as a sample of how to implement async filters when it totally breaks all async behavior.
    • The only source that actually reads data in this sample is MPEG-1 source. I do agree that synchronous reading with a lock held is a bad idea but the source reads it asynchronously by issuing BeginRead call on the bytestream. Data is read completely outside the source lock and when it's finished OnByteStreamRead is called.
      Other thing is that there is no ReadData function defined anywhere in any of the extensions, sources or not, so I am not sure which extension you are referring to. If you could please clarify.
  • Change the output frame size
    1 Posts | Last post November 11, 2014
    • Hello, I had learn much about frame modification from this sample, however, now I want to crop or resize the output frame but fail to do that. Could you help me point out how to do it? Thank you.
  • DevCenter Error 2001 code
    2 Posts | Last post September 23, 2014
    • I am able to use this locally on the emulator and work great, but as many have experienced, I get the CrossGen failed error for all the WinRT components referenced (after inspecting MDILXapCompileLog.txt) when deploying to device.
      
      I packaged it up anyways and published a beta, sure enough I get the error 2001 (extra files in Manifest) rejection.
      
      To further isolate the issue to this sample, I created another beta and pushed a clean build of the sample and it fails as well. I inspected the Manifest, but do not see any duplicates.
      
      @venetasoft
      I've been following you guys for a while now and love the app, did you experience this error publishing? How did you overcome it?
    • I fixed the Error 2001 problem in my app, I'm not sure if it's the problem in the example (maybe Marcin can elaborate), but here is what I did:
      
      Instead of several projects to manage my shaders and filters, I kept everything within a single Universal project and thus a single namespace. Even though my component's DLL has a WindowsPhone suffix, the namespace is still the same.
      
      In the app's package.appxmanifest file, I only declare one extension but with all the ActivatibleClasses I have. Additionall my ActivatibleClass Ids are not suffixed.
      
      Hopefully this helps, if you get stuck, hit me up on twitter @lancewmccarthy
      
  • Output As NV 12 Content
    1 Posts | Last post September 12, 2014
    • Hey I want to ouput as NV 12 content is supported by MFT. So can please let me know  how can i achieve that to show a video as NV12 format.
  • why? c++ sample
    2 Posts | Last post August 14, 2014
    • xamltypeinfo.g.cpp(80): error C2039: 'LocalDecoder' : is not a member of 'SDKSample::MediaExtensions'
      xamltypeinfo.g.cpp(80): error C2061: syntax error : identifier 'LocalDecoder'
      xamltypeinfo.g.cpp(92): error C2039: 'LocalSchemeHandler' : is not a member of 'SDKSample::MediaExtensions'
      xamltypeinfo.g.cpp(92): error C2061: syntax error : identifier 'LocalSchemeHandler'
      xamltypeinfo.g.cpp(104): error C2039: 'VideoStabilizationEffect' : is not a member of 'SDKSample::MediaExtensions'
      xamltypeinfo.g.cpp(104): error C2061: syntax error : identifier 'VideoStabilizationEffect'
      xamltypeinfo.g.cpp(116): error C2039: 'CustomEffects' : is not a member of 'SDKSample::MediaExtensions'
      xamltypeinfo.g.cpp(116): error C2061: syntax error : identifier 'CustomEffects'
    • Please update the VS 2013 update 3.
  • Breakpoints in c++ not working
    1 Posts | Last post July 15, 2014
    • Symbols are not loaded for the c++ graystyle project.  Not sure how to fix it...it's in Debug win32.
  • How to debug Media Extension issues on Windows Phone?
    1 Posts | Last post June 05, 2014
    • Hi, I tried creating a trivial IMFTransform/IMediaExtension that just copies input to output. 
      
      I made it accept only MFVideoFormat_ARGB32.
      
      It works as expected when used in MediaElement, but fails when used with MediaComposition (on WP 8.1). I added traces to every call and I can see that ProcessOutput gets called once successfully, producing output, but fails after second call (which returns MF_E_TRANSFORM_NEED_MORE_INPUT) with MF_MEDIA_ENGINE_ERR_DECODE and 0x80004005. I do understand that MF_E_TRANSFORM_NEED_MORE_INPUT is returned normally every second time, but I fail to understand why is it failing with MediaComposition.
      
      How can I find out why this is failing? 
      
      Thanks
  • C#/C++ project WP8.1 device ARM deployment error
    2 Posts | Last post June 04, 2014
    • This sample works fine on the emulator, but when I try to deploy it to my phone, I get an Error DEP0001: Element not found.  This happens with Debug or Release.
    • Apologies, this likely has nothing to do with the solution.  It's now happening to all my solutions.
  • Using with Windows.Media.Editing.MediaComposition
    1 Posts | Last post June 03, 2014
    • Hi,
      
      I'm trying to run InvertTransform from the sample by adding it to MediaComposition on Windows Phone 8:
      
      var composition = new MediaComposition();
      var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///videos/test.mp4"));
      var clip = await MediaClip.CreateFromFileAsync(file);
      clip.VideoEffectDefinitions.Add(new VideoEffectDefinition("InvertTransform.InvertEffect"));
      composition.Clips.Add(clip);
      
      This fails, probably because video subtype is MFVideoFormat_NV12 while effect is handling only MFVideoFormat_ARGB32.
      
      How can invert transform be used in this scenario? Does it have to be changed to support MFVideoFormat_NV12 and how best to accomplish this?
      
      Thanks you,
      Ivan
1 - 10 of 21 Items