hi
Can anyone help how i can write an avi file using a file writer.
Sourcefitlter ----->AviMux-------> FileWriter
should i have to change any AviMux property or anychanges in source
filter. I am appling time stamp in source filter a follows..
dwPerFrameTime = UNITS / 30; //which gives 333333
HRESULT CTrinityStream::FillBuffer(IMediaSample *pSample)
{
CAutoLock l(&m_cSharedState);
HRESULT hr = 0;
//Copy data from the DVR Buffer ... (This copy should be avoided by
custom allocators (Deepak)
hr = m_plFilled->RemoveHeadIntoSample(pSample);
if(FAILED(hr))
{
DbgLog((LOG_TRACE, 2, TEXT("RemoveHeadIntoSample() returned %08x;
stopping"), hr));
return hr;
}
// Set the timestamps that will govern playback frame rate.
// If this file is getting written out as an AVI,
// then you'll also need to configure the AVI Mux filter to
// set the Average Time Per Frame for the AVI Header.
// The current time is the sample's start
REFERENCE_TIME rtStart = m_lFrameNumber * m_dwPerFrameTime;
REFERENCE_TIME rtStop = rtStart + m_dwPerFrameTime;
//Deepak Experimentally commented ... Let the renderer not wait for
frames based on time.
//Since we are a capture source
hr = pSample->SetTime(&rtStart, &rtStop);
m_lFrameNumber++;
// Set TRUE on every sample for uncompressed frames
hr = pSample->SetSyncPoint(TRUE);
DbgLog((LOG_TRACE,4,TEXT("Frame Time$ start:%ld end:%ld"),
(long)rtStart,(long)rtStop));
return hr;
}
Can anyone help ...?
leo - 28 Feb 2007 09:48 GMT
> hi
> Can anyone help how i can write an avi file using a file writer.
[quoted text clipped - 48 lines]
>
> Can anyone help ...?
There is a correction it not AverageTimePerSec it's AvgTimePerFrame