Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows 98 / General Topics / February 2007

Tip: Looking for answers? Try searching our database.

Want to write the file in avi format with choosen AverageTimePerSec

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
leo - 28 Feb 2007 09:45 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.