none
Problem play program in TS file when using Mpeg2 Demultiplex RRS feed

  • Question

  • Dear all,

    I have a TS file, I can play ts file using mpeg Demultiplexer, but In the TS file have a lot programs, but I can play the first program, I want to play any program in TS file. This is MpegDemultiplexer code that I use

    ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
    mt.majortype=MEDIATYPE_Video;
    mt.subtype=MEDIASUBTYPE_MPEG2_VIDEO;

    hr=CoCreateInstance(CLSID_MPEG2Demultiplexer, 0, CLSCTX_INPROC_SERVER, IID_IMpeg2Demultiplexer, (void**)&m_pDemux);
    if(FAILED(hr))
    goto done;

    if(SUCCEEDED(hr))
    {
    hr=m_pDemux->CreateOutputPin(&mt, L"Video Pin", &m_pPin0);
    if(FAILED(hr))
    goto done;
    }
    hr=m_pPin0->QueryInterface(IID_PPV_ARGS(&m_pPidMap));
    if(FAILED(hr))
    goto done;
    if(SUCCEEDED(hr))
    {
    ULONG Pid=0x031;
    hr=m_pPidMap->MapPID(1, &Pid, MEDIA_ELEMENTARY_STREAM);
    m_pPidMap->Release();
    }

    what will I do cont?

    Thanks All,

    Thursday, August 14, 2014 9:54 AM