Screen recording method and device, electronic equipment and readable storage medium

By collecting and processing the video data stream in the virtual screen of the electronic device, a video with target tracking is generated, which solves the problem of being unable to track the target in the recorded video in the existing technology, and realizes an efficient target tracking and screen recording process. .

CN118555359APending Publication Date: 2024-08-27ARASHI VISION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310212973.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing technology cannot track the target in the recorded video during the screen recording process.

Method used

Collect video data streams through the virtual screen of electronic devices, obtain and process targets in video frames, and generate videos with target tracking. The method includes responding to screen recording instructions, collecting video data streams, extracting key frames, performing target tracking rendering, and integrating the target tracking results into the complete video.

Benefits of technology

It realizes the tracking of targets in recorded videos, improves the accuracy and speed of target tracking results, avoids manual participation, and enhances the efficiency of the screen recording process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555359A
    Figure CN118555359A
Patent Text Reader

Abstract

The invention relates to a screen recording method and device, electronic equipment and a readable storage medium. The method comprises the following steps: in response to a screen recording instruction, acquiring a video data stream of a target video currently executed by the electronic equipment through a virtual screen of the electronic equipment, acquiring all video frames in the video data stream of the target video currently executed by the electronic equipment from the virtual screen, and tracking at least one target in each video frame, and generating a video with target tracking. By adopting the method, all the video frames in the video data stream of the target video currently executed by the electronic equipment can be obtained from the virtual screen, and then at least one target in each video frame is tracked, so that the video with target tracking obtained after the target in the recorded video is tracked is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a screen recording method, device, electronic device and readable storage medium. Background Art

[0002] With the development of communication technology, electronic devices are becoming more and more popular, and the functions of electronic devices are becoming more and more powerful. They can provide various electronic services and provide convenience for people's life and work.

[0003] Among them, screen recording is a common service provided by electronic devices, that is, screen recording can be achieved by triggering the screen recording function of the electronic device system. However, in the related art, during the screen recording process, it is impossible to track the target in the recorded video. Summary of the invention

[0004] Based on this, it is necessary to provide a screen recording method, device, electronic device and readable storage medium to address the above technical problems, which can track the target in the recorded video.

[0005] In a first aspect, an embodiment of the present application provides a screen recording method, the method comprising:

[0006] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0007] Get all video frames in the video data stream from the virtual screen;

[0008] At least one target in each video frame is tracked to generate a video with target tracking.

[0009] In one embodiment, in response to a screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device includes:

[0010] In response to the screen recording instruction, executing the screen recording process to record the target video currently being executed by the electronic device;

[0011] During the screen recording process, the video data stream of the target video currently executed by the electronic device is captured through the virtual screen.

[0012] In one embodiment, the target video is a currently playing video or a currently captured video.

[0013] In one embodiment, when the target video is a currently shot video, the method further includes:

[0014] During the process of video shooting by the electronic device, the movement of the pan / tilt is controlled so that at least one target exists within the shooting range of the electronic device.

[0015] In one embodiment, the target is an object that can be automatically tracked by an electronic device or an object that is manually selected.

[0016] In one embodiment, during the screen recording process, capturing a video data stream of a target video currently executed by an electronic device through a virtual screen includes:

[0017] Before screen recording, the attribute information of the virtual screen is added to the screen recording process of the electronic device, and after the screen recording is completed, the video data stream is stored in the virtual screen according to the attribute information of the virtual screen.

[0018] In one embodiment, tracking at least one target in each video frame to generate a video with target tracking includes:

[0019] Extract all key video frames from all video frames; the key video frames represent video frames including the target;

[0020] Tracking and rendering the target in each key video frame to obtain the target tracking video frame corresponding to each key video frame;

[0021] Based on all target tracking video frames, a video with target tracking is generated.

[0022] In one embodiment, tracking and rendering the target in each key video frame to obtain the target tracking video frame corresponding to each key video frame includes:

[0023] Convert each key video frame into a corresponding color-coded image;

[0024] Perform target tracking on each color-coded image to obtain a target tracking result for each color-coded image;

[0025] Based on the target tracking results, the targets in each color-coded image are rendered respectively to obtain the target tracking video frames corresponding to each key video frame.

[0026] In one embodiment, the method further comprises:

[0027] The target tracking results are dynamically displayed through a floating window.

[0028] In one embodiment, generating a video with target tracking based on all target tracking video frames includes:

[0029] Get all non-key video frames in all video frames;

[0030] According to the screen recording sequence of each video frame, each target tracking video frame and each non-key video frame are fused to obtain a video with target tracking.

[0031] In one embodiment, the method further comprises:

[0032] In response to the screen recording instruction, a prompt message is output; the prompt message is used to remind the user that the current application has switched to the screen recording application.

[0033] In a second aspect, an embodiment of the present application provides a screen recording device, the device comprising:

[0034] A data stream acquisition module, used to respond to a screen recording instruction and acquire a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0035] A video frame acquisition module is used to acquire all video frames in the currently playing video data stream from the virtual screen;

[0036] The tracking processing module is used to track at least one target in each video frame to generate a video with target tracking.

[0037] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0038] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0039] Get all video frames in the video data stream from the virtual screen;

[0040] At least one target in each video frame is tracked to generate a video with target tracking.

[0041] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0042] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0043] Get all video frames in the video data stream from the virtual screen;

[0044] At least one target in each video frame is tracked to generate a video with target tracking.

[0045] The screen recording method, device, electronic device and readable storage medium provided by the embodiments of the present application include: in response to a screen recording instruction, collecting the video data stream of the target video currently executed by the electronic device through the virtual screen of the electronic device, obtaining all video frames in the video data stream from the virtual screen, and tracking at least one target in each video frame to generate a video with target tracking; the above method can obtain all video frames in the video data stream of the target video currently executed by the electronic device from the virtual screen, and then track at least one target in each video frame to obtain the video with target tracking obtained after tracking the target in the recorded video. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a diagram of the internal structure of an electronic device in one embodiment;

[0047] Figure 2 A schematic diagram of a screen recording method in one embodiment;

[0048] Figure 3 A schematic diagram of a flow chart of a screen recording method in another embodiment;

[0049] Figure 4 A schematic diagram of a flow chart of a screen recording method in another embodiment;

[0050] Figure 5 A schematic diagram of a flow chart of a screen recording method in another embodiment;

[0051] Figure 6 A schematic diagram of a flow chart of a screen recording method in another embodiment;

[0052] Figure 7 It is a structural block diagram of a screen recording device in another embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] In the computer field, in applications such as automated testing, real-time monitoring, and remote control, it is often necessary to screen record the video currently playing on an electronic device, that is, screen recording, recording the operation process on the electronic device. However, in the related art, when recording a video through the system's built-in screen recording function, it is impossible to track the target in the recorded video. Based on this, an embodiment of the present application provides a screen recording method that can track the target in the recorded video and obtain a video with target tracking.

[0055] The screen recording method provided in the embodiment of the present application can be applied to Figure 1 The electronic device shown. The electronic device may be, but is not limited to, various personal computers, laptops, electronic phones, and tablet computers. This embodiment does not limit the specific form of the electronic device. The following embodiments will specifically introduce the specific process of the screen recording method, and the specific process of the screen recording method will be introduced with the execution subject being the electronic device.

[0056] like Figure 2 As shown, it is a flowchart of the screen recording method provided in an embodiment of the present application, and the method may include the following steps:

[0057] S100 . In response to a screen recording instruction, capture a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device.

[0058] In the embodiment of the present application, the target video currently executed by the electronic device may be a video currently played by the electronic device or a video currently shot by the electronic device.

[0059] Specifically, the system of the electronic device has a screen recording function. According to actual application requirements, when it is necessary to record the video currently played by the electronic device or the video currently shot by the electronic device, the user can trigger the screen recording command of the electronic device. Optionally, the user can trigger the screen recording command of the electronic device by voice, touch screen, button, gesture, etc.

[0060] Among them, the electronic device can receive and respond to the screen recording command triggered by the user, and collect the video data stream of the target video currently executed by the electronic device in real time through the virtual screen of the electronic device. In the embodiment of the present application, the above-mentioned currently played video can be a remote live conference video, a teaching video, a lecture video, etc., and the above-mentioned currently shot video can be a video directly shot by the native camera of the electronic device, and can also be a video shot by an application with a live video broadcast function with the help of the native camera of the electronic device during the live video broadcast process. Of course, it can also be a local video output by an application with a video chat function with the help of the native camera of the electronic device during the video chat process, and / or a chat video of the other end output by an application with a video chat function during the video chat process.

[0061] It should be noted here that the virtual screen can be understood as a buffer area physically located in the memory of the electronic device, and the content in the buffer area is not displayed on the virtual screen, and only a part of it is copied to the video memory when it is displayed. At the same time, dividing the buffer area in the memory of the electronic device can obtain a virtual screen of the corresponding size, and the embodiment of the present application does not limit the size of the virtual screen.

[0062] S200: Acquire, from a virtual screen, all video frames in a video data stream of a target video currently being executed by the electronic device.

[0063] In practical applications, the electronic device can obtain the video data stream of the target video currently executed by the electronic device from the virtual screen, and obtain all corresponding video frames according to the video data stream. Correspondingly, the video data stream can be the playback video data stream of the currently playing video or the shooting video data stream of the currently shooting video. It should be noted here that each video frame has corresponding video data, and according to the playback sequence or shooting sequence of the video data, the video data corresponding to all video frames can be combined to generate a video data stream.

[0064] Optionally, the video data in the video data stream may carry identification information, and the video data corresponding to the same identification information may be the same video frame. Correspondingly, after acquiring the video data stream, the electronic device may classify all the video data in the video data stream according to the identification information to obtain multiple types of video data, and obtain corresponding video frames according to each type of video data. Optionally, the identification information may be a character string composed of at least one of numbers, symbols, Chinese, and English.

[0065] It should be noted here that the way of classifying all the video data in the video data stream according to the identification information may be to classify the video data with the same identification information into the same category, thereby obtaining at least one category of video data.

[0066] In addition, if the video data stream is a playback video data stream, the electronic device can obtain each video data from the playback video data stream according to the playback sequence of all video frames, and determine the corresponding video frames through each video data; if the video data stream is a shot video data stream, the electronic device can obtain each video data from the shot video data stream according to the shooting sequence of all video frames, and determine the corresponding video frames through each video data.

[0067] S300: Track at least one target in each video frame to generate a video with target tracking.

[0068] Based on all the video frames acquired in the above steps, at least one target in at least one video frame can be tracked to generate a video with target tracking. Optionally, the target in the video frame can be an animal, an obstacle, a vehicle, a pedestrian, a sign, etc., and there can be at least one target in each video frame, or there may be no target.

[0069] Among them, the electronic device can pre-train an algorithm model, and then input each video frame into the algorithm model in sequence, and the algorithm model tracks at least one target in each video frame and outputs a video with target tracking. Optionally, the algorithm model can be a model composed of at least one of a convolutional neural network model, a recurrent neural network model, a multi-layer perceptron neural network model, a recursive neural network model, a deep belief network model, a deep autoencoder, and a generative adversarial network model.

[0070] In some scenarios, in order to track a specific target, it is necessary to dynamically adjust the shooting range of the electronic device by controlling the movement of the pan / tilt, so that the specific target always exists within the shooting range of the electronic device during the video shooting process. Based on this, in one embodiment, when the target video is the current shooting video, during the video shooting process of the electronic device, the above method further includes: controlling the movement of the pan / tilt so that at least one target exists within the shooting range of the electronic device.

[0071] It should be noted here that the above-mentioned gimbal is a supporting device for installing or fixing electronic equipment. Naturally, the electronic equipment and the gimbal are fixedly arranged. In practical applications, the above-mentioned gimbal can also be called a mobile phone gimbal or a handheld gimbal. Among them, the gimbal can move, and after the gimbal moves, the corresponding electronic device also moves accordingly. Therefore, the electronic device can control the movement of the gimbal to drive the movement of the electronic device, so that all targets can be controlled to exist within the shooting range of the electronic device. Naturally, all targets are included in each video frame in the video data stream.

[0072] For example, if the current scene includes 3 targets, each video frame in the video data stream includes the 3 targets; if the current scene includes 6 targets, each video frame in the video data stream includes the 6 targets. Correspondingly, in the tracking process, all targets in each video frame can be tracked.

[0073] In the embodiment of the present application, the gimbal is a handheld gimbal, for example, the handheld gimbal is a two-axis handheld gimbal or a three-axis handheld gimbal. It can also be understood that after the gimbal moves, the axes of the gimbal will be linked, wherein the two-axis handheld gimbal includes any two axes of the roll axis, the pitch axis and the yaw axis, and the three-axis handheld gimbal includes the roll axis, the pitch axis and the yaw axis. During the movement of the three-axis handheld gimbal, at least two axes among the roll axis, the pitch axis and the yaw axis will be linked, or one of the axes among the roll axis, the pitch axis and the yaw axis may be controlled to move.

[0074] In one embodiment, each target within the shooting range of the electronic device is an object that can be automatically tracked by the electronic device or an object that is manually selected.

[0075] In the embodiment of the present application, the electronic device controls the pan-tilt movement so that the various targets existing within the shooting range of the electronic device can be objects that the electronic device can automatically track during the video shooting process, and can also be objects manually selected by the user. Among them, the objects that the electronic device can automatically track and the objects manually selected by the user can both be pedestrians, animals and / or obstacles in the target video currently executed by the electronic device; in addition, the objects that the electronic device can automatically track and the objects manually selected by the user can both be pedestrians, animals, obstacles that meet specific characteristics in the target video currently executed by the electronic device.

[0076] The technical solution in the embodiment of the present application can respond to the screen recording instruction, collect the video data stream of the target video currently executed by the electronic device through the virtual screen of the electronic device, obtain all video frames in the video data stream of the target video currently executed by the electronic device from the virtual screen, and track at least one target in each video frame to generate a video with target tracking; the above method can obtain all video frames in the video data stream of the target video currently executed by the electronic device from the virtual screen, and then track at least one target in each video frame to obtain the video with target tracking obtained after tracking the target in the recorded video. On the basis of this method, the user can further grasp the entire dynamic position of the target according to the video with target tracking to avoid the situation where the user cannot find the target; at the same time, the method does not require human participation, which can not only improve the accuracy of the target tracking result in the acquired video with target tracking, but also improve the speed and efficiency of acquiring the video with target tracking obtained after tracking the target in the recorded video.

[0077] The following is a description of the process of capturing the video data stream of the target video currently being executed by the electronic device through the virtual screen of the electronic device in response to the screen recording instruction. Figure 3 As shown, the steps in S100 above can be implemented in the following manner:

[0078] S110. In response to the screen recording instruction, execute a screen recording process to record the target video currently being executed by the electronic device.

[0079] In actual applications, if the shooting function of the electronic device is occupied by a functional application installed on the electronic device, the electronic device is currently unable to shoot the target video through its own shooting function. At this time, the user can input a screen recording instruction to the electronic device. Correspondingly, after the electronic device responds to the screen recording instruction, it can call the screen recording process to start recording the target video currently executed by the electronic device to obtain the target video.

[0080] S120. During the screen recording process, the video data stream of the target video currently executed by the electronic device is captured through the virtual screen.

[0081] In the process of recording the target video currently being executed by the electronic device, the video data stream of the target video currently being executed by the electronic device can be collected in real time through the virtual screen.

[0082] In one embodiment, the step of capturing the video data stream of the target video currently executed by the electronic device through the virtual screen during the screen recording process in the above S120 may include: adding the attribute information of the virtual screen to the screen recording process of the electronic device before screen recording, and after the screen recording is completed, storing the video data stream in the virtual screen according to the attribute information of the virtual screen.

[0083] It is understandable that before recording the screen, the attribute information of the virtual screen can be added to the screen recording process of the electronic device, so that after the screen recording is completed, the video data stream can be directly stored in the corresponding virtual screen according to the attribute information of the virtual screen. Optionally, the attribute information of the virtual screen can be the function of the virtual screen, the creation time, etc., but in the embodiment of the present application, the attribute information of the virtual screen is the location of the memory and the size of the buffer in the memory.

[0084] In one embodiment, after responding to the screen recording instruction, the screen recording method may further include: outputting prompt information, wherein the prompt information is used to remind the user that the current application has been switched to the screen recording application.

[0085] In actual applications, the electronic device may output a prompt message after responding to the screen recording instruction. Optionally, the prompt message may be output in the form of a voice broadcast, or in the form of a view or text through a floating window. The prompt message may include relevant information that can remind the user that the background has switched the current application of the electronic device to the screen recording application, and this embodiment of the application is not limited to this.

[0086] The technical solution in the embodiment of the present application can respond to the screen recording instruction, execute the screen recording process to record the target video currently executed by the electronic device, and add the attribute information of the virtual screen to the screen recording process of the electronic device before recording, and after the screen recording is completed, store the video data stream in the virtual screen according to the attribute information of the virtual screen; the method can temporarily store the video data stream of the target video currently executed by the electronic device to the virtual screen, so that the video data stream can be obtained from the virtual screen later, and further process all video frames in the video data stream to obtain the video with target tracking. At the same time, the process of storing the video data stream in the virtual screen is relatively simple, which improves the temporary storage speed of the video data stream, thereby accelerating the speed and efficiency of obtaining the video with target tracking.

[0087] In some scenarios, the target in the key video frame of the video data stream of the target video currently executed by the electronic device can be tracked to obtain a video with target tracking, so that the user can quickly understand the position of the target at different times during the entire screen recording process through the screen recording video. Figure 4 As shown, the step of performing tracking processing on at least one target in each video frame to generate a video with target tracking in the above S300 can be implemented in the following manner:

[0088] S310: extract all key video frames from all video frames, wherein the key video frames refer to video frames including the target.

[0089] Specifically, for any video frame, the electronic device may use a target detection algorithm to perform target detection on the video frame to obtain a target detection result, and then extract all key video frames from all video frames based on the target detection results corresponding to all video frames.

[0090] Among them, the above-mentioned target detection algorithm can be a detection algorithm based on manual features (such as template matching method, key point matching method, key feature method, etc.), a sliding window detection algorithm, a two-stage target detection algorithm based on deep learning (such as R-CNN algorithm, SPP-Net algorithm, Fast R-CNN algorithm, Faster R-CNN algorithm, Mask R-CNN algorithm, etc.), a single-stage target detection algorithm based on deep learning (such as SSD algorithm, YOLO algorithm, OverFeat algorithm, RetinaNet algorithm, etc.), and the like.

[0091] Optionally, the target detection result may be that the video frame contains at least one target, or may be that the video frame does not contain a target. In the embodiment of the present application, the video frame containing at least one target is referred to as a key video frame.

[0092] It should be noted here that all the key video frames in the screen recording process can be all the video frames in the screen recording process, or can be part of the video frames in the screen recording process, which is not limited to this embodiment of the present application.

[0093] S320 , tracking and rendering the target in each key video frame to obtain a target tracking video frame corresponding to each key video frame.

[0094] In the embodiment of the present application, each key video frame may have at least one target. Optionally, the electronic device may track and render each target in each key video frame to obtain a target tracking video frame corresponding to each key video frame.

[0095] The method of tracking and rendering each target in each key video frame can be to track each target in each key video frame to obtain a target tracking result, and then render the target in each key video frame respectively based on the target tracking result of each key video frame. It should be noted here that target tracking can be understood as a process of target detection or target recognition; the above-mentioned rendering of the target in the key video frame can be understood as a process of color marking, enlarging, reducing, etc. of the target in the key video frame.

[0096] S330: Generate a video with target tracking based on all target tracking video frames.

[0097] Specifically, the electronic device may process all acquired target tracking video frames and all video frames to generate videos with target tracking.

[0098] Among them, Figure 5 As shown, the step of generating a video with target tracking based on all target tracking video frames in the above S330 may include:

[0099] S331. Obtain all non-key video frames in all video frames.

[0100] Optionally, the electronic device may filter out all key video frames from all video frames acquired during the screen recording process to obtain all non-key video frames during the screen recording process. In addition, the electronic device may also perform target detection on each video frame acquired during the screen recording process, and determine the video frame in which the target is not detected as a non-key video frame.

[0101] S332. According to the screen recording sequence of each video frame, each target tracking video frame and each non-key video frame are merged to obtain a video with target tracking.

[0102] Specifically, the electronic device can determine the screen recording sequence of each key video frame and the screen recording sequence of each non-key video frame during the screen recording process according to the screen recording sequence of each video frame during the screen recording process, and then fuse each target tracking video frame and each non-key video frame according to the screen recording sequence of each key video frame and the screen recording sequence of each non-key video frame to generate a video with target tracking.

[0103] At the same time, the electronic device can also first determine the recording sequence of each key video frame and the recording sequence of each non-key video frame during the screen recording process according to the recording sequence of each video frame during the screen recording process, and then obtain a pre-trained video frame fusion model, and input the recording sequence of each key video frame, the recording sequence of each non-key video frame, all target tracking video frames and all non-key video frames into the video frame fusion model, and the video frame fusion model outputs a video with target tracking.

[0104] The embodiment of the present application can obtain non-critical video frames obtained during the screen recording process, and according to the screen recording sequence of each video frame, fuse all target tracking video frames and all non-critical video frames to generate a video with target tracking; the method can fuse each target tracking video frame and each non-critical video frame according to the screen recording sequence of each video frame during the screen recording process, so that the acquired screen recording video not only carries target tracking, but also can ensure the sequentiality of each video frame in the acquired screen recording video, so that the acquired screen recording video has higher integrity.

[0105] The technical solution in the embodiments of the present application can extract all key video frames from all video frames, track and render the targets in each key video frame, obtain the target tracking video frames corresponding to each key video frame, and generate a video with target tracking based on all target tracking video frames; the method can only track and render all key video frames in all video frames, reducing the amount of data processed by tracking rendering, and can improve the speed and efficiency of tracking rendering, further improving the speed and efficiency of generating videos with target tracking; in addition, the method can obtain the position information of the target at different times during the screen recording process based on the video with target tracking, and then further determine whether the target has exceeded the movable range at different times based on the position information of the target at different times, thereby reminding the target to avoid exceeding the movable range as much as possible in the future according to the determination result.

[0106] The following is a description of the process of tracking and rendering the target in each key video frame to obtain the target tracking video frame corresponding to each key video frame. Figure 6 As shown, the steps in the above S320 may include:

[0107] S321 . Convert each key video frame into a corresponding color-coded image.

[0108] For any key video frame, the key video frame may be converted into a corresponding color-coded image by inputting the key video frame into an image format converter, and the image format converter outputs a color-coded image corresponding to the key video frame.

[0109] In addition, for any key video frame, the key video frame can be converted into a corresponding color-coded image by using an image feature extraction algorithm to extract features from the key video frame to obtain feature information, and then obtain the color-coded image corresponding to the key video frame based on the feature information. The image feature extraction algorithm can be an image local texture feature extraction algorithm, a directional gradient histogram feature extraction algorithm, or a scale-invariant feature conversion algorithm, etc. Optionally, the feature information can be brightness information, hue information, and color saturation information of each pixel in the key video frame.

[0110] S322 , performing target tracking on each color-coded image to obtain a target tracking result for each color-coded image.

[0111] Based on the color-coded (i.e., YUV) images corresponding to all key video frames obtained in the above steps, a target tracking algorithm can be used to track the target in each color-coded image to obtain the target tracking result of each color-coded image. Optionally, the target tracking result can be information such as the position and contour of the target in the color-coded image.

[0112] Correspondingly, the above-mentioned target tracking algorithm can be a sliding window detection algorithm, a two-stage target detection algorithm based on deep learning, a one-stage target detection algorithm based on deep learning, etc., which is not limited to this embodiment of the present application.

[0113] In one embodiment, the method further includes: dynamically displaying the target tracking result via a floating window.

[0114] Among them, when the electronic device tracks the target of each color-coded image, it can track the target of each color-coded image in turn according to the screen recording sequence of the video frames corresponding to each color-coded image in the video data stream. At the same time, the target tracking result corresponding to each color-coded image can be dynamically displayed through a floating window, so that the user can intuitively and quickly determine the dynamic position information of all targets during the execution of the entire target video by the electronic device.

[0115] In addition, the electronic device can also dynamically display the video with target tracking through the floating window, and dynamically display the target tracking result in the video with target tracking.

[0116] S323 . Based on each target tracking result, render the target in each color-coded image respectively to obtain a target tracking video frame corresponding to each key video frame.

[0117] Specifically, the electronic device may render each target in each color-coded image based on the target tracking result of each color-coded image, and obtain a target tracking video frame corresponding to each key video frame.

[0118] Among them, the method of rendering each target in the color-coded image can be to pre-train an algorithm model, and then input each color-coded image into the algorithm model. The algorithm model renders the target in each color-coded image respectively and outputs the corresponding target tracking video frame.

[0119] The technical solution in the embodiments of the present application can convert each key video frame into a corresponding color-coded image, perform target tracking on each color-coded image, obtain target tracking results for each color-coded image, and render the targets in each color-coded image based on the target tracking results to obtain target tracking video frames corresponding to each key video frame; the method can convert the key video frames into color-coded images, quickly perform target tracking on the color-coded images, and then render the targets in the color-coded images according to the target tracking results to obtain target tracking video frames corresponding to the key video frames, and further generate videos with target tracking based on the target tracking video frames, and allow users to quickly obtain the position information of the target at different times during the screen recording process based on the screen recording video, so as to facilitate further processing based on the position information of the target at different times during the screen recording process.

[0120] In one embodiment, the present application also provides a screen recording method, which includes the following process:

[0121] (1) In response to a screen recording instruction, a prompt message is output, and a screen recording process is executed to record the target video currently executed by the electronic device; the prompt message is used to remind the user that the current application has switched to the screen recording application, and the target video is the currently playing video or the currently captured video; wherein, when the target video is the currently captured video, during the process of the electronic device capturing the video, the pan / tilt movement is controlled so that at least one target exists within the shooting range of the electronic device, and the target is an object that can be automatically tracked by the electronic device or an object that is manually selected.

[0122] (2) During the screen recording process, the attribute information of the virtual screen is added to the screen recording process of the electronic device, and after the screen recording is completed, the video data stream of the target video currently executed by the electronic device is stored in the virtual screen according to the attribute information of the virtual screen.

[0123] (3) Obtain all video frames in the video data stream of the target video currently executed by the electronic device from the virtual screen.

[0124] (4) Extract all key video frames from all video frames; key video frames represent video frames including the target.

[0125] (5) Convert each key video frame into a corresponding color-coded image.

[0126] (6) Target tracking is performed on each color-coded image to obtain a target tracking result for each color-coded image, and the target tracking result is dynamically displayed through a floating window.

[0127] (7) Based on the target tracking results, the targets in each color-coded image are rendered respectively to obtain target tracking video frames corresponding to each key video frame.

[0128] (8) Obtain all non-key video frames in all video frames.

[0129] (9) According to the screen recording sequence of each video frame, each target tracking video frame and each non-key video frame are fused to obtain a video with target tracking.

[0130] The execution process of the above (1) to (9) can be specifically referred to the description of the above embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0131] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0132] Based on the same inventive concept, the embodiment of the present application also provides a screen recording device for implementing the screen recording method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more screen recording device embodiments provided below can refer to the limitations on the screen recording method above, and will not be repeated here.

[0133] In one embodiment, Figure 7 This is a schematic diagram of the structure of a screen recording device in one embodiment of the present application. The screen recording device provided in the embodiment of the present application can be applied to electronic devices. Figure 7 As shown, the screen recording device of the embodiment of the present application may include: a data stream acquisition module 11, a video frame acquisition module 12 and a tracking processing module 13, wherein:

[0134] The data stream acquisition module 11 is used to respond to the screen recording instruction and acquire the video data stream of the target video currently executed by the electronic device through the virtual screen of the electronic device;

[0135] The video frame acquisition module 12 is used to acquire all video frames in the video data stream of the target video currently executed by the electronic device from the virtual screen;

[0136] A tracking processing module 13, used to track at least one target in each video frame and generate a video with target tracking;

[0137] The target video is the currently playing video or the currently captured video.

[0138] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0139] In one embodiment, the data stream collection module 11 includes: a screen recording unit and a data stream collection unit, wherein:

[0140] A screen recording unit, configured to execute a screen recording process to record a target video currently being executed by the electronic device in response to a screen recording instruction;

[0141] The data stream acquisition unit is used to acquire the video data stream of the target video currently executed by the electronic device through the virtual screen during the screen recording process.

[0142] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0143] In one embodiment, when the target video is the currently shot video, the screen recording device further includes: a control module, wherein:

[0144] The control module is used to control the movement of the pan / tilt head so that at least one target exists within the shooting range of the electronic device during the process of the electronic device shooting a video; the target is an object that can be automatically tracked by the electronic device or an object selected manually.

[0145] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0146] In one embodiment, the data stream collection unit is specifically used to:

[0147] During the screen recording process, the attribute information of the virtual screen is added to the screen recording process of the electronic device, and after the screen recording is completed, the video data stream of the target video currently executed by the electronic device is stored in the virtual screen according to the attribute information of the virtual screen.

[0148] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0149] In one embodiment, the tracking processing module 13 includes: a key frame extraction unit, a tracking rendering unit and a screen recording unit, wherein:

[0150] A key frame extraction unit, used to extract all key video frames from all video frames; the key video frames represent video frames including the target;

[0151] A tracking rendering unit, used to track and render the target in each key video frame to obtain a target tracking video frame corresponding to each key video frame;

[0152] The screen recording unit is used to generate a video with target tracking based on all target tracking video frames.

[0153] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0154] In one embodiment, the tracking rendering unit is specifically configured to:

[0155] Convert each key video frame into a corresponding color-coded image;

[0156] Perform target tracking on each color-coded image to obtain a target tracking result for each color-coded image;

[0157] Based on the target tracking results, the targets in each color-coded image are rendered respectively to obtain the target tracking video frames corresponding to each key video frame.

[0158] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0159] In one embodiment, the tracking rendering unit is further specifically used for:

[0160] The target tracking results are dynamically displayed through a floating window.

[0161] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0162] In one embodiment, the screen recording unit is specifically used for:

[0163] Get all non-key video frames in all video frames;

[0164] According to the screen recording sequence of each video frame, each target tracking video frame and each non-key video frame are fused to obtain a video with target tracking.

[0165] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0166] In one embodiment, the screen recording device further includes: a prompt information output module, wherein:

[0167] The prompt information output module is used to output prompt information in response to the screen recording instruction; the prompt information is used to remind the user that the current application has switched to the screen recording application.

[0168] The screen recording device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned screen recording method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0169] For the specific limitations of the screen recording device, please refer to the limitations of the screen recording method above, which will not be repeated here. Each module in the above-mentioned screen recording device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0170] In one embodiment, an electronic device is provided, the internal structure diagram of the electronic device can be as follows: Figure 1 As shown. The electronic device includes a processor, a memory and a network interface connected via a system bus. The processor of the electronic device is used to provide processing capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store key video frames, non-key video frames and videos with target tracking generated during screen recording. The network interface of the electronic device is used to communicate with an external endpoint via a network connection. When the computer program is executed by the processor, a screen recording method is implemented.

[0171] Those skilled in the art will understand that Figure 1 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of 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 a different arrangement of components.

[0172] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0173] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0174] Get all video frames in the video data stream from the virtual screen;

[0175] At least one target in each video frame is tracked to generate a video with target tracking.

[0176] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0177] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0178] Get all video frames in the video data stream from the virtual screen;

[0179] At least one target in each video frame is tracked to generate a video with target tracking.

[0180] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0181] In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device;

[0182] Get all video frames in the video data stream from the virtual screen;

[0183] At least one target in each video frame is tracked to generate a video with target tracking.

[0184] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database 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 memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0185] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0186] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A screen recording method, It is characterized in that The method comprises: In response to the screen recording instruction, capturing a video data stream of a target video currently executed by the electronic device through a virtual screen of the electronic device; Acquire all video frames in the video data stream from the virtual screen; Tracking is performed on at least one target in each of the video frames to generate a video with target tracking.

2. The method according to claim 1, It is characterized in that The step of capturing the video data stream of the target video currently executed by the electronic device through the virtual screen of the electronic device in response to the screen recording instruction includes: In response to the screen recording instruction, executing a screen recording process to record the target video currently being executed by the electronic device; During the screen recording process, the video data stream of the target video is captured through the virtual screen.

3. The method according to claim 2, It is characterized in that The target video is a currently playing video or a currently captured video.

4. The method according to claim 3, It is characterized in that When the target video is the currently shot video, the method further includes: During the process of the electronic device shooting a video, the pan / tilt movement is controlled so that at least one target exists within the shooting range of the electronic device.

5. The method according to claim 4, It is characterized in that The target is an object that can be automatically tracked by the electronic device or an object that is manually selected.

6. The method according to claim 2, It is characterized in that The step of collecting the video data stream of the target video through the virtual screen during the screen recording process includes: Before screen recording, the attribute information of the virtual screen is added to the screen recording process of the electronic device, and after the screen recording is completed, the video data stream is stored in the virtual screen according to the attribute information of the virtual screen.

7. The method according to any one of claims 1 to 6, It is characterized in that The step of tracking at least one target in each of the video frames to generate a video with target tracking includes: Extract all key video frames from all video frames; the key video frames represent video frames including the target; Tracking and rendering the target in each key video frame to obtain the target tracking video frame corresponding to each key video frame; Based on all target tracking video frames, the video with target tracking is generated.

8. The method according to claim 7, It is characterized in that The tracking and rendering of the target in each key video frame to obtain the target tracking video frame corresponding to each key video frame includes: Converting each of the key video frames into a corresponding color-coded image; Performing target tracking on each color-coded image to obtain a target tracking result for each color-coded image; Based on each target tracking result, the targets in each color-coded image are rendered respectively to obtain target tracking video frames corresponding to each key video frame.

9. The method according to claim 1, It is characterized in that The method further comprises: The target tracking results are dynamically displayed through a floating window.

10. The method according to claim 7, It is characterized in that The step of generating the video with target tracking based on all target tracking video frames comprises: Acquire all non-key video frames from all the video frames; According to the screen recording sequence of each video frame, each target tracking video frame and each non-key video frame are fused to obtain the video with target tracking.

11. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: In response to the screen recording instruction, a prompt message is output; the prompt message is used to remind the user that the current application has switched to the screen recording application.

12. A screen recording device, It is characterized in that The device comprises: A data stream acquisition module, configured to acquire a video data stream of a target video currently being executed by the electronic device through a virtual screen of the electronic device in response to a screen recording instruction; A video frame acquisition module, used for acquiring all video frames in the video data stream from the virtual screen; The tracking processing module is used to track at least one target in each of the video frames to generate a video with target tracking.

13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.