The poor quality or the miss of Automatic Identification System (AIS) data may cause erroneous judgement of the potential navigational risk. Therefore, this study proposes a real-time framework for assessing ship collision risk using onboard video data in order to improve the risk perception ability of navigators. Firstly, the Squeeze-and-Excitation (SE) attention mechanism and the K-means algorithm are simultaneously utilized for the framework to enhance the multi-scale ship detection capability. The Deep-SORT is employed to complete multi-ship feature matching. Secondly, the distances between two ships and their speeds are measured using the pinhole imaging principle based on the ship visual feature extraction results. Moreover, the ship distance-speed correction method is designed to improve the reliability of estimated results. Finally, the effectiveness of the framework is validated using naturalistic driving data from the “He Hua Hai” ship. The results show that the proposed framework could demonstrate an excellent performance in assessing ship collision risk using the onboard video data. The proposed framework could help precisely detect and promptly provide warnings about potential ship collision risks. This could help prevent catastrophic accidents that pose a threat to oceans and coasts, particularly in situations when AIS data proves to be unreliable or ineffective.