Suppose you are using Windows 7 and have a folder window open, containing a number of mp4 and avi files. If you left-click once on one video file after another, then will each video file in its turn be marked without being started. Furthermore, at the bottom edge of the folder window you'll see info telling the picture width, picture height and framerate for the currently marked video file. This is true for virtually all mp4 files and some of the avi files.
However, there are certain avi files that somehow will 'irritate' Windows, so Windows won't display the picture size and framerate at the lower edge of the folder window. It seems to be the case that the very same avi files also will 'irritate' MMD, so MMD will stop reading the avi file after a couple of hundred frames.
Thus, it seems that you possibly can predict which avi files that will stall in MMD, simply by clicking the file name and looking at lower edge of the folder window?
(To delete the first four 30fps frames or the first seven 60fps frames of an avi file in AviUtl, and then save as avi, is not a good idea for a MMD background file).
(To open a mp4 file in Avidemux, delete the first 0.116 seconds, and then save as a "Mpeg4 AVC (x264)" type avi file is a better idea).