Either Akari's purposefully being unhelpful, or I'm misunderstanding what the questions mean.
1. How the game knows when to end the .avi and [resume gameplay]
2. What about [playing consecutive] .avi files, does it count frames for each file or for all of them together?
3. Is there [an application that can] count the frames [of an avi file], or do whatever it is the game does, to compare the old file with the new one so that i can make them the same?
1. The game compares the frame count of the AVI to the frame it is displaying. Somewhere in the AVI is a number that has the total number of frames in it. When it is finished displaying the last frame, the gameplay resumes.
2. Same deal here. As long as the game is told to play one AVI then the next, it won't resume gameplay until they are both played.
3. Length isn't an issue. If you want to know, a program called GSpot
can quickly identify several things about most AVIs, including frame count
If you want to make/replace a movie you'll have to update moviecam.lgp and the associated cam file. Don't ask me how to do that. I have no idea.