A new method for extracting traffic parameters from UAV videos to assist in establishing a car-following model is proposed in this paper. The improved ShuffleNet network and GSConv module were introduced into the Yolov7-tiny neural network model as the target detection stage. HOG features and IOU motion metrics are introduced into the DeepSort multiobject tracking algorithm as the tracking matching stage. By building a self-built UAV aerial traffic data set, experiments were conducted to prove that the new method improved a few detection and tracking indicators. In addition, it improves the false detection, missed detection, wrong ID conversion and other phenomena of the previous algorithm, and improves the accuracy and lightweight of multi-target tracking. Finally, gray correlation was applied to analyze the traffic parameters extracted by the new method, and the driver's visual perception of collision was introduced into the car-following model. Through stability analysis, small disturbance simulation and collision risk assessment, the newly proposed traffic flow parameter extraction method has been proven to improve the dynamic characteristics and safety of the car-following model, and can be used to alleviate traffic congestion and improve driving safety.