Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 6:38
Mark Salsbery9-Jul-07 6:38 
GeneralRe: losing dimensions in metafile [modified] Pin
Force Code9-Jul-07 6:54
Force Code9-Jul-07 6:54 
QuestionRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 9:19
Mark Salsbery9-Jul-07 9:19 
AnswerRe: losing dimensions in metafile Pin
Force Code9-Jul-07 12:53
Force Code9-Jul-07 12:53 
GeneralRe: losing dimensions in metafile Pin
Mark Salsbery9-Jul-07 16:49
Mark Salsbery9-Jul-07 16:49 
AnswerRe: losing dimensions in metafile Pin
Chris Losinger9-Jul-07 7:06
professionalChris Losinger9-Jul-07 7:06 
GeneralRe: losing dimensions in metafile Pin
Force Code9-Jul-07 7:21
Force Code9-Jul-07 7:21 
Questionconvert mpg to avi in directshow Pin
liur179-Jul-07 4:59
liur179-Jul-07 4:59 
Recently I try to convert mpg file to avi programmly, but it doesn't work , i am a beginnerSmile | :) ,the code list below, anyone can give me suggestion? thanks.

hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
IBaseFilter *pSrcFilter = NULL;
hr = pGraph->AddSourceFilter(lpMpgFile, L"Source Filter", &pSrcFilter);
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC, IID_ICaptureGraphBuilder2, (void **)&pBuilder);
pBuilder->SetFiltergraph(pGraph);
hr = pBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi, lpOutputAviFile, &pMux, NULL);
hr = pGraph->AddFilter(pMux, L"Mux Filter");
IBaseFilter *pMpeg2Splitter= NULL;
hr = CoCreateInstance(CLSID_MPEG2Demultiplexer, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pMpeg2Splitter);
hr = pGraph->AddFilter(pMpeg2Splitter, L"Mpeg2 Splitter");
IMpeg2Demultiplexer *pDemux = NULL;
hr = pMpeg2Splitter->QueryInterface(IID_IMpeg2Demultiplexer, (void**)&pDemux);
AM_MEDIA_TYPE pMediaType;
memset(&pMediaType, 0x0, sizeof(pMediaType));
pMediaType.majortype = MEDIATYPE_Video;
pMediaType.subtype = MEDIASUBTYPE_MPEG2_VIDEO;
pMediaType.formattype = FORMAT_MPEG2Video;
pMediaType.bFixedSizeSamples = FALSE;
pMediaType.bTemporalCompression = TRUE;
pMediaType.lSampleSize = 0;
MPEG2VIDEOINFO video_info;
memset(&video_info, 0x0, sizeof(MPEG2VIDEOINFO));
pMediaType.cbFormat = sizeof(MPEG2VIDEOINFO);
pMediaType.pbFormat = (BYTE *)&video_info;

AM_MEDIA_TYPE pMediaAudioType;
memset(&pMediaAudioType, 0x0, sizeof(pMediaAudioType));
pMediaAudioType.majortype = MEDIATYPE_Audio;
pMediaAudioType.subtype = MEDIASUBTYPE_MPEG1Payload;
pMediaAudioType.formattype = FORMAT_WaveFormatEx;
pMediaAudioType.bFixedSizeSamples = FALSE;
pMediaAudioType.bTemporalCompression = FALSE;
pMediaAudioType.lSampleSize = 0;
MPEG1WAVEFORMAT audio_info;
memset(&audio_info, 0x0, sizeof(MPEG1WAVEFORMAT));
pMediaAudioType.cbFormat = sizeof(MPEG1WAVEFORMAT);
pMediaAudioType.pbFormat = (BYTE *)&audio_info;

IPin *pPin0 = NULL;
hr = pDemux->CreateOutputPin(&pMediaType, L"Video Output", &pPin0);
IMPEG2StreamIdMap *pStreamIdMap = NULL;
hr = pPin0->QueryInterface(IID_IMPEG2StreamIdMap, (void **)&pStreamIdMap);
hr = pStreamIdMap->MapStreamId(0xC0, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0, 0);
IPin *pPin1 = NULL;
hr = pDemux->CreateOutputPin(&pMediaAudioType, L"Audio Output", &pPin1);
IMPEG2StreamIdMap *pStreamIdMap1 = NULL;
hr = pPin1->QueryInterface(IID_IMPEG2StreamIdMap, (void **)&pStreamIdMap1);
hr = pStreamIdMap1->MapStreamId(0xE0, MPEG2_PROGRAM_ELEMENTARY_STREAM, 0, 0);

//error occurs in below code
hr = pBuilder->RenderStream(NULL, NULL, pSrcFilter, NULL, pMpeg2Splitter);
hr = pBuilder->RenderStream(NULL, NULL, pMpeg2Splitter, NULL, pMux);
hr = pBuilder->RenderStream(NULL, NULL, pMpeg2Splitter, NULL, pMux);
.......

AnswerRe: convert mpg to avi in directshow Pin
toxcct9-Jul-07 5:04
toxcct9-Jul-07 5:04 
AnswerRe: convert mpg to avi in directshow Pin
Mark Salsbery9-Jul-07 7:40
Mark Salsbery9-Jul-07 7:40 
GeneralRe: convert mpg to avi in directshow Pin
liur179-Jul-07 15:00
liur179-Jul-07 15:00 
GeneralRe: convert mpg to avi in directshow Pin
Mark Salsbery9-Jul-07 15:50
Mark Salsbery9-Jul-07 15:50 
GeneralRe: convert mpg to avi in directshow Pin
liur179-Jul-07 20:45
liur179-Jul-07 20:45 
QuestionRe: convert mpg to avi in directshow Pin
Hamid_RT9-Jul-07 7:59
Hamid_RT9-Jul-07 7:59 
QuestionLocalization using .rc resource and resource only dll in same EXE Pin
Neeranjan9-Jul-07 4:36
Neeranjan9-Jul-07 4:36 
QuestionWinsock issue (HTTP) Pin
PigeonRat9-Jul-07 4:24
PigeonRat9-Jul-07 4:24 
AnswerRe: Winsock issue (HTTP) Pin
PigeonRat9-Jul-07 4:37
PigeonRat9-Jul-07 4:37 
Questionfunction pointer Pin
eirche9-Jul-07 3:51
eirche9-Jul-07 3:51 
AnswerRe: function pointer Pin
Nibu babu thomas9-Jul-07 4:12
Nibu babu thomas9-Jul-07 4:12 
GeneralRe: function pointer Pin
eirche9-Jul-07 4:18
eirche9-Jul-07 4:18 
AnswerRe: function pointer Pin
toxcct9-Jul-07 4:14
toxcct9-Jul-07 4:14 
QuestionWaitForMultipleObjects problem Pin
david bagaturia9-Jul-07 3:43
david bagaturia9-Jul-07 3:43 
AnswerRe: WaitForMultipleObjects problem Pin
toxcct9-Jul-07 4:15
toxcct9-Jul-07 4:15 
GeneralRe: WaitForMultipleObjects problem Pin
david bagaturia9-Jul-07 19:16
david bagaturia9-Jul-07 19:16 
AnswerRe: WaitForMultipleObjects problem Pin
Rage9-Jul-07 4:53
professionalRage9-Jul-07 4:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.