Click here to Skip to main content
15,909,539 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProgramtically check if a file is open in a application Pin
jayart18-Apr-06 2:42
jayart18-Apr-06 2:42 
AnswerRe: Programtically check if a file is open in a application Pin
David Crow18-Apr-06 2:43
David Crow18-Apr-06 2:43 
AnswerRe: Programtically check if a file is open in a application Pin
ThatsAlok18-Apr-06 7:36
ThatsAlok18-Apr-06 7:36 
Question[Message Deleted] Pin
yang__lee18-Apr-06 2:37
yang__lee18-Apr-06 2:37 
AnswerRe: How to sent the font of static control Pin
David Crow18-Apr-06 2:44
David Crow18-Apr-06 2:44 
AnswerRe: How to sent the font of static control Pin
Naveen18-Apr-06 2:50
Naveen18-Apr-06 2:50 
GeneralRe: How to sent the font of static control Pin
yang__lee18-Apr-06 18:23
yang__lee18-Apr-06 18:23 
QuestionHelp Needed in recompressing avi files Pin
atimpoo18-Apr-06 1:31
atimpoo18-Apr-06 1:31 
Hi All,

Using Timeline in DirectShow Editing services I did video and audio mixing.
I want to save it in avi format.

This is the code I used to save it. But it is not saving anything localy. At run time it creates an empty avi file.
It disappears automatically.


IRenderEngine *pRender = NULL;
hr = CoCreateInstance(CLSID_RenderEngine, NULL, CLSCTX_INPROC,
IID_IRenderEngine, (void**) &pRender);

hr = pRender->SetTimelineObject(pTL);
hr = pRender->ConnectFrontEnd( );

CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC,
IID_ICaptureGraphBuilder2, (void **)&pBuilder);

// Get a pointer to the graph front end.
IGraphBuilder *pGraph;
pRender->GetFilterGraph(&pGraph);
pBuilder->SetFiltergraph(pGraph);

// Create the file-writing section.
IBaseFilter *pMux;
pBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi,
OLESTR("Output.avi"), &pMux, NULL);

long NumGroups;
pTimeline->GetGroupCount(&NumGroups);

// Loop through the groups and get the output pins.
for (i = 0; i < NumGroups; i++)
{
IPin *pPin;
if (pRender->GetGroupOutputPin(i, &pPin) == S_OK)
{
IBaseFilter *pCompressor;
// Create a compressor filter.
IBaseFilter *pCompressor;
CoCreateInstance(CLSID_AVICo, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&pCompressor);
pGraph->AddFilter(pCompressor, L"Compressor");


// Set compression parameters.
IAMStreamConfig *pStreamConfig = NULL;
IAMVideoCompression *pCompress = NULL;

AM_MEDIA_TYPE *pmt;
pBuild->FindInterface(NULL,NULL,pCompressor,IID_IAMStreamConfig, (void**)&pStreamConfig);
pStreamConfig->GetFormat(&pmt);
if(pmt->formattype == FORMAT_VideoInfo)
{
((VIDEOINFOHEADER *)(pmt->pbFormat))->dwBitRate = 10000;
pStreamConfig->SetFormat(pmt);
}
pStreamConfig->QueryInterface(IID_IAMVideoCompression, (void**)&pCompress);
pCompress->put_KeyFrameRate(4);

Note: I am converting BMPs into video file and adding wav file for audio.

Please help me on this.

Thanks in advance
Poornima
// Connect the pin.
pBuilder->RenderStream(NULL, NULL, pPin, pCompressor, pMux);
pCompressor->Release();
pPin->Release();
}
}
AnswerRe: Help Needed in recompressing avi files Pin
kakan18-Apr-06 1:59
professionalkakan18-Apr-06 1:59 
QuestionApplication Theme Pin
si_6918-Apr-06 1:28
si_6918-Apr-06 1:28 
AnswerRe: Application Theme Pin
Naveen18-Apr-06 1:41
Naveen18-Apr-06 1:41 
AnswerRe: Application Theme Pin
Hamid_RT18-Apr-06 1:49
Hamid_RT18-Apr-06 1:49 
AnswerRe: dialog on tab page getting lost Pin
Cedric Moonen18-Apr-06 1:20
Cedric Moonen18-Apr-06 1:20 
Questionrandom numbers within given range Pin
9ine18-Apr-06 1:04
9ine18-Apr-06 1:04 
AnswerRe: random numbers within given range Pin
Nishad S18-Apr-06 1:09
Nishad S18-Apr-06 1:09 
AnswerRe: random numbers within given range Pin
toxcct18-Apr-06 1:10
toxcct18-Apr-06 1:10 
AnswerRe: random numbers within given range Pin
Cedric Moonen18-Apr-06 1:14
Cedric Moonen18-Apr-06 1:14 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 1:25
9ine18-Apr-06 1:25 
GeneralRe: random numbers within given range Pin
Cedric Moonen18-Apr-06 1:29
Cedric Moonen18-Apr-06 1:29 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 2:00
9ine18-Apr-06 2:00 
GeneralRe: random numbers within given range Pin
Russell'18-Apr-06 1:40
Russell'18-Apr-06 1:40 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 1:55
9ine18-Apr-06 1:55 
GeneralRe: random numbers within given range Pin
Russell'18-Apr-06 2:18
Russell'18-Apr-06 2:18 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 2:52
9ine18-Apr-06 2:52 
Questionhow can i retrieve RegNotifychangekey values Pin
keerthikaaa18-Apr-06 0:35
keerthikaaa18-Apr-06 0:35 

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.