The world's population has grown in recent decades, increasing social events and leading to more crowd situations with potential issues, such as bottlenecks, stampedes, or falls. In this context, this paper presents an approach for stampede detection from image sequences in low- and medium-crowd. It is based on a feature vector extracted from the dense optical flow, using the Gunner-Farneback method, and a deep learning-based classification model capable of determining, frame by frame, whether a stampede is happening. It has been evaluated on four different datasets: two widely used in the state-of-the-art- University of Minnesota (UMN) and Performance Evaluation of Tracking and Surveillance (PETS-2009)- and two new labeled datasets, Geintra-Behaviour-Analysis (GBA-Stampedes) and Geintra-Santander Multiple Actions Dataset in Cruises (GSMADC), which include realistic indoor and outdoor scenarios, as well as diverse crowd types and sizes (up to 6 people in GSMADC and a minimum of 15 in GBA). Both datasets have been made publicly available to increase the limited number of sequences for validating stampede detection in videos, with more than 43000 frames. The proposed method was evaluated across various training scenarios to test its adaptability to new environments. In the most challenging scenario, using a limited training set, our system achieved average metrics of around 99% on UMN and PETS-2009, 95% on GBA, and 91% on GSMADC. In comparison, other models achieved only 90% on UMN and PETS-2009, 80% on GBA, and below 80% on GSMADC, demonstrating the accuracy and robustness of the stampede detector across scenarios.