Answered VideoEncodingProperties.Subtype cannot be set to "MPEG2"

  • Saturday, March 31, 2012 2:57 AM
     
     

    I've been working on getting MediaTranscoder running in my code, and I've found that when assigning MediaEncodingProperties.Video.Subtype, "MPEG2" doesn't seem to work. "H264", "WMP3", and "WVC1" all work correctly, but "MPEG2" throws an ArgumentException. It looks to be supported in the API reference, but for some reason isn't working for me.

    On a related note, Audio.Subtype doesn't seem to like "AC3" or "MPEG". Not as big of a deal for me, AC3 would save a bit of space, but PCM will work just fine functionally. Unfortunately, MPEG-2 is a must-have. Is this a known issue, and if so, is there a timeframe for working MPEG-2 support in Windows 8?



    No matter where you go, there you are.

All Replies

  • Tuesday, April 03, 2012 4:22 PM
    Moderator
     
     
    Hi Matthew - I'm waiting for our Media guru to get back from vacation tomorrow.  He'll be able to talk intelligently about this.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator


  • Wednesday, April 04, 2012 4:19 AM
     
     
    Thank you, that would be great! It's been a frustrating few days looking for alternatives and finding none...

    No matter where you go, there you are.

  • Friday, April 06, 2012 11:58 PM
    Moderator
     
     Answered

    Hello again Matthew :)

    In the CP we only support a few Media Encoding profiles.

    They are: M4a (AAC), Mp3 (MPEG-1 layer 3), Mp4 (H.264), WMA (Windows Media Audio), WMV (Windows Media Video)

    AFAIK no other profiles are supported in the CP and unfortunatley I can't comment about furture support for additional profiles.

    MediaEncodingProfile class
    http://msdn.microsoft.com/en-us/library/windows/apps/windows.media.mediaproperties.mediaencodingprofile.aspx

    I hope this helps,

    James


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

  • Sunday, April 08, 2012 5:30 AM
     
     

    Well, not really :-(

    As you know, developing for Metro hamstrings me quite severely, the subset of .NET that I get is usually (so far, not one of 5-6 tested) not enough to get libraries written for older versions of the framework to run, and P/Invoke has been gutted to the point that it can't really do anything interesting any more. Is MPEG-2 supported in Media Foundation at all? I'm not a VC++ developer, but I guess if writing a VC++ wrapper as a Metro library gets me there I'll have to learn.

    What about AC3 and MPEG audio? Same story?


    No matter where you go, there you are.

  • Tuesday, April 10, 2012 11:07 PM
    Moderator
     
     

    Matthew,

    M4a (AAC), Mp3 (MPEG-1 layer 3), Mp4 (H.264), WMA (Windows Media Audio) and WMV (Windows Media Video) are all we are going to get out of the box. At this time we hope that these formats will allow the technology to reach 85% - 95% of our current development community. We understand that there will be a number of developers on the fringe that will need additonal support. Because of this we have made concerted effort to make sure the media platform is open enough to allow developers to continue to innovate using technologies that are not supported out of the box.

    IANAL, keep in mind that encoding files using any of the MPEG technologies may require additional licensing directly from MPEG. You may want to consult with your legal council concerning this. 

    PS If you are manipulating media samples directly in any way you need to move to C++ CX. Manipulating individual media samples from a managed environment is not going to be supported. If you don't fully understand why digital audio and video can't be handled from a managed environment please check out the link from my blog below.

    http://blogs.msdn.com/b/mediasdkstuff/archive/2009/04/01/calling-the-format-sdk-directshow-media-foundation-or-the-wasapi-from-managed-code-c-vb-net.aspx

    James


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

  • Wednesday, April 11, 2012 6:10 AM
     
     

    James, my nemesis. We meet again, for the first time, for the last time ;-]

    I'm not looking to manipulate video, just want to feed Media Foundation a stream and get MPEG-2 out. I'll start cracking the C++ books; hopefully it won't be too bad, I really only need basic transcode functionality. Bitrate, codec, mux, nothing else.


    No matter where you go, there you are.