Screen recording methods, devices, electronic devices, storage media, and software products
By acquiring the different video frames during screen recording, and using neural networks and video generation models to generate the recorded video, the problem of insufficient memory during screen recording is solved, achieving efficient memory utilization and maintaining the quality of the recorded video.
Patent Information
- Application Number
- CN202310311647.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-03-21
AI Technical Summary
The image frames generated during screen recording consume a lot of memory, which can easily cause electronic devices to run out of memory.
By acquiring the difference video frames between each non-first frame video frame and the first frame video frame in the corresponding scene during screen recording, and using a neural network model and video generation model, the recorded video is generated, reducing the data requirements for non-first frame video frames and only acquiring the difference video frames to reduce memory overhead.
It effectively reduces the memory usage of video frames during screen recording, avoiding the problem of insufficient memory in electronic devices, while not affecting the quality of the recorded video, and simplifies the complexity of screen recording methods.
Smart Images

Figure CN116471441B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a screen recording method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] With the development of communication technology, electronic devices are becoming more and more popular, and their functions are becoming more and more powerful, providing various electronic services and making life and work more convenient for people.
[0003] Screen recording is a common service provided by electronic devices, which can be achieved by triggering the built-in screen recording function of the electronic device system. However, during the screen recording process, the generated image frames are cached, which consumes a lot of memory and can easily lead to memory shortage problems in electronic devices. Summary of the Invention
[0004] Therefore, it is necessary to provide a screen recording method, device, electronic device, storage medium, and program product to address the above-mentioned technical problems, which can reduce the memory overhead of image frames during screen recording and avoid the problem of insufficient memory in electronic devices.
[0005] Firstly, this application provides a screen recording method, the method comprising:
[0006] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0007] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0008] Recorded videos are generated from video segments of various scenes.
[0009] In one embodiment, the method further includes:
[0010] During screen recording, capture the current video frame being recorded;
[0011] Determine whether the scene of the current video frame meets the preset conditions compared to the scene of the previous video frame;
[0012] If the preset conditions are not met, the current video frame will be determined as the first video frame in the scene corresponding to the current video frame.
[0013] If the preset conditions are met, the current video frame will be determined as a non-first video frame in the scene corresponding to the previous video frame.
[0014] In one embodiment, acquiring the difference video frames between each non-first frame video frame and the first frame video frame in each scene during screen recording includes:
[0015] Acquire each non-first frame video frame and the first frame video frame in each scene;
[0016] The difference between each non-first frame video frame in each scene and the first frame video frame in the corresponding scene is obtained to obtain the difference video frame.
[0017] In one embodiment, the video segment for each scene is determined based on the first video frame and the different video frames in each scene, including:
[0018] Based on the video frame recording sequence for any given scene, and the first video frame and the corresponding difference video frames in any given scene, the video segment for any given scene is determined; the video frame recording sequence is the recording order of the first video frame and each non-first video frame in any given scene.
[0019] In one embodiment, the video segment for each scene is determined based on the first video frame and the different video frames in each scene, including:
[0020] Based on the video frame recording sequence under different scenarios, and according to the first video frame under different scenarios and the video frames with differences under the corresponding scenarios, the video segments of each scenario are determined in parallel through multi-threading.
[0021] In one embodiment, the recorded video is generated from video segments of various scenes, including:
[0022] Obtain the scene recording order of each scene during screen recording;
[0023] The video segments from each scene during screen recording are merged according to the recording order to obtain the recorded video.
[0024] Secondly, this application provides a screen recording device, the device comprising:
[0025] The difference frame acquisition module is used to respond to screen recording instructions and acquire the difference video frames between each non-first frame video frame and the first frame video frame in the corresponding scene during screen recording.
[0026] The video segment determination module is used to determine the video segment for each scene based on the first video frame and the different video frames in each scene.
[0027] The video generation module is used to generate recorded videos from video segments of various scenes.
[0028] Thirdly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0029] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0030] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0031] Recorded videos are generated from video segments of various scenes.
[0032] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following steps:
[0033] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0034] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0035] Recorded videos are generated from video segments of various scenes.
[0036] Fifthly, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:
[0037] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0038] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0039] Recorded videos are generated from video segments of various scenes.
[0040] The screen recording method, apparatus, electronic device, storage medium, and program product provided in this application include: responding to a screen recording instruction, acquiring the difference video frames between each non-first frame video frame and the first frame video frame in each scene during the screen recording process; determining video segments for each scene based on the first frame video frame and each difference video frame; and generating a recorded video using the video segments of each scene. The above method does not require acquiring the large amount of non-first frame video frames in each scene during screen recording; it only needs to acquire the difference video frames between the non-first frame video frames and the first frame video frame in each scene. The memory occupied by the difference video frames is much smaller than that occupied by the non-first frame video frames, thereby significantly reducing the memory space occupied by video frames during screen recording, reducing the memory overhead of image frames during screen recording, and thus avoiding the problem of insufficient memory in electronic devices. Furthermore, the above method can also generate a recorded video based on the difference video frames and the first frame video frame. This process does not affect the quality of the generated recorded video, the implementation process is relatively simple, and the complexity of the screen recording method is reduced. Attached Figure Description
[0041] Figure 1 This is a diagram of the internal structure of an electronic device in one embodiment;
[0042] Figure 2 This is a flowchart illustrating a screen recording method in one embodiment;
[0043] Figure 3 This is a flowchart illustrating a screen recording method in another embodiment;
[0044] Figure 4 This is a flowchart illustrating a screen recording method in another embodiment;
[0045] Figure 5 This is a flowchart illustrating a screen recording method in another embodiment;
[0046] Figure 6 This is a structural block diagram of a screen recording device in one embodiment. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0048] In the computer field, applications such as automated testing, real-time monitoring, and remote control often require screen recording of the currently playing video on electronic devices—that is, recording the operation process on the electronic device. Screen recording is a common service provided by electronic devices, achieved by triggering the built-in screen recording function of the electronic device system. However, related technologies consume a lot of memory in the image frames generated during screen recording, easily leading to memory shortage problems in electronic devices. Therefore, this application provides a screen recording method that can reduce the memory overhead of image frames during screen recording and avoid the problem of insufficient memory in electronic devices.
[0049] The screen recording method provided in this application embodiment can be applied to, for example, Figure 1 The electronic device shown is an example of a screen recording method. This electronic device can be, but is not limited to, various personal computers, laptops, smartphones, and tablets; this embodiment does not limit the specific form of the electronic device. The following embodiments will specifically describe the detailed process of the screen recording method, using an electronic device as the execution subject.
[0050] like Figure 2 The diagram shown is a flowchart of a screen recording method provided in an embodiment of this application. The method may include the following steps:
[0051] S100, in response to the screen recording command, acquire the difference video frame between each non-first frame video frame in each scene during the screen recording process and the first frame video frame in the corresponding scene.
[0052] In this system, a user can trigger a screen recording command on an electronic device, meaning the user activates the screen recording function. The electronic device then receives and responds to the screen recording command. Optionally, the user can trigger the screen recording command through methods such as pressing a button, touching, speaking, gestures, or other actions.
[0053] In practical applications, after an electronic device responds to a screen recording command, it can obtain the difference video frames between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0054] Optionally, each non-first video frame has a corresponding difference video frame. The difference video frame can be understood as the difference information between the non-first video frame and the first video frame in the corresponding scene. Optionally, the first video frame can be the first video frame in different scenes, and other video frames after the first video frame in the same scene can be called non-first video frames.
[0055] During the entire screen recording process, video frames of at least one scene can be recorded. The recorded scene can be a meeting scene, a teaching scene, a speech scene, a ball game scene, or other types of scenes. This application embodiment does not limit this.
[0056] S200. Based on the first video frame and the different video frames in each scene, determine the video segment for each scene.
[0057] Specifically, the electronic device can pre-train a neural network model, and then input the first video frame and all the difference video frames in each scene during the screen recording process into the neural network model. The neural network model outputs video segments of each scene during the screen recording process. Optionally, the aforementioned neural network model can be a combination of at least one of lightweight network models (such as Squeeze), dense connection network models, transfer learning network models, and residual network models.
[0058] Furthermore, electronic devices can perform predictive processing on the first video frame and all differing video frames in each scene during screen recording to obtain non-first frame video frames for each scene. Then, video frame fusion processing is performed based on the first video frame and all non-first frame video frames in each scene to obtain video segments for each scene. In practical applications, non-first frame video frames corresponding to differing video frames can be generated using the differing video frames and the first video frame of the scene to which the differing video frames belong.
[0059] The prediction algorithm used in the prediction process can be an inter-frame image prediction algorithm, a fast disparity image prediction algorithm, or an image depth prediction algorithm, etc.
[0060] S300 generates recorded videos from video segments of various scenarios.
[0061] The electronic device can pre-train a video generation model, and then input video segments from each scene during screen recording into the video generation model, which outputs the recorded video. Optionally, the video generation model can be a combination of at least one of the following: convolutional neural network model, recurrent neural network model, multilayer perceptron neural network model, recurrent neural network model, deep belief network model, deep autoencoder, and generative adversarial network model.
[0062] The technical solution in this application embodiment, in response to a screen recording command, acquires the difference video frames between each non-first frame video frame and the first frame video frame in each scene during screen recording. Based on the first frame video frame and the difference video frames, it determines the video segments for each scene and generates a recorded video using these video segments. This method eliminates the need to acquire the large amount of data in the non-first frame video frames during screen recording; it only requires acquiring the difference video frames between the non-first frame video frames and the first frame video frame. The memory occupied by the difference video frames is significantly less than that occupied by the non-first frame video frames, thus greatly reducing the memory space occupied by video frames during screen recording and lowering the memory overhead of image frames. This avoids the problem of insufficient memory in electronic devices. Furthermore, the method can process the difference video frames and the first frame video frame to generate the recorded video without affecting the quality of the generated video.
[0063] In some scenarios, each video frame can be captured in real time during screen recording. Then, the first and non-first video frames for each scenario are obtained from each video frame. The process of obtaining the first and non-first video frames for each scenario is described below. In one embodiment, before executing S100 above to obtain the difference video frames between each non-first video frame and the corresponding first video frame during screen recording, as follows... Figure 3 As shown, the screen recording method described above can also be implemented in the following ways:
[0064] S400: During screen recording, acquire the current video frame being recorded.
[0065] Once the electronic device responds to the screen recording command, it begins the screen recording operation and can capture each video frame in real time during the screen recording process.
[0066] S500: Determine whether the scene of the current video frame and the scene of the previous video frame meet the preset conditions.
[0067] It's important to note that during screen recording, each recorded video frame can be referred to as the current video frame. Specifically, for the current video frame, the electronic device can acquire both the current video frame and the previous video frame. Then, a background extraction algorithm is used to extract the background of both the current and previous video frames, resulting in the background images of the current and previous frames. Each pixel in the background images of the current and previous frames is compared, and based on the comparison results, it is determined whether the scene of the current video frame meets the preset conditions of the scene in the previous video frame.
[0068] Optionally, the background extraction algorithm described above can be a combination of at least one of the following: inter-frame differencing, background differencing, and foreground detection algorithms. Furthermore, the preset conditions can be the relationship between the attribute information of objects in the scene of the current video frame and the scene of the previous video frame. Optionally, the object attribute information can be the pixel area of the object in the video frame, or the resolution of the area of the image occupied by the object in the video frame, etc.
[0069] In this embodiment of the application, the aforementioned preset condition is that the scene of the current video frame is the same as the scene of the previous video frame. Specifically, if the comparison result shows that every pixel in the background image of the current video frame and the background image of the previous video frame is the same, it can be determined that the scene of the current video frame and the scene of the previous video frame satisfy the preset condition, that is, the scene of the current video frame is the same as the scene of the previous video frame.
[0070] Meanwhile, in practical applications, the clarity of different video frames may vary slightly. Therefore, a certain range of error values can be set. Correspondingly, a setting can be set where the proportion of identical pixels in the background image reaches a certain value to determine that the scene of the current video frame is the same as the scene of the previous video frame. For example, if the comparison result shows that 90%, 95%, or 98% or more of the pixels in the background image of the current video frame and the background image of the previous video frame are the same, it can be determined that the scene of the current video frame meets the preset conditions.
[0071] In addition, after obtaining the background image of the current video frame and the background image of the previous video frame, the electronic device can also use a similarity algorithm to calculate the similarity value between the background image of the current video frame and the background image of the previous video frame, and determine whether the obtained similarity value is greater than or equal to a preset similarity threshold. If so, it is determined that the scene of the current video frame and the scene of the previous video frame meet the preset conditions; otherwise, it is determined that the scene of the current video frame and the scene of the previous video frame do not meet the preset conditions.
[0072] Optionally, the aforementioned similarity algorithm can be a histogram similarity algorithm, a hash algorithm, an image matching algorithm, etc., wherein the aforementioned hash algorithm can be an average hash algorithm, a perceptual hash algorithm, or a difference hash algorithm, etc., and the aforementioned image matching algorithm can be a scale-invariant feature transformation algorithm, a key point matching algorithm, a local feature matching algorithm, etc.
[0073] It should be noted that the similarity value between the background image of the current video frame and the background image of the previous video frame can be any value between 0 and 1. The closer the similarity value is to 1, the more identical the scene of the current video frame is to the scene of the previous video frame. The closer the similarity value is to 0, the more completely different the scene of the current video frame is from the scene of the previous video frame.
[0074] In practical applications, in order to set a certain range of error values, the preset similarity threshold can naturally be set to a value less than 1. Optionally, the preset similarity threshold can be a custom value or a value determined based on historical experience values; this embodiment of the application does not limit this.
[0075] S600 If the preset conditions are not met, the current video frame will be determined as the first video frame in the scene corresponding to the current video frame.
[0076] If the judgment result determines that the scene of the current video frame does not meet the preset conditions with the scene of the previous video frame, that is, the scene of the current video frame is different from the scene of the previous video frame, it indicates that the scene of the current video frame is a new scene. At this time, the current video frame can be determined as the first video frame in the new scene.
[0077] S700 If the preset conditions are met, the current video frame is determined to be a non-first video frame in the scene corresponding to the previous video frame.
[0078] If the judgment result determines that the scene of the current video frame meets the preset conditions with the scene of the previous video frame, it indicates that the scene of the current video frame is an old scene. At this time, the current video frame can be identified as a non-first video frame in the old scene.
[0079] The technical solution in this application embodiment acquires the current video frame during screen recording, determines whether the scene of the current video frame and the scene of the previous video frame meet preset conditions. If the preset conditions are not met, the current video frame is determined as the first video frame in the scene corresponding to the current video frame; if the preset conditions are met, the current video frame is determined as a non-first video frame in the scene corresponding to the previous video frame. This method can determine whether the current video frame is the first or non-first video frame in the corresponding scene by comparing the scene of the current video frame with the scene of the previous video frame during recording. This process is relatively simple and does not require manual intervention. It can not only improve the speed and efficiency of acquiring the first and non-first video frames, but also save manpower costs in the processing.
[0080] The process of obtaining the difference video frames between each non-first frame and the first frame in each scene during screen recording is described below. In one embodiment, as... Figure 4 As shown, the steps in S100 above can be implemented in the following ways:
[0081] S110. Obtain each non-first frame video frame and the first frame video frame in each scene.
[0082] Specifically, during screen recording, the electronic device can sequentially acquire the first video frame and each non-first video frame in each scene according to the recording order of different scenes.
[0083] For example, if there are 3 scenes in the screen recording, and the recording order of the 3 scenes during the screen recording process is scene 1, scene 2 and scene 3, where scene 1 includes video frames 1, 2 and 3, scene 2 includes video frames 4 and 5, and scene 3 includes video frames 6, 7 and 8, then the electronic device can first acquire video frame 1 (the first video frame) and non-first video frames (including video frames 2 and 3) in scene 1, then acquire video frame 4 (the first video frame) and non-first video frames (including video frame 5) in scene 2, and then acquire video frame 6 (the first video frame) and non-first video frames (including video frames 7 and 8) in scene 3.
[0084] S120. Subtract the first video frame from the first video frame in each scene to obtain the difference video frame.
[0085] In practical applications, for each non-first frame video frame in any scenario, the electronic device can process the non-first frame video frame and the first frame video frame in the scenario to which the non-first frame video frame belongs, to obtain the difference video frame between the non-first frame video frame and the first frame video frame in the corresponding scenario.
[0086] However, in the embodiments of this application, for each non-first frame video frame in any scenario, the electronic device can subtract the first frame video frame in the corresponding scenario from the non-first frame video frame in the scenario to which the first frame video frame belongs, to obtain the difference video frame between the non-first frame video frame and the first frame video frame in the corresponding scenario.
[0087] The technical solution in this application embodiment obtains each non-first frame video frame and the first frame video frame in each scenario, and subtracts each non-first frame video frame from the first frame video frame in the corresponding scenario to obtain a difference video frame. This method can obtain a difference video frame with a smaller data volume corresponding to each non-first frame video frame in each scenario and the first frame video frame in the corresponding scenario. This process will not affect the effect of generating the recorded video, and this process can make the video frames occupy less memory space during the screen recording process, which can avoid the problem of insufficient memory of electronic devices during the screen recording process.
[0088] In some scenarios, recording video frames for each scenario can generate a video segment for that scenario; that is, video segments for each scenario are generated sequentially. The process of generating video segments for each scenario is described below. In one embodiment, the step in S200 above, which determines the video segment for each scenario based on the first video frame and each differing video frame, may include: determining the video segment for any scenario based on the video frame recording sequence for any given scenario, and based on the first video frame and the differing video frames for the corresponding scenario. The video frame recording sequence is the recording order of the first video frame and each non-first video frame in any given scenario.
[0089] In practical applications, electronic devices can mark the recording order of each first video frame and each non-first video frame according to the recording order of each video frame in each scene during screen recording. Then, the video frame recording sequence is determined based on the video frame recording order marks of each first video frame and each non-first video frame in any scene. In the embodiments of this application, the video frame recording order can be understood as the video frame recording sequence. Optionally, the video frame recording order mark can be carried in both the first video frame and non-first video frames.
[0090] It should be noted that once the first video frame and all the difference video frames of non-first video frames in a scene are obtained, the first video frame and all the difference video frames in the corresponding scene can be combined according to the video frame recording sequence to obtain a video segment.
[0091] In addition, electronic devices can pre-train an algorithm model, and then, for any given scene, input the first video frame of the scene, all the different video frames in the corresponding scene, and the video frame recording sequence of the corresponding scene into the algorithm model. The algorithm model then outputs the video segment of the corresponding scene.
[0092] In other scenarios, after recording video frames for all scenarios, video segments for all scenarios can be generated in parallel, that is, video segments for all scenarios are generated synchronously. The process of generating video segments for all scenarios in parallel is described below. In one embodiment, the step of determining the video segment for each scenario in S200 above based on the first video frame and the different video frames in each scenario may include: determining the video segment for each scenario in parallel using multi-threading according to the video frame recording sequence for different scenarios and based on the first video frame and the different video frames in the corresponding scenarios.
[0093] Optionally, the electronic device can also input the first video frame, the difference video frame, and the video frame recording sequence of different scenes in all recorded scenes into the algorithm model, which outputs video segments of all scenes in parallel.
[0094] In this embodiment of the application, after the screen recording function is turned off, the electronic device can obtain the first video frame and the difference video frame in all recorded scenarios. Then, based on the video frame recording sequence in each scenario, the first video frame and the difference video frame in each scenario can be combined in parallel by multiple threads to generate video frames in each scenario.
[0095] It should be noted that the number of threads can be equal to the total number of all scenes recorded on the screen. Each thread performs the same function: combining the first video frame of any scene with the different video frames in the corresponding scene to generate the video frame for that scene.
[0096] The technical solution in this application embodiment determines the video segment for any scene based on the video frame recording sequence for any scene and the first video frame and the difference video frames in the corresponding scene. This method can generate video segments for each scene based on the first video frame and the difference video frames of non-first video frames with small data volume. Furthermore, the generation of video segments does not require a large amount of memory space; only the difference video frames with small data volume require minimal memory space to generate the corresponding video segments. This further avoids the problem of insufficient memory on electronic devices during screen recording.
[0097] The process of generating recorded videos from video segments of various scenarios is described below. In one embodiment, as... Figure 5 As shown, the steps in S300 above may include:
[0098] S310. Obtain the scene recording order of each scene during the screen recording process.
[0099] During screen recording, the recording order of each scene can be obtained sequentially.
[0100] S320. According to the scene recording order, merge the video segments of each scene during the screen recording process to obtain the recorded video.
[0101] In practical applications, electronic devices can mark the video segments of each scene according to the recording order, meaning each video segment carries a scene sequence mark. The electronic device can then match the scene sequence marks in each video segment with the recording order, sort the video segments based on the matching results, and finally fuse the sorted video segments to obtain the recorded video. Optionally, this fusion process can be understood as a simple combination process.
[0102] Additionally, the electronic device can train a fusion network model, and then input the scene recording order and video segments of each scene during screen recording into the fusion network model, which outputs the recorded video. Optionally, the fusion network model can be composed of at least one combination of a multimodal fusion model, a generative adversarial network model, a convolutional neural network model, a fully connected network model, etc.
[0103] The technical solution in this application embodiment obtains the scene recording order of each scene during screen recording, and performs fusion processing on the video segments of each scene during screen recording according to the scene recording order to obtain a recorded video. This method can perform fusion processing on each video segment according to the scene recording order of each scene during recording to generate a recorded video with high accuracy, and can avoid the situation of scene disorder in the generated recorded video.
[0104] In one embodiment, this application also provides a screen recording method, which includes the following steps:
[0105] (1) In response to a screen recording command, during screen recording, the current video frame being recorded is obtained.
[0106] (2) Determine whether the scene of the current video frame and the scene of the previous video frame meet the preset conditions.
[0107] (3) If the preset conditions are not met, the current video frame is determined as the first video frame in the scene corresponding to the current video frame; if the preset conditions are met, the current video frame is determined as the non-first video frame in the scene corresponding to the previous video frame.
[0108] (4) Obtain each non-first frame video frame and the first frame video frame in each scene.
[0109] (5) Subtract the first video frame from the first video frame in each scene to obtain the difference video frame.
[0110] (6) Determine the video segment for each scene based on the first video frame and the different video frames in each scene.
[0111] The step in (6) can be implemented in two ways, the first of which includes:
[0112] (61) According to the video frame recording sequence in any scene, the video segment in any scene is determined based on the first video frame in any scene and the video frame with difference in the corresponding scene; the video frame recording sequence is the recording order of the first video frame and each non-first video frame in any scene.
[0113] The second method includes:
[0114] (62) Based on the video frame recording sequence under different scenarios, the video segments of each scenario are determined in parallel by multi-threading according to the first video frame under different scenarios and the video frames with differences under the corresponding scenarios.
[0115] (7) Obtain the scene recording order of each scene during the screen recording process.
[0116] (8) According to the scene recording order, the video segments of each scene during the screen recording process are merged to obtain the recorded video.
[0117] For details of the execution process of (1) to (8) above, please refer to the description of the above embodiments. The implementation principle and technical effect are similar, and will not be repeated here.
[0118] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0119] Based on the same inventive concept, this application also provides a screen recording apparatus for implementing the screen recording method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more screen recording apparatus embodiments provided below can be found in the limitations of the screen recording method described above, and will not be repeated here.
[0120] In one embodiment, Figure 6 This is a schematic diagram of a screen recording device in one embodiment of this application. The screen recording device provided in this embodiment can be applied to electronic devices. Figure 6 As shown, the screen recording device of this application embodiment may include: a difference frame acquisition module 11, a video segment determination module 12, and a video generation module 13, wherein:
[0121] The difference frame acquisition module 11 is used to respond to the screen recording command and acquire the difference video frame between each non-first frame video frame in each scene and the first frame video frame in the corresponding scene during the screen recording process.
[0122] The video segment determination module 12 is used to determine the video segment of each scene based on the first video frame and the different video frames in each scene;
[0123] The video generation module 13 is used to generate recorded videos from video segments of various scenes.
[0124] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0125] In one embodiment, the screen recording device further includes: a video frame acquisition module, a judgment module, a first determination module, and a second determination module, wherein:
[0126] The video frame acquisition module is used to acquire the current video frame being recorded during screen recording.
[0127] The judgment module is used to determine whether the scene of the current video frame and the scene of the previous video frame meet preset conditions.
[0128] The first determining module is used to determine the current video frame as the first video frame in the scene corresponding to the current video frame when the judgment result of the judgment module is that the preset conditions are not met.
[0129] The second determining module is used to determine the current video frame as a non-first video frame in the scene corresponding to the previous video frame when the judgment result of the judgment module is that the preset conditions are met.
[0130] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0131] In one embodiment, the difference frame acquisition module 11 is specifically used for:
[0132] Acquire each non-first frame video frame and the first frame video frame in each scene;
[0133] The difference between each non-first frame video frame in each scene and the first frame video frame in the corresponding scene is obtained to obtain the difference video frame.
[0134] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0135] In one embodiment, the video segment determination module 12 includes: a third determination unit, wherein:
[0136] The third determining unit is specifically used to determine the video segment in any scene according to the video frame recording sequence in any scene, based on the first video frame in any scene and the video frames that differ in the corresponding scene; the video frame recording sequence is the recording order of the first video frame and each non-first video frame in any scene.
[0137] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0138] In one embodiment, the video segment determination module 12 includes: a fourth determination unit, wherein:
[0139] The fourth determining unit is specifically used to determine the video segments of each scene in parallel through multi-threading based on the video frame recording sequence under different scenes and the first video frame and the video frames with differences in the corresponding scenes.
[0140] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0141] In one embodiment, the video generation module 13 is specifically used for:
[0142] Obtain the scene recording order of each scene during screen recording;
[0143] The video segments from each scene during screen recording are merged according to the recording order to obtain the recorded video.
[0144] The screen recording device provided in this application can be used to execute the technical solutions in the above-described screen recording method embodiments of this application. Its implementation principle and technical effects are similar, and will not be repeated here.
[0145] For specific limitations regarding the screen recording device, please refer to the limitations on the screen recording method above, which will not be repeated here. Each module in the aforementioned screen recording device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0146] In one embodiment, an electronic device is provided, the internal structure of which can be as follows: Figure 1 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides processing power. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the first and difference video frames generated during screen recording. The network interface communicates with external endpoints via a network connection. When executed by the processor, the computer program implements a screen recording method.
[0147] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0148] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0149] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0150] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0151] Recorded videos are generated from video segments of various scenes.
[0152] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0153] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0154] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0155] Recorded videos are generated from video segments of various scenes.
[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0157] In response to a screen recording command, obtain the video frames that differ between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process.
[0158] Based on the first video frame and the different video frames in each scene, determine the video segment for each scene;
[0159] Recorded videos are generated from video segments of various scenes.
[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A screen recording method, characterized in that, The method includes: In response to a screen recording command, the system acquires the difference video frames between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process; the difference video frames are the difference information between the non-first frame video frames and the first frame video frame in the corresponding scene. Based on the first video frame and the different video frames in each scenario, determine the video segment for each scenario; Recorded videos are generated from video segments of each of the aforementioned scenarios.
2. The method according to claim 1, characterized in that, The method further includes: During the screen recording process, the current video frame being recorded is acquired; Determine whether the scene of the current video frame and the scene of the previous video frame meet preset conditions; If the preset conditions are not met, the current video frame is determined as the first video frame in the scene corresponding to the current video frame. If the preset conditions are met, the current video frame is determined to be a non-first video frame in the scene corresponding to the previous video frame.
3. The method according to claim 1 or 2, characterized in that, The acquisition of video frames showing the difference between each non-first frame and the first frame in each scene during screen recording includes: Obtain each non-first frame video frame and the first frame video frame in each of the aforementioned scenarios; The difference video frame is obtained by subtracting the first video frame from the first video frame in the corresponding scene for each non-first video frame in each of the aforementioned scenarios.
4. The method according to claim 1 or 2, characterized in that, The step of determining the video segment for each scene based on the first video frame and each of the differing video frames in each scene includes: According to the video frame recording sequence in any scenario, the video segment in any scenario is determined based on the first video frame in the scenario and the difference video frames in the corresponding scenario; the video frame recording sequence is the recording order of the first video frame and each non-first video frame in the scenario.
5. The method according to claim 1 or 2, characterized in that, The step of determining the video segment for each scene based on the first video frame and each of the differing video frames in each scene includes: Based on the video frame recording sequence under different scenarios, and according to the first video frame under different scenarios and the video frames with differences under the corresponding scenarios, the video segments of each scenario are determined in parallel by multiple threads.
6. The method according to claim 1 or 2, characterized in that, The process of generating recorded videos from video segments of each scene includes: Obtain the scene recording order of each scene during the screen recording process; According to the recording order of the scenes, the video segments of each scene during the screen recording process are merged to obtain the recorded video.
7. A screen recording device, characterized in that, The device includes: The difference frame acquisition module is used to respond to the screen recording command and acquire the difference video frame between each non-first frame video frame and the first frame video frame in the corresponding scene during the screen recording process; the difference video frame is the difference information between the non-first frame video frame and the first frame video frame in the corresponding scene. The video segment determination module is used to determine the video segment of each scene based on the first video frame and each of the different video frames in each scene; The video generation module is used to generate recorded videos from video segments of each scene.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Screen recording method, storage medium and terminal equipment
CN108337551A
Video scene recognition method and system and electronic equipment
CN112381020A