Problem with sync in AVI
Hi!
I''m looking at the texture3D example that is in the SDK and also the directshow example from the book "real-time rendering tricks and techniques"
The problem I have is that the movie is running very slow and the sound gets out of sync.
They booth use the DoRenderSample function to render each picture
like this
//Walk through row by row
for(long y = 0; y < m_VideoHeight; y++)
{
BYTE *pVideoRowStart = pVideoBuffer;
BYTE *pTextureRowStart = pTextureBuffer;
//walk through each pixel of the row
for (int x = 0; x < m_VideoWidth; x++)
{
pTextureBuffer[0] = pVideoBuffer[0];
pTextureBuffer[1] = pVideoBuffer[1];
pTextureBuffer[2] = pVideoBuffer[2];
pTextureBuffer[4] = 0xff;
pTextureBuffer += 4;
pVideoBuffer += 3;
}
//Increment to the next row
pVideoBuffer = pVideoRowStart + m_VideoPitch;
pTextureBuffer = pTextureRowStart + TexturePitch;
}
and I guess this is what makes it so damn slow, so my sound gets out of sync and the movie doesn''t run very smooth.
Is there a better way to draw the picture every frame (asm?)
Or is it just that if I want to show AVI movies I need to show them without any texture just as it is done for example in the SDK example PlayWnd.
It would be nice to be able to render text and objects infront of a avi.
The file I have isn''t thay big (~3mb divx)
any advice?
thanks!
Isn''t Divx a highly compressed format? It might just be taking it a long time to decompress each frame. Just a guess...
It depends on your processor and the video size/codec. The loops should be very fast relative to the work of the codec.
Can you give us some system specs?
Can you give us some system specs?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement