locked
How to decode an AVC/H.264 using Media Foundation? RRS feed

  • Question

  • I'm trying to find a code example/tutorial that demonstrates how to use MF(Media foundation) to decode H.264 video. However there are just a few examples out there that are not very descriptive. Trying to follow whats provided in the "H.264 Video Decoder" topic within Microsoft was not very informative. Is there any links/example that can help?

    --Edit Platform: Windows 7

    • Edited by 2ouger Tuesday, July 20, 2010 4:38 PM operating system
    Tuesday, July 20, 2010 4:36 PM

Answers

  • There aren't a lot of MF examples since it is fairly new technology.  Check the MF blog for some samples (see top post in the forum).  I don't think there is a native AVCHD parser for MF (not sure what your file format is).  Here is a post with some sample transcode (decode / encode):

        http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/419de14a-f08b-46cc-be47-051a2078f5cc

    Here are the supported file formats:

     

    File Containers

    Format File Extensions Media Source Media Sink Requires
    3GP .3g2, .3gp, .3gp2, .3gpp MPEG-4 File Source 3GP File Sink Windows 7
    Advanced Streaming Format (ASF) .asf, .wma, .wmv ASF File Source ASF File Sink Windows Vista
    Audio Data Transport Stream (ADTS). .aac, .adts ADTS File Source None Windows 7
    AVI .avi AVI File Source None Windows 7
    MP3 .mp3 MP3 File Source MP3 File Sink

    File source: Windows Vista

    File sink: Windows 7

    MPEG-4 .m4a, .m4v, .mov, .mp4 MPEG-4 File Source MPEG-4 File Sink Windows 7
    Synchronized Accessible Media Interchange (SAMI) .sami, .smi SAMI Media Source None Windows Vista
    WAVE .wav AVI File Source None Windows 7

     

     


    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Tuesday, July 20, 2010 9:06 PM

All replies

  • There aren't a lot of MF examples since it is fairly new technology.  Check the MF blog for some samples (see top post in the forum).  I don't think there is a native AVCHD parser for MF (not sure what your file format is).  Here is a post with some sample transcode (decode / encode):

        http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/419de14a-f08b-46cc-be47-051a2078f5cc

    Here are the supported file formats:

     

    File Containers

    Format File Extensions Media Source Media Sink Requires
    3GP .3g2, .3gp, .3gp2, .3gpp MPEG-4 File Source 3GP File Sink Windows 7
    Advanced Streaming Format (ASF) .asf, .wma, .wmv ASF File Source ASF File Sink Windows Vista
    Audio Data Transport Stream (ADTS). .aac, .adts ADTS File Source None Windows 7
    AVI .avi AVI File Source None Windows 7
    MP3 .mp3 MP3 File Source MP3 File Sink

    File source: Windows Vista

    File sink: Windows 7

    MPEG-4 .m4a, .m4v, .mov, .mp4 MPEG-4 File Source MPEG-4 File Sink Windows 7
    Synchronized Accessible Media Interchange (SAMI) .sami, .smi SAMI Media Source None Windows Vista
    WAVE .wav AVI File Source None Windows 7

     

     


    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Tuesday, July 20, 2010 9:06 PM
  • AVCHD with MF is not possible at this point. AVCHD requires licensing that's controlled by a japanese company. They used to have a site for faxing an application form to obtain franchise rights for AVCHD commercial usage of the format and logo at www.avchd.org but their site is being worked on at the moment. Only WMP can natively playback AVCHD at this point but developer decoders aren't available. From what I remember based on the material on their original site, the video is H.264 Annex B and the audio is AC3.

    If you're trying to decode AVCHD off a HDD based Sony Camcorder, you don't have many options but to use their utility to convert from MTS(AVCHD) to M2TS(MPEG2). There are two or three commercial conversion tools available for AVCHD at a cost which allow you to transcode to any format supported by that tool.

    Wednesday, July 21, 2010 1:55 AM