Playing Video Major Slowdown

Blitz3D Forums/Blitz3D Programming/Playing Video Major Slowdown

Mortiis(Posted 2007) [#1]
Simply, I want to play video files realtime, while playing the
game a transmission window will appear and the video will play
there as you play the game.

It causes a major slowdown until video disappears. Is there
any way to overcome that slowdown?

AnimTexture is my last option btw.

Thanks.


andy_mc(Posted 2007) [#2]
You'll need to use a smaller video resolution, or one with less compression. Blitz uses directshow to show videos, so if it's a highres DVD quality video, then it's using a lot of CPU time to decode the video before texturing it onto a surface. So try to keep the resolution of the video small and if possible, don't compress it too much.

Remember the adult video clip playing on the cinema screen in duke dukem? That was really low res for the same reason, high res pron would've killed the frame rate.


Mortiis(Posted 2007) [#3]
Well, it's a 200x200 non-compressed avi. As far as I know, duke nukem uses animated textures to emulate video. It's not normal, it drops from 400 fps to something like 15...wierd.


andy_mc(Posted 2007) [#4]
hmm, maybe it's running at the same framerate as the video?


Mortiis(Posted 2007) [#5]
Nope, I tried a 60 fps video but the actual fps of the game shows 15 while there is no video it's 400.


jfk EO-11110(Posted 2007) [#6]
Opening a movie will always pause the machine for a while. Playback should be ok, tho it forces the movies framerate with every Drawmovie command, so you should call it when all work is done, right before the Flip. You may also use a polled call, eg: if time elapsed > frametime then drawmovie.

Other than that I have no idea why a 200*200 uncompressed Avi should be so slow. Then again, are you ure you tried a movie with 60 frames/s? They usually have 30 or less. Even a DVD has 60 or 50 interlaced(!), this is not really 60, but actually 30. Probably the movie has 15 fps and your graphicscard is set to 60 Hz, so you confused them?

As a worst case solution without sound you may also use the Avi Framegrabber (codearchives>userlibs) and play the movie frame by frame by your code.