MPEG4 Advanced Simple Profile video provides I, P, andB-typefram esineachGOP(GroupOfPictures). To maximize the coding efficiency, it is important to determine the distribution of the three frame types, also called the GOP structure. In this paper, the GOP structure is determined dynamically in real time by using the information, such as Sad (Sum of Absolute Difference) and Mad (Mean of Absolute Difference), generated in the encodingprocessandlittleam ountofcom putationis used. The algorithm first determines whether the current frame is an Intrapicture oran Interpicture. If it is an Interpicture, one has to decide whether i ti saP_picture or a B_picture.Nom oret han4 consecutiveB_picturescanbe employed to reduce the video buffer size. The proposed methodist estedoverawi derange of video sequences at different data rate conditions and produces consistent improvementcom paredt ofi xedGOP methods.