Could be the compression scheme of the movie files. Could be a 3rd party codec conflict. Could be that you don't have the latest build. Could be something else with your OS. If we knew at least something about your system and your footage maybe we could come up with an idea that would help. There are hundreds of different flavors of MP4 and MPEG files. I have no idea what could be going on because I've never had this problem with any of the production footage that I use in my daily work.
One possibility is that security/anti-virus software is prohibiting After Effects from communicating with the background analysis server process over TCP.
Without system information and other details nobody can tell you anything. As Kopriva said, most commonly external influences like virus scanners blocking file access or communication between the separate processes are at the heart of the problem....