Video concentration method and system

The invention discloses a video concentration method and a video concentration system, and belongs to the technical field of video processing. The method comprises the following steps that video frames are subjected to background modeling analysis, foreground targets and background images of each frame are divided, the moving target track of each target is extracted, in addition, the target sequence and background images are stored, the target sequence of the moving target track are subjected to optimized ranking, a new frame number sequence is generated and stored, according to a pixel merging algorithm, the foreground targets and the background images are subjected to seamless merging, the stored new frame number sequence and the stored background images are read, and a compressed video is generated. When the method and the system provided by the embodiment of the invention are adopted, the length of the compressed video is shortened, in addition, the moving object information in the video is retained as far as possible, the collision among multiple targets can be effectively prevented, and better visual effects are realized.