Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rendering video using video for windows

Started by Fire of Evil Mar 17, 2005 at 11:25 AM 0 replies 550+ views
Original Post
Fire of Evil
Fire of Evil
I used vfw to get a BITMAPINFOHEADER of the frame I want to render and I managed to blit it to the backbuffer using StretchRect but all I get is this: www.ireallydontcare.com/asaf/test.jpg

	LPBITMAPINFOHEADER pBMP;
	IDirect3DSurface9 *pSurface;

	pAviFile->GetVideoFrameAtTime(0, time, &pBMP);
	if (pBits == NULL) return false;

	RECT rect = {0, 0, pBMP->biWidth, pBMP->biHeight};
	pFrame->GetSurfaceLevel(0, &pSurface);
	D3DXLoadSurfaceFromMemory(pSurface, NULL, NULL, pBMP + pBMP->biSize, D3DFMT_X8R8G8B8, pBMP->biWidth*(pBMP->biBitCount/8), NULL, ▭, D3DX_DEFAULT, 0);

	pD3dDevice->StretchRect(pSurface, NULL, pBackBuffer, NULL, D3DTEXF_NONE);
	return 1;

that doesn't work well and it's very slow I tried locking the surface and copying the data, but that didn't fix the problem and was even slower the part that retrieves the frame is working, I took it from a sample I found that renders video to a DirectDraw surface and it renders the same video perfectly
"For the end of the world miracle, press Ctrl+Alt+Delete"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.