I am playing a very large avi file in my C++ program on a Windows 32 bit system.
Small avi files play OK. This one avi file has large uncompressed bitmaps in it and it seems to be loading slowly while playing thus playing slowly. It plays, but it is slow. It plays in VLC media player much faster. It was encoded at 40 frames per second, but plays in my executable at 10 to 15 frames per second. I was thinking of loading it completely, then after it was fully loaded use Animate_Open to play it.
I am using
#define IDC_MYANIMATE 9
HINSTANCE hInstanceAVI = GetModuleHandleW (NULL);
HWND hwndAvi = Animate_Create (hParent, IDC_MYANIMATE, WS_BORDER | WS_CHILD, hInstanceAVI);
int iAp = Animate_Open (hwndAvi, L"Very_Large.avi");
ShowWindow (hwndAvi, SW_SHOW);
iAp = Animate_Play (hwndAvi, 0, -1, -1);
but this seems to be slowed down by the continuously loading of the avi file as it is playing.
How can I load the avi file completely, then when loaded begin to play it?
What I have tried:
I tried searching for how to load a video file of any type in case I could adjust the logic for this. I have not found any help in this. They all seem to be doing close to what I am doing and not attempting to load the entire avi file first before playing it.
I do not mean to make the avi file a part of my executable, but for the executable to load the avi file then when the file is completely loaded play it. That way I can then delete the memory that the avi file is in and release that large amount of memory to do other things. So, start the exe, then while the exe is running click on a button to load the avi file, then click on a button to play the avi. Simple? It should be. I am having problems with the loading of the avi then holding it in memory until I click a button for it to play.
I am using a fast cpu, a solid state drive, lots of RAM, and a large page file, so I do not expect that to be much adjustable for this.
This should be easy since I can load multiple single bitmaps then later show then, but I seem to be missing something.
I am asking for help to solve this. Thank you.