Video recording method and related device
By corresponding the preview cache queue and recording cache queue to the same memory queue, processing and saving images in the memory queue, the problem of excessive memory usage of terminal equipment during video recording is solved, power consumption is reduced, and recording efficiency is improved.
Patent Information
- Application Number
- CN202311475949.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-08-08
AI Technical Summary
Terminal devices consume a lot of power when recording videos, mainly because they need to store and process original images in multiple memory queues, resulting in excessive memory usage.
By corresponding the preview cache queue and the recording cache queue to the same memory queue, the original images in the memory queue are obtained for processing during the recording process, and the processed images are saved to their corresponding preview cache queue and recording cache queue. , reduce the number of original images cached by the terminal device and reduce power consumption.
It effectively reduces the memory usage and power consumption of the terminal device and improves the efficiency of video recording.
Smart Images

Figure CN117479000B
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202210946060.7, and the original application date is August 8, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a video recording method and related devices. Background Art
[0003] To improve user experience, mobile phones, tablet computers and other terminal devices are usually equipped with multiple cameras. The terminal device can provide users with multiple shooting modes through the multiple cameras configured, such as front camera mode, rear camera mode, front and rear dual camera mode, etc. Users can select the corresponding shooting mode to shoot according to the shooting scene.
[0004] When the terminal device receives the user's operation of selecting a shooting mode, the terminal device enters the corresponding preview interface and displays the captured image. When the terminal device receives the user's operation of recording a video, the terminal device enters the corresponding recording interface and displays and saves the captured image.
[0005] However, when the terminal device records video, the power consumption is high. Summary of the invention
[0006] The embodiment of the present application provides a recording method and related devices, which are applied to the field of terminal technology. By making the preview cache queue and the video cache queue correspond to the same memory queue; during the recording process, the original image in the memory queue is obtained for processing, and the processed image is saved to the corresponding preview cache queue and the corresponding video cache queue. In this way, the number of original images cached by the terminal device can be reduced, the memory usage can be reduced, and the power consumption can be reduced.
[0007] In the first aspect, the embodiment of the present application proposes a recording method. The method includes: the terminal device displays a first interface, the first interface includes a first window and a recording control, the first window displays a first picture captured by the camera in real time; when the terminal device receives a first operation on the recording control, the terminal device generates a first recording request; the terminal device obtains the original image captured by the camera based on the first recording request and stores it in a first memory queue; the terminal device processes the original image in the first memory queue to obtain a first image; the terminal device stores the first image in a first preview cache queue and a first recording cache queue, and the first preview cache queue and the first recording cache queue both correspond to the first memory queue; the terminal device displays a second interface, the second interface includes a first window, the first window displays a first picture, and the first picture is generated based on the first image in the first preview cache queue; the terminal device encodes based on the first image in the first recording cache queue to save the first video.
[0008] In the embodiment of the present application, the first interface may be a preview interface for displaying an image for preview. The first interface may correspond to Figure 4 The interface shown. The first window may correspond to the large window described below. The second interface may be a recording interface, where a video is recorded while displaying an image for preview. The first recording request may correspond to the third request or the fourth request described below.
[0009] The first operation may be a click operation, a touch operation, or other types of operations (for example, voice, etc.). The embodiment of the present application does not limit the type, method, etc. of the first operation.
[0010] It is understandable that during the recording process, the original image in the memory queue is obtained for processing, and the processed image is saved to its corresponding preview cache queue and its corresponding video cache queue. In this way, the number of original images cached by the terminal device can be reduced, the memory usage can be reduced, and the power consumption can be reduced.
[0011] Optionally, before the terminal device displays the first interface, the method also includes: the terminal device displays a third interface, the third interface includes a first control, and the first control corresponds to the first recording mode; the terminal device receives a second operation for the first control; the terminal device configures a first preview cache queue, a first recording cache queue and a first memory queue based on the first recording mode.
[0012] The first control may be a recording control, used to indicate a normal recording mode; it may also be used to indicate a control of other recording modes. The second operation may be a click operation, a touch operation, or other modes of operation (e.g., voice, etc.). The present application does not limit the type and mode of the second operation. The third interface may correspond to the following Figure 4 The camera preview interface is shown.
[0013] In this way, it can be applied to a recording mode that generates one-way video by recording once, for example, a regular recording mode, a professional recording mode, etc.
[0014] Optionally, before the terminal device displays the first interface, the method also includes: the terminal device displays a fourth interface, the fourth interface includes a second control, and the second control corresponds to the second recording mode; the terminal device receives a third operation for the second control; the terminal device configures a first preview cache queue, a second preview cache queue, a first recording cache queue, a second recording cache queue, a first memory queue, and a second memory queue based on the second recording mode; wherein the second preview cache queue and the second recording cache queue both correspond to the second memory queue.
[0015] The second control can be a protagonist mode control or a control of other recording modes. The third operation can be a click operation, a touch operation, or an operation in other ways (for example, voice, etc.). The embodiment of the present application does not limit the type and method of the third operation. The fourth interface can correspond to the following Figure 4 The preview interface corresponding to the protagonist mode shown.
[0016] In this way, it can be applied to a mode of generating two-way video by one recording, for example, a protagonist mode, etc., and has a wide range of applications.
[0017] Optionally, the second interface displays one or more tracking identifiers; the terminal device receives a fourth operation for the first tracking identifier, and the first tracking identifier is one of the one or more tracking identifiers; in response to the fourth operation, the terminal device generates a second recording request; the terminal device stores the original image captured by the camera in the first memory queue and the second memory queue based on the second recording request; the terminal device performs algorithm processing on the original image in the first memory queue to obtain the first image, and performs algorithm processing on the original image in the second memory queue to obtain the second image; the terminal device stores the first image in the first preview cache queue and the first recording cache queue, and stores the second image in the second preview cache queue and the second recording cache queue; the terminal device displays a fifth interface, the fifth interface includes a first window and a second window, the first window displays a first picture, the first picture is generated based on the first image in the first preview cache queue, and the second window displays a second picture, the second picture is generated based on the second image in the second preview cache queue; wherein the second picture is a part of the picture related to the first object in the first window, and the first object is the object corresponding to the first tracking identifier; the terminal device encodes based on the first image in the first recording cache queue to save the first video, and encodes based on the second image in the second recording cache queue to save the second video.
[0018] The tracking mark can be a tracking box described below, or other marks. The second window can correspond to the small window described below. The fourth operation can be a click operation, a touch operation, or other operation (e.g., voice, etc.). The embodiment of the present application does not limit the type and method of the fourth operation. The second recording request can correspond to the fourth request described below. The fifth interface can correspond to the following Figure 5 The interface shown.
[0019] The terminal device can set a tracking target for tracking during recording. When the terminal device selects a tracking target during recording, the terminal device obtains the original images in the two memory queues for processing, and saves the processed images to its corresponding preview cache queue and its corresponding video cache queue. In this way, the number of original images cached by the terminal device can be reduced, reducing memory usage and thus reducing power consumption.
[0020] Optionally, the first interface displays one or more tracking identifiers; before the terminal device receives the first operation on the recording control, the method also includes: the terminal device receives a fifth operation on the second tracking identifier, and the second tracking identifier is one of the one or more tracking identifiers; in response to the fifth operation, the terminal device displays a sixth interface, the sixth interface includes a first window, a second window and a recording control, the first window displays a first picture, the second window displays a second picture, the second picture is a part of the picture related to the first object in the first window, and the first object is the object corresponding to the first tracking identifier; the terminal device stores the original image captured by the camera in the second memory queue based on the first recording request; the terminal device processes the original image in the second memory queue to obtain the second image; the terminal device stores the second image in the second preview cache queue and the second recording cache queue; the second interface also includes a second window, the second window displays a second picture, and the second picture is generated based on the second image in the second preview cache queue; the terminal device encodes based on the second image in the second recording cache queue to save the second video.
[0021] The tracking mark can be a tracking box described below, or other marks. The second window can correspond to the small window described below. The fifth operation can be a click operation, a touch operation, or other operation methods (for example, voice, etc.). The present application embodiment does not limit the type and method of the fifth operation. The fifth interface can correspond to the following Figure 5 The interface shown. The first recording request may correspond to the fourth request described below.
[0022] The terminal device can start recording after setting the tracking target. The terminal device can display a small window to record one more channel.
[0023] Optionally, at a first moment, the terminal device detects that a first object is displayed at a first position of the first window, and the second window displays a portion of the screen related to the first object at the first position in the first window; at a second moment, the terminal device detects that a first object is displayed at a second position of the first window, and the second window displays a portion of the screen related to the first object at the second position in the first window.
[0024] In this way, the small window is displayed based on the tracking target. In the embodiment of the present application, the screen displayed in the second window (tracking screen) changes with the position of the tracking target. Specifically, the position of the first object (tracking object) in the screen displayed in the second window changes, which can be referred to as Figure 1A or Figure 1B For example, the interface at the first moment can be Figure 1A The interface shown in a in the figure, the interface at the second moment can be Figure 1A Alternatively, the interface at the first moment may be Figure 1B The interface shown in a in the figure, the interface at the second moment can be Figure 1B The interface shown in b.
[0025] In some embodiments, the focus changes with the position of the tracking target. Specifically, the focus changes with the position of the tracking target, which can be referred to Figure 1A or Figure 1B .
[0026] Optionally, the second picture is obtained by cropping the first picture.
[0027] Optionally, before the terminal device receives the first operation, the method also includes: the terminal device generates a first preview request; the terminal device obtains the original image captured by the camera based on the first preview request and stores it in a first memory queue; the terminal device processes the original image in the first memory queue to obtain a first image; the terminal device stores the first image in a first preview cache queue to generate a first picture.
[0028] In this way, when the terminal device is previewing, there is no image cache in the recording cache queue and the video will not be saved.
[0029] Optionally, the terminal device sets a first identifier for the first preview cache queue and the first recording cache queue; and / or the terminal device sets a second identifier for the second preview cache queue and the second recording cache queue.
[0030] The terminal device can identify the corresponding preview cache queue and recording cache queue through the identification, which is convenient for control and easy to implement.
[0031] In a second aspect, an embodiment of the present application provides a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device may be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc.
[0032] The terminal device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method of the first aspect.
[0033] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method of the first aspect.
[0035] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect.
[0036] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1A A schematic diagram of a preview interface of a protagonist mode provided in an embodiment of the present application;
[0038] Figure 1BA schematic diagram of a recording interface in a protagonist mode provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of a software structure in a possible design;
[0040] Figure 3 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of a process of a video recording method provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of a process of a video recording method provided in an embodiment of the present application;
[0045] Figure 8 A schematic diagram of a process of a video recording method provided in an embodiment of the present application;
[0046] Fig. 9 A schematic diagram of the structure of a video recording device provided in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0049] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0050] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0051] For ease of understanding, some nouns involved in the embodiments of the present application are explained below.
[0052] 1. Protagonist mode: When recording a video on a terminal device, an additional portrait tracking video mode can be generated, that is, two or more videos are saved when the recording is completed, one of which is the original recorded video, and the other videos are videos automatically cropped from the original video based on the target portrait being tracked. Among them, the portrait in the portrait tracking video can be understood as the "protagonist" that the user is concerned about, and the method of generating the video corresponding to the "protagonist" can be: crop the video content corresponding to the "protagonist" from the video normally recorded by the terminal device.
[0053] Among them, the "protagonist" can be a living being such as a person or an animal, or a non-living being such as a vehicle. It is understandable that any object that can be identified based on the algorithm model can be used as the "protagonist" in the embodiment of the present application. In the embodiment of the present application, the "protagonist" can be defined as a focus object, and the focus object can also be called a protagonist object, a tracking target, a tracking object and a focus target, etc. The embodiment of the present application does not limit the concept of the "protagonist".
[0054] For example, the preview interface of the protagonist mode in the terminal device can be as follows: Figure 1A The preview interface includes a large window 101 and a recording control 102 .
[0055] The large window 101 displays a large window preview screen. When the terminal device recognizes that the large window preview screen includes a person, the large window displays a tracking frame (for example, tracking frame 104 and tracking frame 105). The tracking frame can prompt the user that the corresponding person can be set or switched as a tracking target, and can also facilitate the user to set or switch the tracking target. When the terminal device recognizes that the large window preview screen includes multiple people, the large window can display multiple tracking frames. The number of tracking frames is less than or equal to the number of people recognized by the terminal device. The tracking target is any one of the multiple characters corresponding to the tracking frame in the large window preview screen. The tracking target can be called a focus object, a protagonist object, etc., and the implementation of this application is not limited to this.
[0056] In some embodiments, the tracking frame corresponding to the person set as the tracking target (e.g., tracking frame 104) and the tracking frame corresponding to the person not set as the tracking target (e.g., tracking frame 105) have different display styles. This makes it easier for the user to distinguish and identify the tracked person (tracking target). In addition to the different styles of the tracking frames, the embodiment of the present application can also set the color of the tracking frame, for example, the color of the tracking frame 104 is different from that of the tracking frame 105. In this way, the tracking target can be intuitively distinguished from other people.
[0057] The tracking frame can be a virtual frame, such as tracking frame 104; or a combination of a virtual frame and a "+", such as tracking frame 105. The tracking frame can also be in any display form, as long as the tracking frame can be triggered by the user to realize the function of tracking the target that can be set as the tracking target. The tracking frame can be marked at any position of the person that can be set as the tracking target, and the embodiments of the present application do not specifically limit this.
[0058] It is understandable that the tracking box is a type of tracking mark, and the terminal device can also display other forms of tracking marks to facilitate the user to set the tracking target. Exemplarily, other forms of tracking marks can be thumbnails, numbers, letters, and graphics of the object. In addition, the tracking mark can be set at any position of the object, near the object, or at the edge of a large window. The embodiment of the present application does not specifically limit the specific position of the tracking mark.
[0059] Exemplarily, the terminal device may display thumbnails of one or more objects in an arranged manner at the edge of the large window. When the terminal device receives an operation in which the user clicks on any tracking mark, the object corresponding to the clicked tracking mark is set as the tracking target.
[0060] In a possible implementation, the terminal device can identify a person through face recognition technology and display a tracking frame. The terminal device can determine the display position of the tracking frame based on human body recognition and other technologies, such as a relatively central position of the person's body. In this way, by calculating the position of the tracking frame based on the human body, the situation where the tracking frame is located at the face position can be reduced, and the occlusion of the face by the tracking frame can be reduced, thereby improving the user experience. The embodiment of the present application does not specifically limit the technology used for identifying the person and the technology used for calculating the tracking frame position.
[0061] In some embodiments, Figure 1A The small window 103 is also included. The small window 103 displays a small window preview screen. The small window preview screen corresponds to the tracking target. When the tracking target is switched, the person in the small window preview screen displayed in the small window 103 is switched. Exemplarily, if the tracking target is switched from the person corresponding to the tracking frame 104 to the person corresponding to the tracking frame 105, the small window preview screen displayed in the small window 103 also changes accordingly.
[0062] The small window preview image can be a part of the large window preview image. In a possible implementation, the small window preview image is obtained by the terminal device cropping the large window preview image in real time according to a certain ratio based on the tracking target. The embodiment of the present application does not specifically limit the image displayed in the small window.
[0063] In some embodiments, the size, position, and horizontal and vertical screen display mode of the small window are adjustable, and the user can adjust the style of the small window according to the recording habits. Optionally, the tracking target is displayed in the center of the small window preview screen. Optionally, the small window floats above the large window. This is not limited here.
[0064] In some embodiments, the small window 103 also includes a close control 106 and a first switch control 107 .
[0065] It is understandable that when the terminal device receives the user's operation to set the tracking target, a small window is displayed on the preview interface to display the small window preview screen of the tracking target. When the terminal device does not receive the user's operation to set the tracking target, the preview interface does not display the small window.
[0066] When the user Figure 1A When the close control 106 is triggered by clicking, touching, etc. in the preview interface shown, the terminal device receives the operation of closing the small window, closes the small window, and cancels the preview of the tracking target. Figure 1A When the first switching control 107 is triggered by clicking, touching, etc. in the preview interface shown, the terminal device receives the operation of switching the small window display mode (small window style), and the terminal device switches the style of the small window. Specifically, the small window can be switched from horizontal to vertical, or from vertical to horizontal. Figure 1AWhen the recording control 102 is triggered by clicking, touching or other operations on the preview interface shown, the terminal device receives the operation to start recording and starts recording the video and tracking the video.
[0067] Optionally, the preview interface may also include other controls, such as a protagonist mode exit control 108, a setting control 109, a flash control 110, a second switch control 111, a zoom control 112, and the like.
[0068] When the protagonist mode exit control 108 is triggered, the terminal device exits the protagonist mode and enters the video recording mode. When the setting control 109 is triggered, the terminal device can adjust a variety of setting parameters. The setting parameters include but are not limited to: whether to enable watermark, storage path, encoding method, whether to save geographic location, etc. When the flash control 110 is triggered, the terminal device can set the flash effect, for example, control the flash to be forced on, forced off, turned on when taking pictures, and turned on according to environmental adaptability. When the zoom control 112 is triggered, the terminal device can adjust the focal length of the camera, and then adjust the magnification of the large window preview picture.
[0069] When the user Figure 1A When the preview interface shown triggers the second switching control 111 by clicking or touching, the terminal device receives the operation of setting the small window style and displays the small window style options for the user to select. The small window style options include but are not limited to: horizontal or vertical, etc. The embodiment of the present application is not limited to this. In a possible implementation, the second switching control 111 corresponds to the display style of the small window, which is convenient for users to distinguish the small window styles.
[0070] It should be noted that Figure 1A In the preview interface shown, the small window style switching can be controlled by the first switch control 107, and the small window style switching can also be controlled by the second switch control 111. In a possible implementation, the first switch control 107 in the small window and the second switch control 111 in the large window can be set to be linked. Exemplarily, when the small window is switched from horizontal to vertical, the icon of the first switch control 107 is the style during vertical preview, and the icon of the second switch control 111 is also the style during vertical preview, or the icons of the first switch control 107 and the second switch control 111 are both the styles during horizontal preview, prompting the user to click again to switch the preview style.
[0071] It is understandable that in the preview scene, after the terminal device sets the tracking target, the small window preview screen of the small window can display the tracking target in the center. In some scenes, the tracking target may be in a moving state. When the tracking target moves but does not leave the lens, the small window preview screen of the small window can continue to display the tracking target in the center.
[0072] For example, the preview interface can be set to include male and female characters as the tracking target objects. In response to the user's click operation on the tracking box of the male character, the terminal device sets the male character as the tracking target and enters the following steps: Figure 1A The interface shown in a. Figure 1A In the interface shown in a of the figure, the male character is displayed in the center of the small window preview screen, and the male character is on the right side of the female character. When the male character moves, the terminal device can continue to focus on the male character and display the male character in the center of the small window. When the male character moves to the left side of the female character, the interface of the terminal device can be as follows Figure 1A As shown in b. Figure 1A In the b interface, the small window preview screen still displays the male character in the center, and the male character is on the left side of the female character.
[0073] In a possible implementation, when the terminal device tracks a target, the focus moves as the tracked target moves. For example, Figure 1A In the interface shown in a of FIG. 1 , the focus is on the face area of the male character, which is located in the middle right part of the screen; when the male character moves, the terminal device can continue to focus on the male character. When the male character moves to the left side of the female character, the interface of the terminal device can be as follows Figure 1A As shown in b. Figure 1A In the interface shown in b, the focus is on the facial area of the male character, which is located in the middle left part of the picture.
[0074] In the recording mode of the protagonist mode, the terminal device can display the image obtained by the camera in the large window (large window preview screen), display the image of the tracking target selected by the user in the small window (small window preview screen), and generate the recorded video and tracking video obtained after the recording mode is turned on. At the end of recording, the terminal device saves the video generated based on the large window preview screen and the tracking video generated based on the small window preview screen.
[0075] In some embodiments, the small window can end recording earlier than the large window. When the small window recording ends, the terminal device saves the focus tracking video generated based on the small window preview screen. Alternatively, it can be understood that the terminal device can end the recording of the focus tracking video earlier than the entire video.
[0076] In some embodiments, the small window may start recording later than the large window. Alternatively, it can be understood that after the terminal device starts recording the video, the terminal device detects the user's operation of setting the tracking target, and opens the small window to start recording the tracking video.
[0077] For example, the recording interface of the protagonist mode in the terminal device can be as follows: Figure 1B The recording interface includes a large window 113 , a pause control 114 , and an end control 115 .
[0078] The large window 113 displays the large window preview image and the recording duration. When the terminal device recognizes that the large window preview image includes a person, the large window displays a tracking frame (for example, tracking frame 117 and tracking frame 118). It can be understood that the number of tracking frames is less than or equal to the number of people recognized by the terminal device.
[0079] In some embodiments, the recording interface further displays a small window 116. The small window 116 displays a small window preview screen. The small window preview screen corresponds to the tracking target. When the tracking target is switched, the person in the small window preview screen displayed in the small window 116 is switched. Exemplarily, if the tracking target is switched from the person corresponding to the tracking frame 117 to the person corresponding to the tracking frame 118, the small window preview screen displayed in the small window 116 also changes accordingly.
[0080] The small window preview image can be a part of the large window preview image. In a possible implementation, the small window preview image is obtained by cropping the large window preview image in real time according to a certain ratio based on the tracking target. The embodiment of the present application does not specifically limit the image displayed in the small window.
[0081] Optionally, the tracking target is displayed in the center of the small window preview screen. Optionally, the small window floats above the large window. No limitation is made here.
[0082] The small window 116 also includes a small window end control 119 and a small window recording duration.
[0083] It is understandable that when the terminal device receives the user's operation to set the tracking target, a small window is displayed on the recording interface to display a small window preview of the tracking target. When the terminal device does not receive the user's operation to set the tracking target, the recording interface does not display the small window.
[0084] When the user Figure 1B When the end control 115 is triggered by clicking, touching, etc. on the recording interface shown, the terminal device receives the user's operation to end recording, and the terminal device enters the preview interface of the protagonist mode and stores the video corresponding to the large window preview screen and the focus tracking video corresponding to the small window preview screen. Figure 1B When the pause control 114 is triggered by clicking, touching, etc. on the recording interface shown, the terminal device receives the user's operation to pause recording, and the terminal device pauses the recording of the video in the large window 113 and the recording of the focus tracking video in the small window 116. Figure 1B When the small window end control 119 is triggered by clicking, touching, or other operations on the recording interface shown, the terminal device receives the user's operation to end the small window recording, and the terminal device continues to display the large window preview screen in the large window 113, closes the small window 116, and stores the focus tracking video corresponding to the small window preview screen in the small window 116.
[0085] In a possible implementation, the recording interface further includes a flash control 120. When the flash control 120 is triggered, the terminal device can set a flash effect.
[0086] It is understandable that when the terminal device records in the protagonist mode, one video can be generated based on the large window preview screen of the large window, and one additional tracking video corresponding to the tracking target can be generated based on the small window preview screen of the small window. The two videos are saved independently in the terminal device. In this way, there is no need to manually edit the entire video later, and the video corresponding to the tracking target can be obtained. The operation is simple and convenient, which improves the user experience.
[0087] It is understandable that in the recording scene, when the terminal device sets the tracking target, the small window preview screen of the small window can display the tracking target in the center. In some scenes, the tracking target may be in a moving state. When the tracking target moves but does not leave the camera, the small window preview screen of the small window can continue to display the tracking target in the center.
[0088] For example, the preview interface can be set to include male and female characters as the tracking target objects. In response to the user's click operation on the tracking box of the male character, the terminal device sets the male character as the tracking target and enters the following steps: Figure 1B The interface shown in a. Figure 1B In the interface shown in a of the figure, the male character is displayed in the center of the small window preview screen, and the male character is on the right side of the female character. When the male character moves, the terminal device can continue to focus on the male character and display the male character in the center of the small window. When the male character moves to the left side of the female character, the interface of the terminal device can be as follows Figure 1B As shown in b. Figure 1A In the b interface, the small window preview screen still displays the male character in the center, and the male character is on the left side of the female character.
[0089] In a possible implementation, when the terminal device tracks a target, the focus moves as the tracked target moves. For example, Figure 1B In the interface shown in a of FIG. 1 , the focus is on the face area of the male character, which is located in the middle right part of the screen; when the male character moves, the terminal device can continue to focus on the male character. When the male character moves to the left side of the female character, the interface of the terminal device can be as follows Figure 1B As shown in b. Figure 1B In the interface shown in b, the focus is on the facial area of the male character, which is located in the middle left part of the picture.
[0090] It can be understood that the embodiment of the present application defines a shooting mode that can additionally generate one or more tracking focus videos based on the tracking target as a protagonist mode. This shooting mode can also be called a tracking focus mode, etc. The embodiment of the present application does not limit this.
[0091] The recording method provided in the embodiment of the present application can be applied to electronic devices with recording functions. The electronic devices include terminal devices. The terminal devices can also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. The terminal devices can be mobile phones, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc.
[0092] In the embodiments of the present application, the terminal device may also be referred to as a terminal, user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc.
[0093] The recording method provided in the embodiment of the present application can be applied to various recording modes of the terminal device. For example, the protagonist mode, the regular recording mode, the front and rear dual cameras, etc. It is understandable that when the terminal device uses the protagonist mode for recording, it can record a video of the selected close-up person while recording the panoramic view of the environment where the person is located, and record in multiple modes at one time.
[0094] To improve user experience, mobile phones, tablet computers and other terminal devices are usually equipped with multiple cameras. The terminal device can provide users with multiple shooting modes through the multiple cameras configured, such as front-view mode, rear-view mode, front-rear dual-view mode, etc. Users can select the corresponding shooting mode to shoot according to the shooting scene.
[0095] When the terminal device receives the user's operation of selecting a shooting mode, the terminal device enters the corresponding preview interface and displays the captured image. When the terminal device receives the user's operation of recording a video, the terminal device enters the corresponding recording interface and displays and saves the captured image.
[0096] Exemplarily, taking recording and saving a video at a time as an example, when the terminal device receives an operation from the user to select a shooting mode, the terminal device obtains the original image captured by the camera and stores it in a first memory queue, and processes the original image in the first memory queue to display it on the preview interface; when the terminal device receives an operation from the user to record a video, the original image captured by the camera is obtained and stored in the first memory queue, and the original image in the first memory queue is processed to display it on the preview interface; and the original image captured by the camera is obtained and stored in a second memory queue, and the original image in the second memory queue is processed to encode it for storage.
[0097] In this way, when the terminal device records a video, two memory queues are required to store the image, which occupies a large amount of memory and causes high power consumption of the terminal device.
[0098] It is understandable that when recording in the protagonist mode, you can record a close-up of the selected person while recording the panoramic view of the person's environment. In one recording, you can get a panoramic video and a focus-tracking video of the selected person. When the shooting mode is the protagonist mode, a large amount of memory will be occupied and the power consumption of the terminal device will be large.
[0099] Taking the shooting mode as the main mode as an example, the following Figure 2 Explain the video recording process of the protagonist mode in possible designs.
[0100] For example, Figure 2 The following is a schematic diagram of the internal implementation flow of a terminal device in a possible design. Figure 2 As shown, the terminal device can be divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer (HAL), the kernel layer, and the hardware layer.
[0101] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as camera, gallery, phone, map, etc.
[0102] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0103] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a camera access interface, etc.
[0104] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.
[0105] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0106] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0107] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0108] The camera access interface allows applications to manage the camera and access the camera device, such as managing the camera to capture images.
[0109] The hardware abstraction layer may include multiple library modules, such as a camera library module. The Android system may load the corresponding library module for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware. In the embodiment of the present application, the camera library module includes a control module, an image processing module, a picture receiving module, a memory queue, and a cache queue.
[0110] The control module configures the memory queue and cache queue based on the configuration command sent by the camera application (the configuration command corresponds to the shooting mode). The control module is also used to adjust the camera's shooting mode (for example, large window preview mode, small window preview mode, large window recording mode, small window recording mode, beauty parameters, anti-shake parameters, exposure time, etc.) based on the request sent by the application after the configuration is completed. The control module can also adjust the relevant parameters of subsequent image processing based on the request sent by the application, such as the number of images selected from the memory queue, beauty parameters and anti-shake parameters during algorithm processing, etc.
[0111] It is understandable that the shooting modes in the camera application may include but are not limited to: regular recording mode, protagonist mode, multi-lens recording mode, etc. The configuration command corresponding to the regular recording mode includes one preview stream and one recording stream. The configuration command corresponding to the multi-lens recording mode includes two preview streams and two recording streams. The configuration command corresponding to the protagonist mode includes two preview streams and two recording streams.
[0112] It is understandable that the specific content included in the request is related to the camera's recording mode. Exemplarily, when the terminal device enters the large window preview scene of the protagonist mode, the request is used to indicate the preview of the first perspective (panoramic). When the terminal device enters the small window preview scene of the protagonist mode, the request is used to indicate the preview of the first perspective (panoramic) and the preview of the second perspective (based on the tracking target). When the terminal device enters the large window recording scene of the protagonist mode, the request is used to indicate the preview and recording of the first perspective. When the terminal device enters the small window recording scene of the protagonist mode, the request is used to indicate the preview and recording of the first perspective, as well as the preview and recording of the second perspective.
[0113] The image processing module is used to perform image processing such as noise reduction and fusion algorithms and format conversion, and store the processed images in the corresponding cache queue.
[0114] The image receiving module is used to obtain the original image taken by the underlying hardware (for example, TOF camera, webcam, etc.) and save the original image to the corresponding memory queue.
[0115] The memory queue is used to store the original images captured by the underlying hardware (for example, a TOF camera) acquired by the image receiving module.
[0116] The cache queue is used to store images processed by the image processing module for preview display or encoding processing by upper-layer applications.
[0117] In a possible design, the number of queues in the cache queue is the same as the number of queues in the memory queue.
[0118] The kernel layer is a layer between hardware and software. The kernel layer is used to drive the hardware to make the hardware work. The kernel layer may include a camera driver, a display driver, an audio driver, etc., which is not limited in the embodiments of the present application.
[0119] The hardware layer can include various types of sensors, such as shooting sensors including TOF cameras, multi-spectral sensors, etc.
[0120] Combine the following Figure 2 The recording process of the protagonist mode in the possible design is described. The recording process includes configuration flow, preview display and recording.
[0121] Exemplarily, the configuration process of the recording process in the protagonist mode in a possible design is as follows: when the terminal device receives the trigger operation of the protagonist mode, the camera application sends a configuration command to the camera library module in the hardware abstraction layer through the camera access interface, and the configuration command is used to indicate the configuration of two preview streams and two recording streams. The control module in the camera library module allocates two preview cache queues (e.g., preview 1, preview 2) and two recording cache queues (e.g., recording 1, recording 2), as well as four memory queues (e.g., memory 1, memory 2, memory 3, memory 4) based on the configuration command; after the configuration is completed, the camera library module sends a message to the upper-layer application to indicate the end of the configuration.
[0122] The following is an explanation of the preview display during recording in the protagonist mode in a possible design.
[0123] After receiving the message indicating the end of configuration, the application sends a preview request to the camera library module in the hardware abstraction layer through the camera access interface. Taking the preview request for indicating large window preview and small window preview as an example, the control module controls the image receiving module based on the preview request to save the original image taken by the camera to memory 1 and memory 3. The image processing module selects the original image saved in memory 1 for algorithm processing, format conversion, etc. to obtain the first image, and saves the first image to preview 1 for callback to the application for large and small window preview display; the image processing module selects the original image saved in memory 3 for algorithm processing, format conversion, etc. to obtain the third image, and saves the third image to preview 2 for callback to the application for small window preview display.
[0124] The following is an explanation of the recording process of the protagonist mode in a possible design.
[0125] If the terminal device receives a recording operation, the camera application sends a recording request to the camera library module in the hardware abstraction layer via the camera access interface. Taking the preview request for indicating large window recording and small window recording as an example, the control module controls the image receiving module to save the original image to memory 1 to memory 4 based on the recording request.
[0126] The image processing module selects the original image saved in memory 1 for algorithm processing, format conversion, etc. to obtain the first image, and saves the first image to preview 1 for callback to the application for large and small window preview display; the image processing module selects the original image saved in memory 2 for algorithm processing, format conversion, etc. to obtain the second image, and saves the second image and the processed image to video 1 for callback to the application for large window encoding and storage. The image processing module selects the original image saved in memory 3 for algorithm processing, format conversion, etc. to obtain the third image, and saves the third image to preview 2 for callback to the application for small window preview display. The image processing module selects the original image saved in memory 4 for algorithm processing, format conversion, etc. to obtain the fourth image, and saves the fourth image to video 2 for callback to the application for small window encoding and storage.
[0127] It is understandable that when the terminal device uses the main mode to record, there may be 4 memory queues to store the original image, which will occupy a large amount of memory and cause the terminal device to consume a lot of power. In addition, 4 groups of image processing will be performed, which will occupy a large amount of computing memory.
[0128] Based on this, an embodiment of the present application provides a recording method, which corresponds a preview cache queue and a recording cache queue to the same memory queue; during the recording process, the original image in the memory queue is obtained for processing, and the processed image is saved to its corresponding preview cache queue and its corresponding recording cache queue, thereby reducing the number of original images cached by the terminal device, reducing memory usage, and thereby reducing power consumption.
[0129] For ease of understanding, the following Figure 3 Describe the software architecture of the terminal device.
[0130] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device.
[0131] like Figure 3 As shown, the terminal device can be divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer (HAL), the kernel layer, and the hardware layer.
[0132] The application layer can include a series of application packages. Figure 3 As shown, the application package may include applications such as camera, gallery, phone, map, etc.
[0133] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0134] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a camera access interface, etc.
[0135] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, capture the screen, etc.
[0136] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0137] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0138] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0139] The camera access interface allows applications to manage the camera and access the camera device, such as managing the camera to capture images.
[0140] The hardware abstraction layer may include multiple library modules, such as a camera library module. The Android system may load the corresponding library module for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware. In the embodiment of the present application, the camera library module includes a control module, an image processing module, a picture receiving module, a memory queue, and a cache queue.
[0141] The control module configures the memory queue and the cache queue based on the configuration command sent by the camera application (the configuration command corresponds to the shooting mode).
[0142] It is understandable that the shooting modes in the camera application may include but are not limited to: regular recording mode, protagonist mode, multi-lens recording mode, etc. The configuration command corresponding to the regular recording mode includes one preview stream and one recording stream. The configuration command corresponding to the multi-lens recording mode includes two preview streams and two recording streams. The configuration command corresponding to the protagonist mode includes two preview streams and two recording streams.
[0143] In the embodiment of the present application, when configuring the memory queue and the cache queue, the control module binds the preview cache queue and the recording cache queue to the same memory queue (for example, preview 1 and recording 1 are both bound to memory 1; preview 2 and recording 2 are both bound to memory 2).
[0144] The control module is also used to adjust the camera's shooting mode (e.g., large window preview mode, small window preview mode, large window recording mode, small window recording mode, beauty parameters, anti-shake parameters, exposure time, etc.) based on the request sent by the application after the configuration is completed. The control module can also adjust the relevant parameters of subsequent image processing based on the request sent by the application, such as the number of images selected from the memory queue, beauty parameters and anti-shake parameters during algorithm processing, and whether to perform shunting processing.
[0145] It is understandable that the specific content included in the request is related to the camera's recording mode. Exemplarily, when the terminal device enters the large window preview scene of the protagonist mode, the request is used to indicate the preview of the first perspective (panoramic). When the terminal device enters the small window preview scene of the protagonist mode, the request is used to indicate the preview of the first perspective (panoramic) and the preview of the second perspective (based on the tracking target). When the terminal device enters the large window recording scene of the protagonist mode, the request is used to indicate the preview and recording of the first perspective. When the terminal device enters the small window recording scene of the protagonist mode, the request is used to indicate the preview and recording of the first perspective, as well as the preview and recording of the second perspective.
[0146] The image processing module is used to perform image processing such as noise reduction and fusion algorithms and format conversion, and store the processed images in the corresponding cache queue.
[0147] The image receiving module is used to obtain the original image taken by the underlying hardware (for example, a TOF camera) and save the original image to the corresponding memory queue.
[0148] The memory queue is used to store raw images captured by the underlying hardware (e.g., TOF camera).
[0149] The cache queue is used to store images processed by the image processing module for preview display or encoding processing by upper-layer applications.
[0150] In a possible design, the number of queues in the cache queue is the same as the number of queues in the memory queue.
[0151] The kernel layer is a layer between hardware and software. The kernel layer is used to drive the hardware to make the hardware work. The kernel layer may include a camera driver, a display driver, an audio driver, etc., which is not limited in the embodiments of the present application.
[0152] The hardware layer can include various types of sensors, such as shooting sensors including TOF cameras, multi-spectral sensors, etc.
[0153] Combine the following Figure 3 The video recording process of the protagonist mode in the embodiment of the present application is described. The video recording process includes configuration flow, preview display and recording.
[0154] The configuration process of the recording process of the protagonist mode in the embodiment of the present application is as follows: when the terminal device receives the trigger operation of the protagonist mode, the camera application sends a configuration command to the camera library module in the hardware abstraction layer through the camera access interface, and the configuration command is used to indicate the configuration of two preview streams and two recording streams. The control module in the camera library module allocates two preview cache queues (for example, preview 1, preview 2) and two recording cache queues (for example, recording 1, recording 2), as well as two memory queues (for example, memory 1, memory 2) based on the configuration command; after the configuration is completed, the camera library module sends a message to the upper-layer application to indicate the end of the configuration.
[0155] The following is an explanation of the preview display during the recording process of the protagonist mode in the embodiment of the present application.
[0156] After receiving the message indicating the end of configuration, the application sends a preview request to the camera library module in the hardware abstraction layer through the camera access interface. Taking the preview request used to indicate large window preview and small window preview as an example, the control module controls the image receiving module based on the preview request to save the original image taken by the camera to memory 1 and memory 2. The image processing module selects the original image saved in memory 1 for algorithm processing, format conversion, etc. to obtain the first image, and saves the first image to preview 1 for callback to the application for large and small window preview display; the image processing module selects the original image saved in memory 2 for algorithm processing, format conversion, etc. to obtain the second image, and saves the second image to preview 2 for callback to the application for small window preview display.
[0157] The following is an explanation of the recording process in the protagonist mode in the embodiment of the present application.
[0158] If the terminal device receives a recording operation, the camera application sends a recording request to the camera library module in the hardware abstraction layer through the camera access interface. Taking the recording request used to indicate large window recording and small window recording as an example, the control module controls the image receiving module to save the original image to memory 1 and memory 2 based on the recording request. The image processing module selects the original image saved in memory 1 to perform algorithm processing, format conversion, etc. to obtain the first image, and performs shunt processing on the first image, and saves the first image to preview 1 and recording 1, so as to be called back to the application for large and small window preview display, and for callback to the application for large window encoding and storage. The image processing module selects the original image saved in memory 2 to perform algorithm processing, format conversion, etc. to obtain the second image, and performs shunt processing on the second image, and saves the second image to preview 2 and recording 2, so as to be called back to the application for small window preview display, and for callback to the application for small window encoding and storage.
[0159] For ease of understanding, the following Figure 4 and Figure 5 This section explains the recording process in the protagonist mode.
[0160] For example, Figure 4 A schematic diagram of a recording process of a protagonist mode provided in an embodiment of the present application. Figure 4 As shown, when the terminal device is Figure 4 In the main interface shown in a of FIG. 1 , when receiving the operation of the user opening the camera application 401, the terminal device can enter the Figure 4 The photo preview interface shown in b in the figure. The photo preview interface may include a large window 402 and shooting mode selection items. The large window 402 displays a large window preview image in real time; the shooting mode selection items include but are not limited to: portrait, photo, video 403, professional or other types of shooting mode selection items.
[0161] When the user Figure 4 When the camera preview interface shown in b in FIG. triggers recording 403 by clicking, touching, etc., the terminal device receives the user's operation of selecting the recording mode and enters Figure 4 The video preview interface shown in c in FIG. The video preview interface includes: a large window 404, recording parameter selection items and shooting mode selection items. The large window 404 displays the large window preview screen in real time; the recording parameter selection items include but are not limited to: protagonist mode 405, flash, filter, setting or other types of recording parameter selection items. The shooting mode selection items include but are not limited to: portrait, photo, video, professional or other types of shooting mode selection items.
[0162] When the user Figure 4 When the video preview interface shown in c in FIG. triggers the protagonist mode 405 by clicking, touching, etc., the terminal device receives the user's operation of selecting the protagonist mode preview and enters Figure 4The preview interface corresponding to the main character mode shown in d in FIG. The preview interface includes: a large window 406 and a recording control. The large window 406 displays a large window preview screen. When there is a person in the large window preview screen, the large window 406 also displays a tracking box 407.
[0163] It is understandable that the terminal device can also enter the Figure 4 The preview interface corresponding to the protagonist mode shown in d in FIG. Figure 4 "Other shooting mode options" in the photo preview interface shown in b Figure 4 The preview interface corresponding to the protagonist mode is shown in d in the figure. The embodiment of the present application does not limit the method of entering the preview interface corresponding to the protagonist mode.
[0164] In a possible implementation method 1, when the user triggers the tracking frame 407 by clicking or touching, the terminal device receives the operation of setting the tracking target, sets the person corresponding to the tracking frame as the tracking target, and enters Figure 4 The preview interface includes: a large window 408, a small window 409 and a recording control 410. The large window displays a large window preview screen. The small window 409 displays a small window preview screen. The small window preview screen corresponds to the tracking target.
[0165] When the user Figure 4 When the recording control 410 is triggered by clicking, touching, etc. in the preview interface shown in FIG. 4, the terminal device receives the operation of starting recording and enters Figure 4 The recording interface shown in f in FIG. The recording interface includes: a large window, a pause control, an end control and a small window. The large window displays a large window preview screen. The small window displays a small window preview screen, and the small window preview screen corresponds to the tracking target. The small window preview screen is a part of the large window preview screen.
[0166] It is understandable that when the terminal device starts recording, when the terminal device displays the small window preview screen and the large window preview screen on the recording interface, it will also save the content corresponding to the small window preview screen and the content corresponding to the large window preview screen, and then save the video corresponding to the small window and the video corresponding to the large window at the end of the recording.
[0167] In possible implementation method 2, when the user Figure 4 When the recording control 511 is triggered by clicking or touching the interface shown in d, the terminal device receives the operation of starting recording and enters Figure 5 The recording interface shown in a in FIG. The recording interface includes: a large window 501, a pause control and an end control. The large window 501 displays a large window preview screen. The large window 501 displays a large window preview screen. When there is a person in the large window preview screen, the large window 501 also displays a tracking box 502.
[0168] When the user triggers the tracking frame 502 by clicking or touching, the terminal device receives the operation of setting the tracking target, sets the person corresponding to the tracking frame as the tracking target, and enters Figure 4 The preview interface includes: a large window, a small window and a recording control. The large window displays a large window preview screen. The small window displays a small window preview screen. The small window preview screen corresponds to the tracking target.
[0169] Understandably, Figure 4 and Figure 5 The interface shown is only an example, and the corresponding interface may also include more or less content, which is not limited here. The terminal device may also select the protagonist mode in other ways, which is not limited in the embodiments of the present application.
[0170] Combine the following Figure 6 This section describes the interaction between the internal modules of the terminal device during the recording configuration and preview display process in the protagonist mode. Figure 6 As shown in the figure, the terminal device includes a camera application, a camera access interface, a control module, a picture receiving module, a memory, a cache queue, and a processing module. The interaction process includes:
[0171] S601: A terminal device receives a click operation on a first video recording control.
[0172] The first video control corresponds to the video mode. Figure 4 The protagonist mode 405 in the interface shown in c in FIG. When the terminal device receives a click operation on the protagonist mode 405, it enters the protagonist mode.
[0173] S602: The camera application sends a configuration command to the control module via the camera access interface.
[0174] The configuration command corresponds to the recording mode corresponding to the first recording control. Exemplarily, when the first recording control is in the protagonist mode, the configuration command is used to instruct configuration of two preview streams and two recording streams.
[0175] The configuration command also includes a camera number to enable the corresponding camera.
[0176] It is understandable that the terminal device may include one or more cameras, including but not limited to: a front camera, a rear main camera (which may be simply referred to as a rear main camera), a wide-angle camera (also referred to as an ultra-wide-angle camera) and a telephoto camera, etc.
[0177] S603: The control module configures the cache queue and the memory queue based on the configuration command.
[0178] Exemplarily, the control module configures two preview cache queues (preview 1 and preview 2), two recording cache queues (recording 1 and recording 2) and two memory queues (memory 1 and memory 2) based on the configuration command, and binds the preview cache queues and the recording cache queues to achieve the correspondence between the preview cache queue (preview 1) of the large window and the recording cache queue (memory 1) of the large window, and the correspondence between the preview cache queue (preview 2) of the small window and the recording cache queue (memory 2) of the small window.
[0179] In a possible implementation, the terminal device sets the same identifier (eg, stream ID) for the bound preview cache queue and recording cache queue, so as to facilitate subsequent identification and control by the terminal device.
[0180] Exemplarily, the terminal device sets the same identifier for preview 1 and video 1; the terminal device sets the same identifier for preview 2 and video 2.
[0181] In this way, when the terminal device enters the protagonist mode, it binds the recording stream and the preview stream, configures two preview streams and corresponding two groups of memory queues, reduces the time consumption of stream allocation and memory usage; and through the one-to-one correspondence between the large window preview stream and the recording stream, the preview and recording results of the large window are consistent; and through the one-to-one correspondence between the small window preview stream and the recording stream, the preview and recording results of the small window are consistent.
[0182] S604: After the configuration is completed, the control module sends a message indicating the end of the configuration to the camera application via the camera access interface.
[0183] S605: The camera application sends a first request to the control module via the camera access interface.
[0184] The first request is used to indicate a large window preview.
[0185] S606: The control module controls the image receiving module to obtain the original image collected by the underlying hardware based on the first request.
[0186] S607: The image receiving module stores the original image in memory 1.
[0187] S608: The image processing module selects the original image stored in the memory 1 to perform algorithm processing, format conversion and other processing to obtain a first image.
[0188] In the embodiment of the present application, the algorithm processing includes but is not limited to: noise reduction, linear brightening, tone mapping, gamma correction, fusion and other processing. The algorithm processing may also include beauty, anti-shake and other processing.
[0189] S609: The image processing module stores the first image in preview 1.
[0190] S610: The camera application calls the first image in preview 1 through the camera access interface to display the preview in a large window.
[0191] Adaptively, the terminal device displays a preview interface including a large window.
[0192] For example, the terminal device displays Figure 4 The interface shown in d.
[0193] In this way, the terminal device can realize a large window preview display.
[0194] S611: The terminal device receives an operation in which the user clicks on the tracking box, and the camera application sends a second request to the control module via the camera access interface.
[0195] The second request is used to indicate large window preview and small window preview.
[0196] S612: The control module controls the image receiving module to obtain the original image collected by the underlying hardware based on the second request;
[0197] S613: The image receiving module stores the original image in memory 1 and memory 2.
[0198] S614, the image processing module selects the original image stored in memory 1 to perform algorithm processing, format conversion and other processing to obtain a first image; selects the original image stored in memory 2 to perform algorithm processing, format conversion and other processing to obtain a second image.
[0199] S615: The image processing module stores the first image in preview 1 and stores the second image in preview 2.
[0200] S616. The camera application calls the first image in preview 1 through the camera access interface to display the preview in a large window, and calls the second image in preview 2 to display the preview in a small window.
[0201] Adaptively, the terminal device displays a preview interface including a large window and a small window.
[0202] For example, the terminal device displays Figure 4 The interface shown in e.
[0203] In this way, the terminal device can realize the preview display of a large window and the preview display of a small window.
[0204] Combine the following Figure 7 The internal module interaction process of the terminal device during the recording process is described. The terminal device includes a camera application, a camera access interface, a control module, a picture receiving module, a memory, a cache queue, and a processing module. The interaction process includes: if the terminal device receives a recording operation before executing the above S611.
[0205] S701: The terminal device receives a recording operation, and the camera application sends a third request to the control module via the camera access interface.
[0206] The third request is used to indicate large window preview and large window recording.
[0207] For example, the terminal device displays Figure 4 When the interface shown in d is displayed, the camera application receives an operation of the user clicking the recording control 411, and sends a third request to the control module via the camera access interface.
[0208] S702: The control module controls the image receiving module to obtain the original image captured by the underlying hardware based on the preview request;
[0209] S703: The image receiving module stores the original image in memory 1.
[0210] S704: The image processing module selects the original image stored in the memory 1 to perform algorithm processing, format conversion and other processing to obtain a first image.
[0211] S705. The image processing module stores the first image in preview 1 and record 1.
[0212] S706. The camera application calls the first image in preview 1 through the camera access interface to perform large-window preview display; and calls the first image in recording 1 to perform encoding processing to save the video corresponding to the large window.
[0213] Adaptively, the terminal device displays a recording interface including a large window.
[0214] For example, the terminal device displays Figure 5 The interface shown in a.
[0215] In this way, the terminal device can realize the preview display and recording of the large window. In addition, the video stream request corresponding to the large window does not need to be processed at the bottom layer, thereby reducing the memory usage of the two-channel video stream processing.
[0216] S707: The terminal device receives an operation of the user clicking the tracking box, and the camera application sends a fourth request to the control module via the camera access interface.
[0217] The fourth request is used to indicate large window preview and large window recording, as well as small window preview and small window recording.
[0218] For example, the terminal device displays Figure 5 When the interface shown in a in FIG. 5 is displayed, upon receiving an operation of the user clicking on the tracking box 502, the camera application sends a fourth request to the control module via the camera access interface.
[0219] S708: The control module controls the image receiving module to obtain the original image collected by the underlying hardware based on the fourth request.
[0220] S709: The image receiving module stores the original image in memory 1 and memory 2.
[0221] S710, the image processing module selects the original image stored in memory 1 to perform algorithm processing, format conversion and other processing to obtain a first image; selects the original image stored in memory 2 to perform algorithm processing, format conversion and other processing to obtain a second image.
[0222] S711 . The image processing module stores the first image in Preview 1 and Record 1 , and stores the second image in Preview 2 and Record 2 .
[0223] S712. The camera application calls the first image in Preview 1 through the camera access interface to display the preview in a large window, and calls the first image in Recording 1 for encoding processing to save the video corresponding to the large window; the camera application calls the second image in Preview 2 through the camera access interface to display the preview in a small window, and calls the first image in Recording 2 for encoding processing to save the video corresponding to the small window.
[0224] Adaptively, the terminal device displays a recording interface including large windows and small windows.
[0225] For example, the terminal device displays Figure 5 The interface shown in b.
[0226] In this way, the terminal device can realize preview display and recording of the large window, as well as preview display and recording of the small window. In addition, the recording request corresponding to the large window does not undergo underlying processing (i.e., the image saved in recording 1 does not undergo image processing), and the video stream request corresponding to the small window does not undergo underlying processing (i.e., the image saved in recording 2 does not undergo image processing), thereby reducing the memory usage of the two video stream processing.
[0227] It is understandable that if the terminal device receives a recording operation after executing the above S611, the camera application sends a fourth request to the control module via the camera access interface. The terminal device executes S708-S712. Adaptively, the terminal device displays a recording interface including a large window and a small window. Exemplarily, the terminal device displays Figure 4 The interface shown in e.
[0228] In summary, the terminal device can adopt a flexible and adaptive caching strategy based on the dynamic requests of the large window and the small window. The two preview stream data are used to send and display the large window and the small window respectively, and the video stream bound to it is split out through the preview stream to obtain two video streams for video encoding recording, achieving one recording and multiple benefits.
[0229] The above embodiment is described based on the recording process of the protagonist mode. The method provided in the embodiment of the present application can also be applied to other recording modes. The recording process of other recording modes is similar to the recording process of the protagonist mode, and will not be repeated here.
[0230] Exemplarily, taking the conventional recording mode (i.e., one recording generates one video) as an example, the terminal device configures one preview stream and one recording stream. Specifically, the terminal device receives a click operation on the second recording control. The camera application sends a configuration command to the control module via the camera access interface. Based on the configuration command, the control module configures a preview cache queue (Preview 1), a recording cache queue (Recording 1), and a memory queue (Memory 1), and binds the preview cache queue and the recording cache queue to achieve the correspondence between the preview cache queue (Preview 1) of the large window and the recording cache queue (Memory 1) of the large window.
[0231] When the terminal device uses the conventional video recording mode for previewing, the terminal device executes the above S604-S610. When the terminal device uses the conventional video recording mode for recording, the terminal device executes the above S701-S706.
[0232] It is understandable that the above embodiment takes the camera application as an example, and the embodiment of the present application can also be applied to third-party camera applications, such as WeChat, short video shooting applications, etc. The embodiment of the present application is not limited to this.
[0233] In some embodiments, the user can set the shooting mode corresponding to the recording method provided in the embodiment of the present application. When the terminal device receives the user setting the first shooting mode (for example, beauty recording, anti-shake recording, protagonist mode, etc.) to the first mode (for example, power saving mode, flow saving mode, etc.), the recording method provided in the embodiment of the present application is used for preview and recording in the first shooting mode. When the terminal device receives the user setting the first shooting mode to the second mode (for example, optimization mode, etc.), the recording method provided in the embodiment of the present application is not used for preview and recording in the first shooting mode.
[0234] For example, Figure 8 A schematic diagram of a video recording method provided in an embodiment of the present application. Figure 8 As shown, the recording method includes:
[0235] S801. The terminal device displays a first interface, which includes a first window and a recording control. The first window displays a first picture captured in real time by a camera.
[0236] In the embodiment of the present application, the first interface may be a preview interface for displaying an image for preview. The first interface may correspond to Figure 4 The interface shown. The first window may correspond to the large window mentioned above.
[0237] S802: When receiving a first operation on a recording control, the terminal device generates a first recording request.
[0238] The first operation may be a click operation, a touch operation, or other types of operations (for example, voice, etc.). The embodiment of the present application does not limit the type, method, etc. of the first operation.
[0239] S803. The terminal device obtains the original image captured by the camera based on the first recording request and stores it in a first memory queue; the terminal device processes the original image in the first memory queue to obtain a first image.
[0240] The first recording request may correspond to the third request or the fourth request mentioned above.
[0241] S804: The terminal device stores the first image in a first preview cache queue and a first recording cache queue, where both the first preview cache queue and the first recording cache queue correspond to the first memory queue.
[0242] S805: The terminal device displays a second interface, where the second interface includes a first window, where the first window displays a first picture, and where the first picture is generated based on a first image in a first preview cache queue.
[0243] S806: The terminal device encodes the first image in the first recording cache queue to save the first video.
[0244] The second interface may be a recording interface, where a video is recorded while displaying an image for preview. The first video may correspond to a video recorded in a large window.
[0245] It is understandable that during the recording process, the original image in the memory queue is obtained for processing, and the processed image is saved to its corresponding preview cache queue and its corresponding video cache queue. In this way, the number of original images cached by the terminal device can be reduced, the memory usage can be reduced, and the power consumption can be reduced.
[0246] Optionally, before the terminal device displays the first interface, the method also includes: the terminal device displays a third interface, the third interface includes a first control, and the first control corresponds to the first recording mode; the terminal device receives a second operation for the first control; the terminal device configures a first preview cache queue, a first recording cache queue and a first memory queue based on the first recording mode.
[0247] The first control may be a recording control, used to indicate a normal recording mode; it may also be a control for indicating other recording modes. The second operation may be a click operation, a touch operation, or other modes of operation (e.g., voice, etc.). The present application does not limit the type and mode of the second operation. The third interface may correspond to the above Figure 4 The camera preview interface is shown.
[0248] In this way, it can be applied to a recording mode that generates one-way video by recording once, for example, a regular recording mode, a professional recording mode, etc.
[0249] Optionally, before the terminal device displays the first interface, the method also includes: the terminal device displays a fourth interface, the fourth interface includes a second control, and the second control corresponds to the second recording mode; the terminal device receives a third operation for the second control; the terminal device configures a first preview cache queue, a second preview cache queue, a first recording cache queue, a second recording cache queue, a first memory queue, and a second memory queue based on the second recording mode; wherein the second preview cache queue and the second recording cache queue both correspond to the second memory queue.
[0250] The second control can be a protagonist mode control or a control of other recording modes. The third operation can be a click operation or a touch operation or an operation in other ways (e.g., voice, etc.). The present application embodiment does not limit the type and method of the third operation. The fourth interface can correspond to the above Figure 4 The preview interface corresponding to the protagonist mode shown.
[0251] In this way, it can be applied to a mode of generating two-way video by one recording, for example, a protagonist mode, etc., and has a wide range of applications.
[0252] Optionally, the second interface displays one or more tracking identifiers; the terminal device receives a fourth operation for the first tracking identifier, and the first tracking identifier is one of the one or more tracking identifiers; in response to the fourth operation, the terminal device generates a second recording request; the terminal device stores the original image captured by the camera in the first memory queue and the second memory queue based on the second recording request; the terminal device performs algorithm processing on the original image in the first memory queue to obtain the first image, and performs algorithm processing on the original image in the second memory queue to obtain the second image; the terminal device stores the first image in the first preview cache queue and the first recording cache queue, and stores the second image in the second preview cache queue and the second recording cache queue; the terminal device displays a fifth interface, the fifth interface includes a first window and a second window, the first window displays a first picture, the first picture is generated based on the first image in the first preview cache queue, and the second window displays a second picture, the second picture is generated based on the second image in the second preview cache queue; wherein the second picture is a part of the picture related to the first object in the first window, and the first object is the object corresponding to the first tracking identifier; the terminal device encodes based on the first image in the first recording cache queue to save the first video, and encodes based on the second image in the second recording cache queue to save the second video.
[0253] The tracking mark can be the tracking box mentioned above, or other marks. The second window can correspond to the small window mentioned above. The fourth operation can be a click operation, a touch operation, or other operation (for example, voice, etc.). The embodiment of the present application does not limit the type and method of the fourth operation. The second recording request can correspond to the fourth request mentioned above. The fifth interface can correspond to the fourth operation mentioned above. Figure 5 The interface shown. The second video may correspond to the video recorded in the small window.
[0254] The terminal device can set a tracking target for tracking during recording. When the terminal device selects a tracking target during recording, the terminal device obtains the original images in the two memory queues for processing, and saves the processed images to its corresponding preview cache queue and its corresponding video cache queue. In this way, the number of original images cached by the terminal device can be reduced, reducing memory usage and thus reducing power consumption.
[0255] Optionally, the first interface displays one or more tracking identifiers; before the terminal device receives the first operation on the recording control, the method also includes: the terminal device receives a fifth operation on the second tracking identifier, and the second tracking identifier is one of the one or more tracking identifiers; in response to the fifth operation, the terminal device displays a sixth interface, the sixth interface includes a first window, a second window and a recording control, the first window displays a first picture, the second window displays a second picture, the second picture is a part of the picture related to the first object in the first window, and the first object is the object corresponding to the first tracking identifier; the terminal device stores the original image captured by the camera in the second memory queue based on the first recording request; the terminal device processes the original image in the second memory queue to obtain the second image; the terminal device stores the second image in the second preview cache queue and the second recording cache queue; the second interface also includes a second window, the second window displays a second picture, and the second picture is generated based on the second image in the second preview cache queue; the terminal device encodes based on the second image in the second recording cache queue to save the second video.
[0256] The tracking mark can be the tracking box mentioned above, or other marks. The second window can correspond to the small window mentioned above. The fifth operation can be a click operation, a touch operation, or other operation (for example, voice, etc.). The embodiment of the present application does not limit the type and method of the fifth operation. The fifth interface can correspond to the small window mentioned above. Figure 5 The interface shown. The first recording request may correspond to the fourth request above. The second video may correspond to the video recorded in the small window.
[0257] The terminal device can start recording after setting the tracking target. The terminal device can display a small window to record one more channel.
[0258] Optionally, at a first moment, the terminal device detects that a first object is displayed at a first position of the first window, and the second window displays a portion of the screen related to the first object at the first position in the first window; at a second moment, the terminal device detects that a first object is displayed at a second position of the first window, and the second window displays a portion of the screen related to the first object at the second position in the first window.
[0259] In this way, the small window is displayed based on the tracking target. In the embodiment of the present application, the screen displayed in the second window (tracking screen) changes with the position of the tracking target. Specifically, the position of the first object (tracking object) in the screen displayed in the second window changes, which can be referred to as Figure 1A or Figure 1B For example, the interface at the first moment can be Figure 1A The interface shown in a in the figure, the interface at the second moment can be Figure 1AAlternatively, the interface at the first moment may be Figure 1B The interface shown in a in the figure, the interface at the second moment can be Figure 1B The interface shown in b.
[0260] In some embodiments, the focus changes with the position of the tracking target. Specifically, the focus changes with the position of the tracking target, which can be referred to Figure 1A or Figure 1B .
[0261] Optionally, the second picture is obtained by cropping the first picture.
[0262] Optionally, before the terminal device receives the first operation, the method also includes: the terminal device generates a first preview request; the terminal device obtains the original image captured by the camera based on the first preview request and stores it in a first memory queue; the terminal device processes the original image in the first memory queue to obtain a first image; the terminal device stores the first image in a first preview cache queue to generate a first picture.
[0263] In this way, when the terminal device is previewing, there is no image cache in the recording cache queue and the video will not be saved.
[0264] Optionally, the terminal device sets a first identifier for the first preview cache queue and the first recording cache queue; and / or the terminal device sets a second identifier for the second preview cache queue and the second recording cache queue.
[0265] The terminal device can identify the corresponding preview cache queue and recording cache queue through the identification, which is convenient for control and easy to implement.
[0266] In some embodiments, the user can set the shooting mode corresponding to the recording method provided in the embodiment of the present application. When the terminal device receives the user setting the first shooting mode (for example, beauty recording, anti-shake recording, protagonist mode, etc.) to the first mode (for example, power saving mode, flow saving mode, etc.), the recording method provided in the embodiment of the present application is used for preview and recording in the first shooting mode. When the terminal device receives the user setting the first shooting mode to the second mode (for example, optimization mode, etc.), the recording method provided in the embodiment of the present application is not used for preview and recording in the first shooting mode.
[0267] The video recording method of the embodiment of the present application has been described above, and the device for executing the video recording method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the video recording method.
[0268] like Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of a video recording device provided in an embodiment of the present application. The video recording device may be a terminal device in an embodiment of the present application, or a chip or chip system in a terminal device.
[0269] like Fig. 9 As shown, the video recording device 2100 can be used in a communication device, a circuit, a hardware component or a chip, and the video recording device includes: a display unit 2101 and a processing unit 2102. The display unit 2101 is used to support the display step performed by the video recording device 2100; the processing unit 2102 is used to support the information processing step performed by the video recording device 2100.
[0270] In a possible implementation, the video recording device 2100 may also include a communication unit 2103. Specifically, the communication unit is used to support the video recording device 2100 to perform the steps of sending and receiving data. The communication unit 2103 may be an input or output interface, a pin or a circuit.
[0271] In a possible embodiment, the video recording device may further include: a storage unit 2104. The processing unit 2102 and the storage unit 2104 are connected via a line. The storage unit 2104 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 2104 may exist independently and be connected to the processing unit 2102 of the video recording device via a communication line. The storage unit 2104 may also be integrated with the processing unit 2102.
[0272] The storage unit 2104 can store computer-executable instructions of the method in the terminal device so that the processing unit 2102 executes the method in the above embodiment. The storage unit 2104 can be a register, a cache, or a RAM, etc. The storage unit 2104 can be integrated with the processing unit 2102. The storage unit 2104 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 2104 can be independent of the processing unit 2102.
[0273] The recording method provided in the embodiment of the present application can be applied to electronic devices with recording functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0274] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0275] For example, Fig.10 A schematic diagram of the structure of a terminal device is shown.
[0276] The terminal device may include a processor 1010, an external memory interface 1020, an internal memory 1021, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0277] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0278] The processor 1010 may include one or more processing units, for example, the processor 1010 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0279] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0280] The processor 1010 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1010 is a cache memory. The memory may store instructions or data that the processor 1010 has just used or cyclically used. If the processor 1010 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1010, and thus improves the efficiency of the system.
[0281] In some embodiments, the processor 1010 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0282] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0283] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0284] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0285] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0286] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0287] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0288] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0289] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow chart and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart or multiple flows and / or one box or multiple boxes of the block chart.
[0290] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A video recording method, characterized in that: The method comprises: The terminal device displays a first interface, the first interface includes a first window and a recording control, the first window displays a first picture captured in real time by a camera, and the first interface displays one or more tracking marks; When receiving a first operation on the recording control, the terminal device generates a first recording request; The terminal device obtains the original image captured by the camera based on the first recording request and stores it in a first memory queue; The terminal device processes the original image in the first memory queue to obtain a first image; The terminal device stores the first image in a first preview cache queue and a first recording cache queue, where both the first preview cache queue and the first recording cache queue correspond to the first memory queue; The terminal device displays a second interface, the second interface includes the first window, the first window displays the first picture, and the first picture is generated based on the first image in the first preview cache queue; The terminal device encodes the first image in the first recording cache queue to save the first video; Before the terminal device displays the first interface, the method further includes: The terminal device displays a fourth interface, the fourth interface includes a second control, and the second control corresponds to the second recording mode; The terminal device receives a third operation on the second control; The terminal device configures the first preview cache queue, the second preview cache queue, the first recording cache queue, the second recording cache queue, the first memory queue and the second memory queue based on the second recording mode; The second preview cache queue and the second recording cache queue both correspond to the second memory queue.
2. The method according to claim 1, characterized in that The second interface displays one or more tracking logos; The terminal device receives a fourth operation on a first tracking identifier, where the first tracking identifier is one of the one or more tracking identifiers; In response to the fourth operation, the terminal device generates a second recording request; The terminal device stores the original image captured by the camera in the first memory queue and the second memory queue based on the second recording request; The terminal device performs algorithm processing on the original image in the first memory queue to obtain the first image, and performs algorithm processing on the original image in the second memory queue to obtain the second image; The terminal device stores the first image in a first preview cache queue and a first recording cache queue, and stores the second image in a second preview cache queue and a second recording cache queue; The terminal device displays a fifth interface, the fifth interface includes the first window and a second window, the first window displays the first picture, the first picture is generated based on the first image in the first preview cache queue, and the second window displays the second picture, the second picture is generated based on the second image in the second preview cache queue; The second picture is a part of the picture related to the first object in the first window, and the first object is the object corresponding to the first tracking mark; The terminal device encodes based on the first image in the first recording cache queue to save the first video, and encodes based on the second image in the second recording cache queue to save the second video.
3. The method according to claim 2, characterized in that Before the terminal device receives a first operation on the recording control, the method further includes: The terminal device receives a fifth operation for a second tracking identifier, where the second tracking identifier is one of the one or more tracking identifiers; In response to the fifth operation, the terminal device displays a sixth interface, the sixth interface including a first window, a second window, and the recording control, the first window displays the first picture, the second window displays a second picture, the second picture is a part of the picture related to the first object in the first window, and the first object is an object corresponding to the first tracking identifier; The terminal device obtains the original image captured by the camera based on the first recording request and stores it in the second memory queue; The terminal device processes the original image in the second memory queue to obtain a second image; The terminal device stores the second image in a second preview cache queue and a second recording cache queue; The second interface further includes a second window, the second window displays the second picture, and the second picture is generated based on the second image in the second preview cache queue; The terminal device encodes the second image in the second recording cache queue to save the second video.
4. The method according to claim 2 or 3, characterized in that: At a first moment, the terminal device detects that the first object is displayed at a first position of the first window, and the second window displays a portion of a screen related to the first object at the first position of the first window; At a second moment, the terminal device detects that the first object is displayed at a second position of the first window, and the second window displays a portion of the screen at the second position in the first window that is related to the first object.
5. The method according to claim 2 or 3, characterized in that The second picture is obtained by cropping the first picture.
6. The method according to any one of claims 1 to 3, characterized in that: Before the terminal device receives the first operation, the method further includes: The terminal device generates a first preview request; The terminal device obtains the original image captured by the camera based on the first preview request and stores the original image in a first memory queue; The terminal device processes the original image in the first memory queue to obtain the first image; The terminal device stores the first image in the first preview cache queue to generate the first picture.
7. The method according to any one of claims 1 to 3, characterized in that: The terminal device sets a first identifier for the first preview cache queue and the first recording cache queue; And / or, the terminal device sets a second identifier for the second preview cache queue and the second recording cache queue.
8. A terminal device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 7.
