Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:29:44+00:00 2026-06-17T07:29:44+00:00

I am trying to decode h264 video from my camera I have configured the

  • 0

I am trying to decode h264 video from my camera I have configured the decoder as follows.
I am not able to figure out why GetOutputAvailableType() function returns MF_E_TRANSFORM_TYPE_NOT_SET.I have also noticed that GetStreamIDs() returns E_NOTIMPL. I have checked in msdn it is given “MFT has a fixed number of streams, and \n the stream identifiers are consecutive starting from zero.”.Can some body also explain what does this means?

HRESULT CH264_decodingDlg::ConfugureDecoder(IMFTransform *pDecoder)
{

HRESULT hr = S_OK;
IMFMediaType* pMediaTypeInput = NULL;


//Creating Input Media Type
hr  = MFCreateMediaType(&pMediaTypeInput);
if (FAILED(hr)) return hr;



DWORD dwIn = 0,dwOut = 0;
hr = pDecoder->GetStreamCount(&dwIn,&dwOut);
if (FAILED(hr)) return hr;
if (dwIn)
{
    DWORD dwInputID[2] ={0} ;
    DWORD dwOutputID[2]= {0};

            hr = pDecoder->GetStreamIDs(dwIn,dwInputID,dwOut,dwOutputID);

    //if (FAILED(hr)) return hr;
    GUID guidCurrent;
    GUID guidMajor;
    for (int i = 0; i< 8; i++)
    {

        hr = pDecoder->GetInputAvailableType(0,i,&pMediaTypeInput);
        hr  = pMediaTypeInput->GetGUID(MF_MT_MAJOR_TYPE, &guidMajor);
        if (guidMajor == MFMediaType_Video)    //safety check
        {
            if (hr == MF_E_NO_MORE_TYPES)
            {
                break;
            }

            hr  = pMediaTypeInput->GetGUID( MF_MT_SUBTYPE, &guidCurrent );

            if ( guidCurrent == MFVideoFormat_H264 )        //m_pVideoSubtype = MEDIASUBTYPE_WVC1
            {
                break;
            }
        }
    }
    // Set MF_MT_MAJOR_TYPE
    hr = pMediaTypeInput->SetGUID(MF_MT_MAJOR_TYPE ,MFMediaType_Video);
    if (FAILED(hr)) return hr;

    // Set MF_MT_SUBTYPE
    hr = pMediaTypeInput->SetGUID(MF_MT_SUBTYPE ,MFVideoFormat_H264);
    if (FAILED(hr)) return hr;

    // Set MF_MT_FRAME_RATE
    UINT32 nNumerator = 30;
    UINT32 nDenominator = 1;
    hr  = MFSetAttributeRatio(pMediaTypeInput,MF_MT_FRAME_RATE ,nNumerator,nDenominator);
    if (FAILED(hr)) return hr;

    // Set MF_MT_FRAME_SIZE
    UINT32 nWidth = 640 ;
    UINT32 nHeight = 480;
    hr = MFSetAttributeSize(pMediaTypeInput, MF_MT_FRAME_SIZE, nWidth, nHeight);
    if (FAILED(hr)) return hr;

    // Set MF_MT_MPEG2_PROFILE
    hr = pMediaTypeInput->SetUINT32(MF_MT_MPEG2_PROFILE, eAVEncH264VProfile_Base);
    if (FAILED(hr)) return hr;

    // Set MF_MT_INTERLACE_MODE
    hr = pMediaTypeInput->SetUINT32(MF_MT_INTERLACE_MODE ,MFVideoInterlace_Progressive);
    if (FAILED(hr)) return hr;

    // Set MF_MT_PIXEL_ASPECT_RATIO 
    hr = MFSetAttributeRatio(pMediaTypeInput,MF_MT_PIXEL_ASPECT_RATIO,1,1);
    if (FAILED(hr)) return hr;

    //Set Input Media Type
    hr = pDecoder->SetInputType(0,pMediaTypeInput,MFT_SET_TYPE_TEST_ONLY);
    if (FAILED(hr)) return hr;

    //Creating Output Media Type
    IMFMediaType* pMediaTypeOutput = NULL;
    hr  = MFCreateMediaType(&pMediaTypeOutput);
    if (FAILED(hr)) return hr;

    hr = pDecoder->GetOutputAvailableType(0,0,&pMediaTypeOutput);
    if (FAILED(hr)) return hr;`
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:29:46+00:00Added an answer on June 17, 2026 at 7:29 am

    Before you can get output media type, you have to set input media type. I don’t see you are doing this (SetInputType is called with MFT_SET_TYPE_TEST_ONLY).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I continuously get OutOfMemory exceptions trying to decode an image from camera in my
I have a file that I'm trying to decode but I'm not sure the
I'm trying to put together something to decode a Json string and not having
Im trying to decode a json string returned from flickr within my PHP code.
I have some JSON that I am trying to decode -- it is correctly
I am trying to decode audio samples from various file formats using ffmpeg. Therefore
I am trying to decode the logonHours attribute from Active Directory so that it
I have a video stream with mime type video/h264 that streams live h.264 video
i have been trying to decode an MP3 file to pcm, using ffmpeg API,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.