A method for viewing multiple videos frame by frame

Through video capture class and timer technology, multiple videos are viewed frame by frame on the same page, solving the problem that multiple video images cannot be viewed simultaneously in the existing technology, and improving the convenience and efficiency of operation.

CN119557477BActive Publication Date: 2025-04-25SICHUAN WEIBANG XINCHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510105101.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-25
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The prior art cannot view the frame-by-frame screen of multiple videos on the same page at the same time, resulting in users needing to open each video file separately for viewing one by one, which is cumbersome.

Method used

Load videos through the video capture class for initialization, store the video object into the memory vector list, and obtain the specified frame matrix vector list of the video capture class object in combination with the specified frame index, and realize frame-by-frame viewing of multiple video images through a timer.

Benefits of technology

It realizes the frame-by-frame picture of multiple videos on a single page, solves the problem that multiple video pictures cannot be viewed simultaneously in the prior art, and improves the convenience and efficiency of operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557477B_ABST
    Figure CN119557477B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for viewing multiple videos frame by frame, which belongs to the field of video processing technology and mainly solves the problem that the prior art cannot simultaneously view the frame-by-frame images of multiple videos on the same page. The method comprises the following steps: S1, using a video capture class to load a video for initialization, and storing the video object in a memory vector list; S2, obtaining a specified frame matrix vector list of a video capture class object in combination with a specified frame index; S3, synthesizing the loaded video objects into multiple video images according to the specified frame matrix vector list of the video capture class object; S4, realizing frame-by-frame viewing of multiple video images through a timer. The present invention realizes viewing the frame-by-frame images of multiple videos on a single page by decomposing multiple videos into image matrices frame by frame, and synthesizing these matrices on a page through calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of video processing, and in particular relates to a multi-video synthesis frame-by-frame viewing method. Background Art

[0002] In modern video recording, it is often necessary to record the same thing from multiple angles. In this case, multiple video files will be generated. However, commercial video players currently on the market can only play a single video, and it is not possible to view multiple videos frame by frame on the same page at the same time. In the prior art, users need to open each video file separately and view them one by one, which is very inconvenient in practical applications.

[0003] In traditional technology, viewing multi-angle videos on the same display screen requires software support for multiple openings. You need to open multiple videos, manually adjust the placement, and click the play button at the same time. Conventional forward and backward viewing is driven at time intervals. The conventional operations of starting, pausing, forward, and backward viewing of multiple videos are cumbersome, and it is difficult to achieve synchronous execution of operations. Summary of the invention

[0004] The purpose of the present invention is to provide a method for viewing multiple videos frame by frame, which mainly solves the problem that the prior art cannot simultaneously view frame by frame images of multiple videos on the same page.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] A method for viewing multiple videos frame by frame by synthesizing the video comprises the following steps:

[0007] S1, use the video capture class to load the video for initialization and store the video object into the memory vector list;

[0008] S2, obtain the specified frame matrix vector list of the video capture class object in combination with the specified frame index;

[0009] S3, synthesizing the loaded video objects into multiple video images according to the frame matrix vector list specified by the video capture class object;

[0010] S4, realizes frame-by-frame viewing of multiple video images through a timer.

[0011] Furthermore, in the present invention, the specific process of step S1 is as follows:

[0012] S11, declares the video capture class vector list;

[0013] S12, the user selects multiple videos to be synthesized and obtains corresponding video addresses;

[0014] S13, the video capture class generates a video capture class object by loading the video address selected by the user, and appends the video capture class object to the video capture class vector list to provide a data source for subsequent video processing.

[0015] Furthermore, in the present invention, the specific process of step S2 is as follows:

[0016] S21, calling the acquisition function of the video capture class object, passing in the total number of video frames enumeration, obtaining the total number of frames of the video capture class object, and comparing it with the specified frame index. If it is greater than the total number of frames of the video capture class object, it is determined to be an invalid frame index; otherwise, it is valid;

[0017] S22, if the specified frame index is invalid, an empty matrix is ​​obtained; if it is valid, the setting function of the video capture class object is called, the video frame position enumeration and the specified video frame index parameters are passed in, and the read matrix function of the video capture class object is called to obtain the specified frame matrix of the video capture class object;

[0018] S23, extracting the specified frame matrix from the video capture class vector list through a loop and storing it in the specified frame index matrix vector list;

[0019] S24, encapsulate the functions implemented in steps S21 to S23 into a function for obtaining a specified frame matrix vector list, the parameter is the frame position index, and the return value is a matrix vector list.

[0020] Furthermore, in the present invention, the specific process of step S3 is as follows:

[0021] S31, pass in the frame index to be displayed and get the matrix vector list;

[0022] S32, creating a matrix object to be synthesized, and setting the width and height of the matrix;

[0023] S33, by looping through the matrix vector list, calling the copy matrix function of the matrix object one by one, so as to copy the matrix to the matrix to be synthesized;

[0024] S34, after the loop is finished, the synthesis matrix is ​​converted into a picture;

[0025] S35, encapsulate the functions implemented in steps S31 to S34 into a composite picture function, with the parameter being the frame index and the return value being the picture.

[0026] Furthermore, in the present invention, the specific process of step S4 is as follows:

[0027] S41, realizing the playback of multiple videos: defining the current frame index value and initializing it, starting the timer, accumulating the current frame index value by setting the playback speed, calling the synthesis picture function to obtain the picture, and displaying it on the page;

[0028] S42, realizing playback pause: determining whether the current timer is in an active state, and if so, calling the timer stop function to realize the pause function;

[0029] S43, realizing forward frame viewing: stopping the timer, increasing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display;

[0030] S44, realizing backward viewing of the frame picture: stopping the timer, reducing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display.

[0031] Furthermore, in the present invention, in the step S4, it also includes key frame positioning: obtaining the total number of frames through the video capture class to form a progress bar, clicking the progress bar, stopping the timer, obtaining the frame index of the clicked position, calling the synthesis picture function to pass in the frame index to obtain the picture for display.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) The present invention decomposes multiple videos into image matrices frame by frame and combines these matrices on a page through calculation, thereby realizing frame-by-frame viewing of multiple videos on a single page, solving the problem in the prior art that multiple video images cannot be viewed on the same page.

[0034] (2) Multiple cameras simultaneously shoot the same event. Through the present invention, the images shot by multiple cameras can be viewed on the same page, which is convenient for later analysis and comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of the process structure of the method of the present invention. DETAILED DESCRIPTION

[0036] The present invention is further described below in conjunction with the accompanying drawings and embodiments. The embodiments of the present invention include but are not limited to the following embodiments.

[0037] like Figure 1 As shown, the present invention discloses a method for viewing multiple videos frame by frame based on the open source cross-platform visual processing software library OpenCV 4. The method uses the video capture class to load the video file, read the frame data, and store it in a matrix list. The frame matrices of multiple videos are synthesized by a calculation method to form a large image matrix, which is converted into a picture and displayed on the page. By refreshing the subsequent matrix in a loop, a visual continuous playback effect is achieved. In addition, the system also supports forward, backward and pause operations, and these functions are realized by operating the video matrix.

[0038] The specific implementation process is as follows:

[0039] S1, use the video capture class to load the video for initialization and store the video object in the memory vector list:

[0040] S11, declares the video capture class vector list;

[0041] S12, the user selects multiple videos to be synthesized and obtains corresponding video addresses;

[0042] S13, the video capture class generates a video capture class object by loading the video address selected by the user, and appends the video capture class object to the video capture class vector list to provide a data source for subsequent video processing.

[0043] S2, combined with the specified frame index, obtains the specified frame matrix vector list of the video capture class object:

[0044] S21, calling the acquisition function of the video capture class object, passing in the total number of video frames enumeration, obtaining the total number of frames of the video capture class object, and comparing it with the specified frame index. If it is greater than the total number of frames of the video capture class object, it is determined to be an invalid frame index; otherwise, it is valid;

[0045] S22, if the specified frame index is invalid, an empty matrix is ​​obtained; if it is valid, the setting function of the video capture class object is called, the video frame position enumeration and the specified video frame index parameters are passed in, and the read matrix function of the video capture class object is called to obtain the specified frame matrix of the video capture class object;

[0046] S23, extracting the specified frame matrix from the video capture class vector list through a loop and storing it in the specified frame index matrix vector list;

[0047] S24, encapsulate the functions implemented in the above steps into a function for obtaining a matrix vector list of a specified frame, the parameter is the frame position index, and the return value is a matrix vector list.

[0048] S3, synthesize the loaded video objects into multiple video images according to the specified frame matrix vector list of the video capture class object:

[0049] S31, pass in the frame index to be displayed and get the matrix vector list;

[0050] S32, creating a matrix object to be synthesized, and setting the width and height of the matrix;

[0051] S33, by looping through the matrix vector list, calling the copy matrix function of the matrix object one by one, so as to copy the matrix to the matrix to be synthesized;

[0052] S34, after the loop is finished, the synthesis matrix is ​​converted into a picture;

[0053] S35, encapsulate the above-implemented functions into a composite picture function, with the parameter being the frame index and the return value being the picture.

[0054] S4, using timer to realize frame-by-frame viewing of multiple video images:

[0055] S41, realizing the playback of multiple videos: defining the current frame index value and initializing it, starting the timer, accumulating the current frame index value by setting the playback speed, calling the synthesis picture function to obtain the picture, and displaying it on the page;

[0056] S42, realizing playback pause: determining whether the current timer is in an active state, and if so, calling the timer stop function to realize the pause function;

[0057] S43, realizing forward frame viewing: stopping the timer, increasing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display;

[0058] S44, realizing backward viewing of the frame picture: stopping the timer, reducing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display.

[0059] The present invention can also realize fast key frame positioning: the total number of frames is obtained through the video capture class to form a progress bar, the progress bar is clicked, the timer is stopped, the frame index of the clicked position is obtained, and the composite picture function is called to pass in the frame index to obtain the picture for display.

[0060] Through the above design, the present invention decomposes multiple videos into image matrices frame by frame, and synthesizes these matrices on a page through calculation, thereby realizing frame-by-frame viewing of multiple videos on a single page, solving the problem in the prior art that multiple video images cannot be viewed on the same page.

[0061] The above embodiment is only one of the preferred implementation modes of the present invention and should not be used to limit the protection scope of the present invention. Any changes or modifications that are made to the main design concept and spirit of the present invention and have no substantive significance, and the technical problems they solve are still consistent with the present invention, should be included in the protection scope of the present invention.

Claims

1. A method for viewing multiple videos frame by frame, characterized in that: The following steps are involved: S1, use the video capture class to load the video for initialization and store the video object into the memory vector list; S2, obtain the specified frame matrix vector list of the video capture class object in combination with the specified frame index; S3, synthesize the loaded video objects into multiple video images according to the frame matrix vector list specified by the video capture class object; the specific process is as follows: S31, pass in the frame index to be displayed and get the matrix vector list; S32, creating a matrix object to be synthesized, and setting the width and height of the matrix; S33, by looping through the matrix vector list, calling the copy matrix function of the matrix object one by one, so as to copy the matrix to the matrix to be synthesized; S34, after the loop is finished, the synthesis matrix is ​​converted into a picture; S35, encapsulating the functions implemented in steps S31 to S34 into a composite picture function, with the parameter being the frame index and the return value being the picture; S4, realizes frame-by-frame viewing of multiple video images through a timer.

2. The method for viewing multiple videos frame by frame according to claim 1, characterized in that: The specific process of step S1 is as follows: S11, declares the video capture class vector list; S12, the user selects multiple videos to be synthesized and obtains corresponding video addresses; S13, the video capture class generates a video capture class object by loading the video address selected by the user, and appends the video capture class object to the video capture class vector list to provide a data source for subsequent video processing.

3. The method for viewing multiple videos frame by frame according to claim 2, characterized in that: The specific process of step S2 is as follows: S21, calling the acquisition function of the video capture class object, passing in the total number of video frames enumeration, obtaining the total number of frames of the video capture class object, and comparing it with the specified frame index. If it is greater than the total number of frames of the video capture class object, it is determined to be an invalid frame index; otherwise, it is valid; S22, if the specified frame index is invalid, an empty matrix is ​​obtained; if it is valid, the setting function of the video capture class object is called, the video frame position enumeration and the specified video frame index parameters are passed in, and the read matrix function of the video capture class object is called to obtain the specified frame matrix of the video capture class object; S23, extracting the specified frame matrix from the video capture class vector list through a loop and storing it in the specified frame index matrix vector list; S24, encapsulate the functions implemented in steps S21 to S23 into a function for obtaining a specified frame matrix vector list, the parameter is the frame position index, and the return value is a matrix vector list.

4. The method for viewing multiple videos frame by frame according to claim 3, characterized in that: The specific process of step S4 is as follows: S41, realizing the playback of multiple videos: defining the current frame index value and initializing it, starting the timer, accumulating the current frame index value by setting the playback speed, calling the synthesis picture function to obtain the picture, and displaying it on the page; S42, realizing playback pause: determining whether the current timer is in an active state, and if so, calling the timer stop function to realize the pause function; S43, realizing forward frame viewing: stopping the timer, increasing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display; S44, realizing backward viewing of the frame picture: stopping the timer, reducing the current frame index by one, and then calling the synthesis picture function to obtain the picture for display.

5. The method for viewing multiple videos frame by frame according to claim 4, characterized in that: In the step S4, it also includes key frame positioning: obtaining the total number of frames through the video capture class to form a progress bar, clicking the progress bar, stopping the timer, obtaining the frame index of the clicked position, calling the synthetic picture function to pass in the frame index to obtain the picture for display.

Citation Information

Patent Citations

  • Multi-channel video reasoning concurrent preprocessing acceleration method, system, medium and equipment

    CN116886940A

  • Method for processing video file, method for indexing video, and video indexing unit

    CN1873820A