Skip to main content
gamedev.net
🔒 Locked

AVI Program Start

Started by Strylinys 7 replies 900+ views
Original Post
Strylinys
Strylinys
I was wondering how to get an AVI to start off a project I''m working on. I have been able to get the first frame to show up, but it appears on screen for less than 1/10th of a second. Also, it doesn''t play through the video, nor audio... Just shows the first frame. It then continues with the rest of my program. If someone could please help me out here with some code or even (NeHe....) a tutorial about this, I would appreciate it a lot. Thanks... S.
SKSlayer
SKSlayer
Check where in your avi player there could be a break that stops the avi player, if there is none, check your loader ...

More info could be given ... if we have the source
(you can find me on IRC : #opengl on undernet)
Strylinys
Strylinys
hwndMovie = MCIWndCreate(hWnd, hInstance, WS_CHILD |WS_VISIBLE | MCIWNDF_NOOPEN | MCIWNDF_NOPLAYBAR | MCIWNDF_NOAUTOSIZEMOVIE | MCIWNDF_NOERRORDLG | MCIWNDF_NOTIFYSIZE | MCIWNDF_NOMENU, "test.avi");

well, there''s my wonderful one line of code that i have (grabbed it from the msdn library) and when i cut out the rest of my program (so that it won''t continue past the movie) it still only shows the first frame. Although, it is there until i hit escape, so i think i''m getting there, i just need a play command...

Also, in the WinProc i added a few lines in the hope that maybe i might get lucky and get it working...

case WM_PAINT:
{
BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
return 0;
}

case MCIWNDM_NOTIFYSIZE:
{
/* adjust to size of the movie window */
GetWindowRect(hwndMovie, &rc);
AdjustWindowRect(&rc, GetWindowLong(hWnd, GWL_STYLE), TRUE);
SetWindowPos(hWnd, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE);
return 0;
}

not to sure how those will turn out......
Strylinys
Strylinys
I''m using the winmm library.... trying to get the MCI bit to play the thing, but it doesn''t want to autoplay. Can anyone give me some help as to how I can get an AVI to autoplay at the beginning of my program?

Thanks.
S.
SKSlayer
SKSlayer
Didn''t you forget to update the video at everyframe?
(you can find me on IRC : #opengl on undernet)
BassX
BassX
Hi there...
I''m BassX...

Try this out...Strylinys

Add vfw32.lib to project
#include

hWndMovie = MCIWndCreate(hWnd, hInstance, WS_CHILD | WS_VISIBLE | MCIWNDF_NOOPEN | MCIWNDF_NOPLAYBAR | MCIWNDF_NOERRORDLG | MCIWNDF_NOTIFYSIZE | MCIWNDF_NOMENU, "test.avi");
MCIWndHome(hWndMovie);
MCIWndPlay(hWndMovie);

And to STOP:

MCIWndClose(hWndMovie);
MCIWndDestroy(hWndMovie);

Try to edit VFW.H an look at the functions...You can maximize, resize, stop, play, repeat, etc...
...It works with me...
Good luck!!!
Strylinys
Strylinys
Thanks a lot, BassX. Had to fiddle around a bit to find the GetPosition and GetEnd funcitons to check if it was done playing, but I got it.

S.

Topic Locked

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

Sign in to reply to this topic.