Video data storage and preview method
By using a timer to capture full screen image frames and store screen differential frames in BMC firmware, the space and preview efficiency problems of video data storage and preview in BMC firmware are solved, and efficient storage and fast preview video data is achieved in limited storage space.
Patent Information
- Application Number
- CN202311753664.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
In BMC firmware, the prior art cannot effectively store and preview video data in a limited storage space, especially when the preview program cannot display image frames of the complete host screen data corresponding to the progress point where the mouse is located.
By starting the timer in BMC, the complete screen image frame is captured and the screen difference frame is stored to form a screen recording file. During playback and preview, the full screen image frame and the frame restored according to the screen difference frames are played sequentially to display the full screen image frame closest to the preview location.
It realizes reducing the size of the screen recording file in limited storage space, and can quickly display the complete screen image frame closest to the preview position during preview, solving the problem that the preview program cannot display the complete image frame.
Smart Images

Figure CN120179854A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer firmware, and particularly to a method for storing and previewing video data in a limited storage space in the firmware field of a Baseboard Management Controller (BMC). Background Art
[0002] To trace the anomalies that occur during the operation of a server, server manufacturers generally loop-record the screen data (or host video memory data) of the server host through the BMC and save it as a video file (or screen recording file). After an anomaly occurs in the server host, the host screen information at the time of the anomaly is confirmed by reviewing the recorded video format file.
[0003] To implement screen recording of the server host, firmware manufacturers usually capture the video memory data of the server host periodically (such as 30 frames per second), convert it into pictures (such as in jpeg format), and save the continuous image data together with the time stamp generated by the image as a video file.
[0004] In the field of computer BMC firmware, flash devices are usually 32MB or 64MB, and the writable storage space is usually less than 10M. Under such conditions, firmware manufacturers hope that the video file can be as small as possible, and at the same time, they hope that the video file can save the screen data of the server host for as long as possible to provide more information.
[0005] To achieve the above objectives, the following solutions are usually adopted:
[0006] Solution 1. Increase the picture compression ratio or reduce the picture quality to make each frame of the picture occupy less space;
[0007] Solution 2. Appropriately increase the picture capture period without seriously reducing the smoothness, so that the video file contains fewer pictures per unit time;
[0008] Solution 3. The image frame records the image difference area (usually in a rectangle). Specifically, except for the first frame that records the complete host screen data (or complete host video memory data), subsequent image frames only record the coordinates of the area where the host screen display data has changed compared to the previous image frame (including the coordinates of the upper left pixel point of the rectangular area relative to the screen origin (0, 0)), the size of the image area (the length and width of the rectangular area), and the screen display data within this area. No new image frames are generated when the screen display does not change.
[0009] Compared with Solution 1 and Solution 2, Solution 3 can store video files for a longer time. However, the drawback of Solution 3 is that when the mouse is placed at a certain point on the progress bar to preview the video content, since only the images of the areas where the host screen data has changed are recorded for the subsequent frames except the first frame, the preview program cannot display the image frame of the complete host screen data corresponding to the progress point where the mouse is located. Summary of the Invention
[0010] The present invention provides a method for storing and previewing video data, aiming to solve the problem that the preview program in Solution 3 cannot display the image frame of the complete host screen data corresponding to the progress point where the mouse is located.
[0011] The present invention provides a method for storing and previewing video data, and the method includes: The BMC starts a timer for timing the duration of the cycle for capturing a complete screen image frame according to the duration of the cycle for capturing a complete screen image frame, and captures the host video memory data; within the total screen recording duration, stores the screen difference frames, and stores the complete screen image frames according to each timing cycle of the timer, so as to form a screen recording file; when playing back the screen recording file, sequentially plays the complete screen image frames and the complete screen image frames restored according to the screen difference frames; when previewing the screen recording file, finds and displays the complete screen image frame closest to the preview position.
[0012] Preferably, before starting a timer for timing the duration of the cycle for capturing a complete screen frame according to the duration of the cycle for capturing a complete screen image frame, and capturing the host screen image data, the method further includes: determining the duration of the cycle for capturing a complete screen image frame according to the time granularity required for previewing the screen recording file.
[0013] Preferably, the complete screen image frame includes a first complete screen image frame. After determining the duration of the cycle for capturing a complete screen image frame according to the time granularity required for previewing the screen recording file, the method further includes: capturing the host video memory data for the first time, and backing up the host video memory data captured for the first time to the memory; converting the host video memory data captured for the first time into a first complete screen image frame, and saving the first complete screen image frame in the storage space.
[0014] Preferably, the starting a timer for timing the duration of the cycle for capturing a complete screen frame according to the duration of the cycle for capturing a complete screen image frame, and capturing the host video memory data includes: after saving the first complete screen image frame in the storage space, starting a timer for timing the duration of the cycle for capturing a complete screen frame according to the duration of the cycle for capturing a complete screen image frame; within each timing cycle of the timer, capturing the host video memory data according to the host video memory data capture rate, and backing up the host video memory data captured each time to the memory.
[0015] Preferably, the complete screen image frame further includes a second complete screen image frame. During the total screen recording duration, screen difference frames are stored, and complete screen image frames are stored according to each timing period of the timer. Thus, the screen recording file formed includes: during the total screen recording duration, screen difference frames of the host video memory data captured are sequentially saved in the storage space, where the screen difference frames are obtained by converting the difference data between the current host video memory data and the host video memory data captured and backed up in the memory last time; at each timing period of the timer, when the timer times out, a second complete screen image frame of the host video memory data captured is saved in the storage space.
[0016] Preferably, when playing back the screen recording file, sequentially playing the complete screen image frames and the complete screen image frames restored according to the screen difference frames includes: when playing back the screen recording file, playing the first complete screen image frame; after playing the first complete screen image frame, sequentially playing the complete screen image frames restored according to the screen difference frames and the second complete screen image frames of each timing period.
[0017] Preferably, when previewing the screen recording file, finding and displaying a complete screen image frame closest to the preview position includes: determining the distance between the preview position and the starting point of the progress bar according to the preview position and the starting point of the progress bar; determining the duration corresponding to the distance between the preview position and the starting point of the progress bar according to the distance between the preview position and the starting point of the progress bar, the length of the progress bar, and the total screen recording duration; determining a complete screen image frame closest to the preview position according to the duration corresponding to the distance between the preview position and the starting point of the progress bar and the duration of the complete screen image frame capture period, and displaying the determined complete screen image frame closest to the preview position.
[0018] Preferably, a complete screen image frame closest to the preview position specifically refers to the complete screen image frame closest to the preview position in front of the preview position.
[0019] Preferably, the duration corresponding to the distance between the preview position and the starting point of the progress bar is determined by the following formula: where t current is the duration corresponding to the distance between the preview position and the starting point of the progress bar; s current is the distance between the preview position and the starting point of the progress bar; s total is the length of the progress bar; s total is the total screen recording duration.
[0020] Preferably, the complete screen frame near the preview position is determined by the following formula: n = t current / t periodic ; where n is the number of the complete screen frame, and the initial number is 0; t periodicIt is the duration of the full-screen frame capture cycle.
[0021] The present invention provides a method for storing and previewing video data. It can reduce the size of the screen recording file by recording the screen difference frames, and during the playback of the screen recording file, when the mouse is placed at different preview positions (or progress points) on the progress bar, it can quickly display the full-screen image frame closest to the preview position for browsing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of the method for storing and previewing video data provided by the present invention;
[0023] Figure 2 It is a schematic diagram of the recording process of the host screen image data;
[0024] Figure 3 It is a schematic diagram of the playback and preview process of the screen recording file. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0026] See Figure 1 , the present invention provides a method for storing and previewing video data, and the method may include:
[0027] Step S101: The BMC starts a timer for timing the duration of the full-screen image frame capture cycle according to the duration of the full-screen image frame capture cycle, and captures the host video memory data.
[0028] Among them, the host video memory data is captured at a host video memory data capture rate, such as 30 frames per second, and the host video memory data captured each time is backed up to the memory.
[0029] Step S102: During the total screen recording duration, the screen difference frames are stored, and the full-screen image frames are stored according to each timing cycle of the timer, thereby forming a screen recording file.
[0030] Among them, each time the stored screen difference frame can be obtained through the following steps: capturing the host video memory data, comparing the current host video memory data with the host video memory data captured and backed up to the memory last time to obtain the difference data, and converting the difference data into a screen difference frame. Among them, the difference data includes the area coordinates where the difference occurs and the host display data within the area. The conversion of the difference data into a screen difference frame may specifically be converting the host video memory data within the area where the difference occurs into a screen difference frame.
[0031] Step S103: When playing back the screen recording file, sequentially play the full-screen image frames and the full-screen image frames restored according to the screen difference frames.
[0032] Among them, the full-screen image frame restored from each screen difference frame can be obtained through the following steps: Obtain a full-screen frame that is before the current screen difference frame and closest to the current screen frame, and all the screen difference frames between the current screen difference frame and this full-screen frame. By adding up this full-screen frame, all the screen difference frames between the current screen difference frame and this full-screen frame, and the current screen frame, the full-screen image frame restored according to the current screen frame is obtained.
[0033] Step S104: When previewing the screen recording file, find and display a full-screen image frame closest to the preview position.
[0034] Among them, a full-screen image frame closest to the preview position can refer to the full-screen image frame that is closest to the preview position and in front of the preview position (i.e., the closest historical full-screen image frame to the preview position), or can refer to the full-screen image frame that is closest to the preview position and behind the preview position, or can also refer to the full-screen image frame that is closest to the preview position among the former two.
[0035] It can be seen that according to the cycle duration of capturing full-screen image frames, the total screen recording duration is divided into multiple time periods. In each time period, multiple screen difference frames and one full-screen image frame are captured, so that the screen recording file is formed by the frames captured in chronological order. In this way, within the limited storage space of the BMC firmware, since a large number of screen difference frames are recorded, the size of the screen recording file can be reduced and the total screen recording duration can be increased. On this basis, since there is a full-screen image frame in each time period, when previewing the screen recording file, a full-screen image frame closest to the preview position can be displayed, solving the problem in the prior art that the preview program cannot display the full-screen image frame corresponding to the preview position where the mouse is located.
[0036] In the above method, the full-screen image frame may include a first full-screen image frame converted from the host video memory data captured for the first time and multiple second full-screen image frames converted from multiple host video memory data captured through step S101. Specifically, before executing step S101, according to the time granularity required for previewing the screen recording file, the duration of the cycle for capturing the full-screen image frame is determined. Then, the host video memory data is captured for the first time, the host video memory data captured for the first time is backed up to the memory, and the host video memory data captured for the first time is converted into a first full-screen image frame, and the first full-screen image frame is saved in the storage space. After saving the first full-screen image frame in the storage space, step S101 is executed, that is, within the total screen recording duration, the screen difference frames of the captured host video memory data are sequentially saved in the storage space, and when each timing cycle of the timer within the total screen recording duration times out, the second full-screen image frame of the captured host video memory data is saved in the storage space. Obviously, according to the timing cycle of the timer, the total screen recording duration is divided into multiple time periods, and multiple screen difference frames and a second full-screen image frame are saved in the storage space for each time period. The second full-screen image frame is obtained and stored at the end of the time period (that is, when the timer times out).
[0037] In this way, when playing back the screen recording file, the first full-screen image frame is played first. After playing the first full-screen image frame, the full-screen image frames restored according to the screen difference frames and the second full-screen image frame of each timing cycle are played sequentially. When the mouse is placed at the preview position of the progress bar during the playback of the screen recording file, according to the preview position and the starting point of the progress bar, the distance between the preview position and the starting point of the progress bar is determined, and according to the distance between the preview position and the starting point of the progress bar, the length of the progress bar, and the total screen recording duration, the duration corresponding to the distance between the preview position and the starting point of the progress bar is determined. Then, according to the duration corresponding to the distance between the preview position and the starting point of the progress bar and the duration of the cycle for capturing the full-screen image frame, the full-screen image frame closest to the preview position is determined, and the determined full-screen image frame closest to the preview position is displayed, achieving that when previewing a video file, when the mouse is placed at a certain progress point on the progress bar, the preview program can load a full-screen image frame corresponding to the progress point of the mouse into the preview window, and achieving the purpose of quickly previewing the video content without adjusting the playback progress.
[0038] The following combines Figure 2 and Figure 3 to describe in detail the video data storage and preview method of the present invention.
[0039] In the present invention, the first frame captures the entire screen area, and subsequently, within each timing period of the timer, only the area that has changed compared to the previous frame of the screen image at that time is captured and saved to the screen recording file. Additionally, to facilitate quickly browsing through images containing the complete host video memory data by dragging the progress bar during video playback, a certain number of time points (i.e., the time points when the timer times out each time) are preset within the total duration of the screen recording. When reaching these time nodes, a frame of the entire screen area image is captured and saved to the screen recording file. When dragging the progress bar, the previous complete screen image frame before the time node of the progress bar is displayed in the browsing frame for preview.
[0040] See Figure 2 , the specific steps for storing video data in the present invention may include:
[0041] Step S201: The screen recording program is started and initialized.
[0042] The screen recording program is started through the BMC browser page or command line and begins initialization.
[0043] Step S202: Select or set the time granularity required for video preview (or the time granularity required for previewing the screen recording file), and determine the duration of the cycle for capturing the complete screen image frame (or the duration of the cycle for the host full-screen data).
[0044] The screen recording program automatically selects or manually selects / sets the time granularity required for video preview. For example, there are 2 complete screen image frames per second. According to this time granularity, the duration of the cycle for capturing the complete screen image frame is determined. Suppose it is denoted as t periodic milliseconds (which can also be abbreviated as t milliseconds), such as 500 milliseconds.
[0045] Step S203: Capture the complete data of the host video memory (or the host full-screen image data), and start the timer Timer with an overtime duration of t periodic milliseconds.
[0046] The screen recording program reads the complete data of the host video memory (or the host full-screen image data), converts it into a complete screen image frame, and saves it to the screen recording file together with the time stamp corresponding to the generation time of this complete screen image frame (this time stamp needs to change linearly with time and cannot be adjusted). The complete data of the host video memory is backed up to the memory for subsequent use during the calculation of the changed area of the screen. Subsequently, a timer Timer with a duration of t periodic milliseconds is started.
[0047] Step S204: Determine whether the screen recording has ended.
[0048] Specifically, it is determined whether the screen recording duration has been reached and whether the user has clicked the stop screen recording button. If the screen recording duration has been reached or the user has clicked the stop screen recording button, it is determined that the screen recording ends, and step S207 is executed; otherwise, step S205 is executed.
[0049] Step S205: Determine whether the timer Timer times out.
[0050] If the timer Timer times out, step S203 is executed.
[0051] If the timer Timer does not time out, step S206 is executed.
[0052] Step S206: Capture the host video memory difference data (or the host screen image difference area data).
[0053] The screen recording program compares the current host video memory data with the previously backed-up host video memory data to obtain the rectangular area on the host screen that has changed relative to the previous frame, as follows:
[0054] 1. Area coordinates (the coordinates of the upper-left pixel point of the rectangular area relative to the screen origin (0, 0));
[0055] 2. Area size (the length and width of the rectangular area);
[0056] 3. The image frame converted from the host video memory data within the rectangular area and the time stamp corresponding to the generation time of this image frame.
[0057] The rectangular area on the host screen that has changed relative to the previous frame is saved to the screen recording file, and then the current host video memory data (i.e., the complete video memory data) is backed up to the memory for use during subsequent calculation of the screen change area, and then step S204 is executed.
[0058] Step S207: Save the captured full-screen image frame cycle duration t periodic to the screen recording file and end the screen recording.
[0059] See Figure 3 , the specific steps of the video data preview of the present invention may include:
[0060] Step S301: Start the screen recording playback function.
[0061] Start the screen recording file playback function. The playback program reads the content of the screen recording file, at least including the full-screen image frame, the screen difference frame, the time stamp of each frame, and the captured full-screen image frame cycle duration t periodic , for screen recording file playback.
[0062] Among them, according to the end frame time stamp and the start frame time stamp in the screen recording file, the total screen recording duration t can be calculatedtotal , specifically, the time difference between the end frame timestamp and the start frame timestamp.
[0063] Step S302: During the playback of the screen recording file, determine whether to perform a preview.
[0064] During the playback of the screen recording file, detect the position of the mouse cursor. If the mouse cursor is placed on the progress bar, then use the position of the mouse cursor on the progress bar as the preview position (or progress point). At this time, determine to perform a preview and sequentially execute Step S303 and Step S304. Otherwise, continue to detect the position of the mouse cursor until the end of the screen recording playback.
[0065] Step S303: Find a complete screen image frame closest to the preview position.
[0066] Step S304: Load a complete screen image frame closest to the preview position to display the complete screen image frame closest to the preview position that has been found.
[0067] It should be noted that the playback window and the preview window of the screen recording file are usually implemented as two independent windows. During the preview process, the playback window plays the screen recording file normally, and the preview window appears near the mouse and displays a complete screen image frame closest to the preview position.
[0068] Taking the example that the complete screen image frame closest to the preview position is the complete screen image frame closest to the preview position in front of the preview position, determine the distance s between the preview position and the start point of the progress bar according to the preview position and the start point of the progress bar current , and according to the distance s between the preview position and the start point of the progress bar current , the length s of the progress bar total , the total screen recording duration t total , use the formula to determine the duration t corresponding to the distance between the preview position and the start point of the progress bar current , and then according to the duration t corresponding to the distance between the preview position and the start point of the progress bar current and the cycle duration t of capturing a complete screen image frame periodic , use the formula to determine the number of the complete screen image frame closest to the preview position and display the nth complete screen image frame.
[0069] In short, assuming the length of the progress bar is S total , when the mouse is placed on the progress bar and the distance from the start point of the progress bar is S current , the playback program can obtain the nth complete screen image frame to be loaded (n is rounded, n = 0, 1, 2...) through the following formula , and then load this frame into the preview window to achieve previewing the video content.
[0070] It can be known through Figure 2 and Figure 3 that the present invention can not only enable the screen recording program to reduce the size of the screen recording file by recording the different regions (or different frames) of the host screen, but also, after the host screen recording is completed, support maintenance personnel to place the mouse at different preview positions on the playback progress bar to quickly preview the image that is the closest to this progress point in history and contains the complete host video memory data.
[0071] In addition, the present invention can also provide a computer-readable medium, on which a program for the video data storage and preview method is stored, and when the program is executed by a processor, the steps of the above-mentioned video data storage and preview method are implemented.
[0072] When previewing the screen recording file of the present invention, when the mouse is placed at a certain point on the progress bar, the preview program can load the complete screen image frame near the progress point corresponding to the mouse into the preview window, achieving the purpose of quickly previewing the video content without adjusting the playback progress during the playback of the screen recording file.
[0073] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and the scope of the rights of the present invention is not limited thereby. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the present invention shall fall within the scope of the rights of the present invention.
Claims
1. A method for storing and previewing video data, characterized in that, The method includes: The Baseboard Management Controller (BMC) starts a timer for timing the duration of the full-screen image capture frame cycle according to the duration of the full-screen image capture frame cycle, and captures the host video memory data. During the total screen recording duration, the screen difference frames are stored, and the full-screen image frames are stored according to each timing period of the timer, thereby forming a screen recording file. When playing back the screen recording file, the full-screen image frames and the full-screen image frames restored according to the screen difference frames are played sequentially. When previewing the screen recording file, the full-screen image frame closest to the preview position is found and displayed.
2. The method according to claim 1, characterized in that, Before starting a timer for timing the duration of the full-screen frame capture cycle according to the duration of the full-screen image capture frame cycle and capturing the host screen image data, the method further includes: Determining the duration of the full-screen image capture frame cycle according to the time granularity required for previewing the screen recording file.
3. The method according to claim 2, characterized in that, The full-screen image frame includes a first full-screen image frame. After determining the duration of the full-screen image capture frame cycle according to the time granularity required for previewing the screen recording file, the method further includes: Capturing the host video memory data for the first time and backing up the captured host video memory data to the memory. Converting the captured host video memory data for the first time into a first full-screen image frame and saving the first full-screen image frame in the storage space.
4. The method according to claim 3, characterized in that, The step of starting a timer for timing the duration of the full-screen frame capture cycle according to the duration of the full-screen image capture frame cycle and capturing the host video memory data includes: After saving the first full-screen image frame in the storage space, starting a timer for timing the duration of the full-screen frame capture cycle according to the duration of the full-screen image capture frame cycle. During each timing period of the timer, capturing the host video memory data at the host video memory data capture rate, and backing up the captured host video memory data to the memory each time.
5. The method according to claim 4, characterized in that, The full-screen image frame further includes a second full-screen image frame. The step of storing the screen difference frames during the total screen recording duration and storing the full-screen image frames according to each timing period of the timer includes: During the total screen recording duration, sequentially saving the screen difference frames of the captured host video memory data in the storage space, where the screen difference frames are obtained by converting the difference data between the current host video memory data and the host video memory data captured and backed up to the memory last time. During each timing period of the timer, when the timer times out, saving the second full-screen image frame of the captured host video memory data in the storage space.
6. The method according to claim 5, characterized in that, The step of sequentially playing the full-screen image frames and the full-screen image frames restored according to the screen difference frames when playing back the screen recording file includes: When playing back the screen recording file, playing the first full-screen image frame. After playing the first full-screen image frame, sequentially playing the full-screen image frames restored according to the screen difference frames and the second full-screen image frames of each timing period.
7. The method according to claim 1, characterized in that, The step of finding and displaying the full-screen image frame closest to the preview position when previewing the screen recording file includes: Determine the distance between the preview position and the starting point of the progress bar according to the preview position and the starting point of the progress bar; Determine the duration corresponding to the distance between the preview position and the starting point of the progress bar according to the distance between the preview position and the starting point of the progress bar, the length of the progress bar, and the total screencasting duration; Determine the closest complete screen image frame to the preview position according to the duration corresponding to the distance between the preview position and the starting point of the progress bar and the duration of the complete screen image frame capture period, and display the determined closest complete screen image frame to the preview position.
8. The method according to claim 7, characterized in that, The closest complete screen image frame to the preview position specifically refers to the complete screen image frame closest to the preview position in front of the preview position.
9. The method according to claim 8, characterized in that, Determine the duration corresponding to the distance between the preview position and the starting point of the progress bar through the following formula: Among them, t current is the duration corresponding to the distance between the preview position and the starting point of the progress bar; s current is the distance between the preview position and the starting point of the progress bar; s total is the length of the progress bar; t total is the total screencasting duration.
10. The method according to claim 9, characterized in that, Determine the closest complete screen image frame to the preview position in front of the preview position through the following formula: where n is the number of full-screen image frames, with the initial number being 0; t periodic is the duration of the full-screen frame capture period.