Now a day, the mass events like political rallies, musical concerts, sports matches, school gathering and pilgrimage become an issue of the public security. In the past the research is based on the detection of the human behaviour and for finding the hazardous location. Crowd is a collection or gathering of many people in the same area at the same time. In such situation the density of people is high and this may causes the disaster. The proposed system will help to overcome such situation. The system detects the congestion with the help of optical flow and the standard deviation and gives warning when the congestion is detected. © 2016 ACM.