Obtaining the nighttime trajectory data of traffic objects at intersections can be of great significance for traffic investigations. But there are usually many interferences in the nighttime videos recorded by traffic surveillance, which can make it difficult to obtain the trajectory information of traffic objects. This paper presents the nighttime trajectory extraction framework, and applies Single Shot Multi-Box Detector (SSD) with the improved modules and the Simple Online and Real-time Tracking with a Deep Association Metric (DeepSort) algorithm to collect traffic trajectory data from nighttime traffic videos recorded by roadside surveillance cameras at the intersections. Based on the improved SSD method, the traffic objects at the intersection can be detected in various degrees of visibility. The object locations and bounding boxes provided by the improved SSD can be post-processed and then used as the input for the DeepSort. The performance evaluations on the different datasets (MOT16, 120 m-visibility, 100 m-visibility, 70 m-visibility and 50 m-visibility) can be carried out. For the performance evaluations on the MOT16 dataset, our framework can achieve 12.80% ML and 366 IDs; for the performance evaluations on the 120 m-visibility dataset, our framework can achieve 14.72% ML and 430 IDs; for the performance evaluations on the 100 m-visibility dataset, our framework can achieve 15.22% ML and 466 IDs;for the performance evaluations on the 70 m-visibility dataset, our framework can achieve 43.06% MOTA, 27.74% MT, 16.56% ML and 512 IDs; for the performance evaluations on the 50 m-visibility dataset, our framework can achieve 32.86% MOTA, 20.08% MT, 18.48% ML and 562 IDs. And in some challenging situations, the presented framework can have excellent performance. From the results, we conclude that the presented framework can achieve excellent performance for traffic investigations at night.