Problem with sync in AVI

Started by
1 comment, last by SubUrban 21 years, 7 months ago
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!
Advertisement
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?
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

This topic is closed to new replies.

Advertisement