Video processing method and device, computer equipment and storage medium
By processing the video frame data of the panoramic camera in the hardware abstraction layer, initializing the video memory module and allocating the area, the fast split-screen display of the panoramic camera is realized, solving the problem of long multi-screen display processing time in the prior art, and improving data processing efficiency and user experience.
Patent Information
- Application Number
- CN202510357228.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-18
AI Technical Summary
The existing panoramic cameras cannot display multiple related screen information at the same time in a moving scene. The video frame data flow nodes are many and the processing time is long, so they cannot adapt to the data processing environment of the panoramic camera system.
The video frames obtained by the first and second lenses are processed in the hardware abstraction layer, the video memory module is initialized and the video memory area is allocated, the video frame data is mapped to the video memory area, and transmitted to the application layer for rendering and displaying on the split screen.
It effectively reduces the process nodes of video frame data, shortens processing time, improves data processing efficiency, realizes the fast split-screen display effect of the panoramic camera, and enhances the user experience.
Smart Images

Figure CN120343406A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of video processing, and specifically relate to a video processing method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of panoramic cameras, people begin to use panoramic cameras to take pictures or videos in more and more scenarios. Among them, in sports scenarios such as cycling or skiing, users fix the panoramic camera on sports equipment such as cycling or skiing through a selfie device, and take pictures while moving. Users can view the video pictures taken by the panoramic camera while cycling or skiing.
[0003] However, in existing panoramic cameras, users can only see a single video picture on the display screen of the panoramic camera, and cannot see more picture information related to the user's movement process. In the existing multi-picture display processing, there are problems such as many video frame data flow nodes and long processing time, and it cannot adapt to the data processing environment of the panoramic camera system. Summary of the Invention
[0004] Embodiments of the present application provide a video processing method, apparatus, computer device, and storage medium. The technical problem to be solved is that in view of the defects of the prior art, in the existing multi-picture display processing, there are problems such as many video frame data flow nodes and long processing time, and it cannot adapt to the data processing environment of the panoramic camera system.
[0005] To solve the above technical problem, a technical solution adopted by the present application is: to provide a video processing method, apparatus, computer device, and storage medium. The video processing method is applied to a panoramic camera, and the video processing method includes:
[0006] In the hardware abstraction layer, process the first video frame obtained by the first lens and the second video frame obtained by the second lens to obtain a panoramic video frame;
[0007] Initialize the video memory module in the hardware abstraction layer. The video memory module includes a first video memory area and a second video memory area;
[0008] Map the panoramic video frame to the video memory module to obtain first data to be displayed and second data to be displayed. The first video memory area processes the first data to be displayed, and the second video memory area processes the second data to be displayed;
[0009] The hardware abstraction layer transmits the first data to be displayed and the second data to be displayed to the application layer;
[0010] In the application layer, the first data of the to-be-displayed screen and the second data of the to-be-displayed screen are rendered to obtain a first display screen and a second display screen, and are displayed on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display screen, and the second display window displays the second display screen.
[0011] In a specific embodiment, initializing the video memory module in the hardware abstraction layer, the video memory module includes a first video memory area and a second video memory area, including:
[0012] The video memory module obtains the display screen parameters of the panoramic camera, and allocates the video memory sizes of the first video memory area and the second video memory area.
[0013] In a specific embodiment, the display screen parameters include the resolution parameters of the display screen. The video memory module obtains the resolution parameters of the display screen, calculates the resolution parameters of the first display window and the second display window according to the resolution parameters of the display screen, and allocates the video memory sizes of the first video memory area and the second video memory area according to the resolution parameters of the first display window and the second display window.
[0014] In a specific embodiment, mapping the panoramic video frame to the video memory module to obtain the first data of the to-be-displayed screen and the second data of the to-be-displayed screen, including:
[0015] The video memory module obtains the picture position information. According to the picture position information, the corresponding picture data is mapped from the panoramic video frame to the pixel positions corresponding to the first video memory area to obtain the first data of the to-be-displayed screen, and the corresponding picture data is mapped from the panoramic video frame to the pixel positions corresponding to the second video memory area to obtain the second data of the to-be-displayed screen.
[0016] In a specific embodiment, the video memory module obtains the picture position information, including:
[0017] The hardware abstraction layer obtains the perspective adjustment operations of the first display screen and the second display screen by the user through the interaction interface of the application layer, generates the picture position information, and the video memory module obtains the picture position information;
[0018] Or, the picture position information is the intermediate area information of the preset first video frame and the second video frame.
[0019] In a specific embodiment, in the hardware abstraction layer, processing the first video frame obtained by the first lens and the second video frame obtained by the second lens to obtain a panoramic video frame, including:
[0020] In the hardware abstraction layer, anti-shake processing is performed on the first video frame and the second video frame to obtain a stable first video frame and a stable second video frame, and the stable first video frame and the stable second video frame are spliced to obtain the panoramic video frame.
[0021] In a specific embodiment, the hardware abstraction layer transmits the first data of the to-be-displayed picture and the second data of the to-be-displayed picture to the application layer, including:
[0022] The hardware abstraction layer transmits the first data of the to-be-displayed picture and the second data of the to-be-displayed picture to the application layer through the camera framework layer, and stores the first data of the to-be-displayed picture, the second data of the to-be-displayed picture, and the corresponding timestamps in a cache queue.
[0023] In a specific embodiment, there is also a video processing device, which includes:
[0024] A panoramic video frame processing module, which is used to process the first video frame obtained by the first lens and the second video frame obtained by the second lens in the hardware abstraction layer to obtain a panoramic video frame;
[0025] An initialization module, which is used to initialize the video memory module in the hardware abstraction layer. The video memory module includes a first video memory area and a second video memory area;
[0026] A mapping module, which is used to map the panoramic video frame to the video memory module to obtain the first data of the to-be-displayed picture and the second data of the to-be-displayed picture. The first video memory area processes the first data of the to-be-displayed picture, and the second video memory area processes the second data of the to-be-displayed picture;
[0027] A transmission module, which is used for the hardware abstraction layer to transmit the first data of the to-be-displayed picture and the second data of the to-be-displayed picture to the application layer;
[0028] A split-screen display module, which is used to render the first data of the to-be-displayed picture and the second data of the to-be-displayed picture in the application layer to obtain a first display picture and a second display picture, and display them on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display picture, and the second display window displays the second display picture.
[0029] In a specific embodiment, it further includes a computer device, comprising a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the video processing method described in any of the above specific embodiments are implemented.
[0030] In a specific embodiment, it further includes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the video processing method described in any of the above specific embodiments are implemented.
[0031] The beneficial effects of the present application are as follows: Different from the prior art, a video processing method, device, computer device, and storage medium provided by the embodiments of the present application. The video processing method is applied to a panoramic camera, and the video processing method includes:
[0032] In the hardware abstraction layer, process the first video frame obtained by the first lens and the second video frame obtained by the second lens to obtain a panoramic video frame;
[0033] Initialize the video memory module in the hardware abstraction layer. The video memory module includes a first video memory area and a second video memory area;
[0034] Map the panoramic video frame to the video memory module to obtain first data to be displayed and second data to be displayed. The first video memory area processes the first data to be displayed, and the second video memory area processes the second data to be displayed;
[0035] The hardware abstraction layer transmits the first data to be displayed and the second data to be displayed to the application layer;
[0036] In the application layer, render the first data to be displayed and the second data to be displayed to obtain a first display screen and a second display screen, and display them on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display screen, and the second display window displays the second display screen.
[0037] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0038] In the present application, by centrally calculating and processing all the video frame data of the panoramic camera in the hardware abstraction layer, the process nodes of the video frame data are effectively reduced, the processing time of the video frame data is shortened, and the data processing efficiency is improved to adapt to the system of the panoramic camera, so that the panoramic camera can quickly obtain the split-screen display effect.
[0039] The video processing method of this application provides a brand-new panoramic video screen display for the user's motion scenarios, adds a brand-new way of playing panoramic videos, and improves the playability of the panoramic camera for users. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the specific implementation manners of this application or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific implementation manners or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0041] Figure 1 It is a schematic flowchart of the implementation of a video processing method provided in Embodiment 1 of this application;
[0042] Figure 2 It is a schematic diagram of the module composition of a video processing device provided in Embodiment 2 of this application;
[0043] Figure 3 It is a schematic internal structure diagram of a computer device provided in Embodiment 3 of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0044] The following will further describe this application in detail in combination with the drawings and the embodiments. It should be specifically noted that the following embodiments are only used to illustrate this application, but do not limit the scope of this application. Similarly, the following embodiments are only some embodiments of this application rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
[0045] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusion. A process, method, system, product or device such as including a series of steps or modules is not limited to the listed steps or modules, but optionally further includes steps or modules not listed, or optionally further includes other steps or modules inherent to these processes, methods, products or devices.
[0046] The above terms are only for convenience of description and should not be construed as limiting the technical solution of this application.
[0047] References to "embodiments" in this specification mean that the particular features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0048] The following describes the specific implementation of the present application in detail with reference to specific embodiments:
[0049] Embodiment 1.
[0050] Figure 1 The implementation process of a video processing method provided in Embodiment 1 of the present application is shown. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown and are described in detail as follows.
[0051] In the hardware abstraction layer, the first video frame obtained by the first lens and the second video frame obtained by the second lens are processed to obtain a panoramic video frame.
[0052] It should be noted that the embodiments of the present application are applicable to video image processing devices such as video display and acquisition, such as panoramic cameras or computer devices with video processing and display functions.
[0053] For the panoramic camera, the first lens and the second lens, both the first lens and the second lens are fish-eye lenses, and the two fish-eye lenses are arranged back to back and shoot video pictures in two different directions respectively. During the movement of the user, the user usually cares more about the forward direction and the backward direction. Therefore, the panoramic camera is fixed on the moving device, and one of the fish-eye lenses shoots in the forward direction of the movement, and the other fish-eye lens shoots in the direction of the user's back.
[0054] Initialize the video memory module in the hardware abstraction layer. The video memory module includes a first video memory area and a second video memory area.
[0055] It should be noted that when initializing the video memory module in the hardware abstraction layer, the video memory area and the video memory size are reallocated according to the display screen parameters of the panoramic camera. The first video memory area and the second video memory area are used to process the corresponding video frame data separately.
[0056] One specific implementation is that when initializing the video memory module in the hardware abstraction layer, the video memory module includes a first video memory area and a second video memory area, and includes:
[0057] The video memory module obtains the display screen parameters of the panoramic camera and allocates the video memory sizes of the first video memory area and the second video memory area.
[0058] In one specific implementation, the display screen parameters include the resolution parameters of the display screen. The video memory module obtains the resolution parameters of the display screen, calculates the resolution parameters of the first display window and the second display window according to the resolution parameters of the display screen, and allocates the video memory sizes of the first video memory area and the second video memory area according to the resolution parameters of the first display window and the second display window.
[0059] Map the panoramic video frame to the video memory module to obtain first data of a frame to be displayed and second data of a frame to be displayed. The first video memory area processes the first data of a frame to be displayed, and the second video memory area processes the second data of a frame to be displayed.
[0060] It should be noted that the resolution parameters of the display screen can be provided by the underlying driver module of the display screen or directly extracted from the storage module of the panoramic camera. The resolution parameters of the display screen are preset and stored in the storage module.
[0061] Calculate the resolution parameters of the first display window and the second display window according to the resolution parameters of the display screen. The resolution parameters of the first display window and the resolution parameters of the second display window can be equal, or the resolution parameters of the first display window are greater than the resolution parameters of the second display window, or the resolution parameters of the first display window are less than the resolution parameters of the second display window. Then allocate the video memory sizes of the first video memory area and the second video memory area according to the resolution parameters of the first display window and the second display window.
[0062] Map the panoramic video frame to the video memory module to obtain first data of a frame to be displayed and second data of a frame to be displayed. The first video memory area processes the first data of a frame to be displayed, and the second video memory area processes the second data of a frame to be displayed.
[0063] It should be noted that in the hardware abstraction layer, the first video frame and the second video frame are subjected to anti-shake processing, de-jello processing, panoramic stitching processing, etc. to obtain the stable panoramic video frame. Select some picture contents from the panoramic video frame and map them to the video memory module, respectively mapped to the first video memory area and the second video memory area, that is, the first video memory area processes the first data of a frame to be displayed, and the second video memory area processes the second data of a frame to be displayed.
[0064] One specific implementation is to map the panoramic video frame to the video memory module to obtain first data of a frame to be displayed and second data of a frame to be displayed, including:
[0065] The video memory module obtains picture position information, and according to the picture position information, maps corresponding picture data from the panoramic video frame to pixel positions corresponding to the first video memory area to obtain the first data of a frame to be displayed, and maps corresponding picture data from the panoramic video frame to pixel positions corresponding to the second video memory area to obtain the second data of a frame to be displayed.
[0066] It should be noted that the picture position information is the correspondence between the pixel information of the panoramic video frame and the pixel positions in the video memory module. Corresponding pixel information is mapped from the panoramic video frame to pixel positions corresponding to the first video memory area to obtain the first data of a frame to be displayed. The first video memory area processes the first data of a frame to be displayed. And corresponding pixel information is mapped from the panoramic video frame to pixel positions corresponding to the second video memory area to obtain the second data of a frame to be displayed. After the hardware abstraction layer transmits the first data of a frame to be displayed and the second data of a frame to be displayed to the application layer, the first data of a frame to be displayed is rendered to obtain a first display frame and is displayed in the first display window of the display screen of the panoramic camera. The second data of a frame to be displayed is rendered to obtain a second display frame and is displayed in the second display window of the display screen of the panoramic camera.
[0067] One specific implementation is that the video memory module obtains picture position information, including:
[0068] The hardware abstraction layer obtains the perspective adjustment operations of the user on the first display frame and the second display frame through the interaction interface of the application layer, generates picture position information, and the video memory module obtains the picture position information;
[0069] Or, the picture position information is the intermediate area information of the preset first video frame and second video frame.
[0070] It should be noted that for the user's perspective adjustment operations on the first display screen and the second display screen through the interaction interface of the application layer, such as the user adjusting the screen perspectives of the first display screen and the second display screen by touching the screen, the hardware abstraction layer obtains the perspective adjustment operations, generates screen position information according to the perspective adjustment operations, the video memory module obtains the screen position information, and updates the first data of the screen to be displayed and the second data of the screen to be displayed to obtain the updated first data of the screen to be displayed and the updated second data of the screen to be displayed. After the hardware abstraction layer transmits the updated first data of the screen to be displayed and the updated second data of the screen to be displayed to the application layer, the updated first data of the screen to be displayed is rendered to obtain the updated first display screen and is displayed in the first display window of the display screen of the panoramic camera. The updated second data of the screen to be displayed is rendered to obtain the second display screen and is displayed in the second display window of the display screen of the panoramic camera. The user can further perform the perspective adjustment operation on the second display screen through the first display window or the second display window to obtain the desired screen perspective.
[0071] Another feasible specific implementation manner is that the screen position information is the intermediate area information of the preset first video frame and the second video frame, that is, the video frame collected by the optical center area of the first lens and the video frame collected by the optical center area of the second lens. The pixel information of the video frame collected by the optical center area of the first lens is mapped to the corresponding pixel positions in the first video memory area to obtain the first data of the screen to be displayed, and the pixel information of the video frame collected by the optical center area of the second lens is mapped to the corresponding pixel positions in the second video memory area to obtain the second data of the screen to be displayed.
[0072] The hardware abstraction layer transmits the first data of the screen to be displayed and the second data of the screen to be displayed to the application layer.
[0073] One of the specific implementation manners is that the hardware abstraction layer transmits the first data of the screen to be displayed and the second data of the screen to be displayed to the application layer, including:
[0074] The hardware abstraction layer transmits the first data of the screen to be displayed and the second data of the screen to be displayed to the application layer through the camera framework layer, and stores the first data of the screen to be displayed, the second data of the screen to be displayed and the corresponding timestamps in the cache queue.
[0075] It should be noted that after the hardware abstraction layer transmits the processed first to-be-displayed frame data and the second to-be-displayed frame data to the application layer through the camera framework layer, the application layer can directly utilize the first to-be-displayed frame data and the second to-be-displayed frame data, saving the processing nodes of the image frame data. The application layer stores the first to-be-displayed frame data, the second to-be-displayed frame data, and the corresponding timestamps in a cache queue, facilitating the graphics card to quickly render the first to-be-displayed frame data and the second to-be-displayed frame data at any time.
[0076] In the application layer, the first to-be-displayed frame data and the second to-be-displayed frame data are rendered to obtain a first display frame and a second display frame, and are displayed on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display frame, and the second display window displays the second display frame.
[0077] One specific implementation is that in the hardware abstraction layer, the first video frame obtained by the first lens and the second video frame obtained by the second lens are processed to obtain a panoramic video frame, including:
[0078] In the hardware abstraction layer, the first video frame and the second video frame are subjected to anti-shake processing to obtain a stable first video frame and a stable second video frame, and the stable first video frame and the stable second video frame are spliced to obtain the panoramic video frame.
[0079] It should be noted that in the hardware abstraction layer, the panoramic processing of the first video frame and the second video frame, including anti-shake processing and splicing processing, can be completed in real time to obtain the panoramic video frame, facilitating further processing of the panoramic video frame in the hardware abstraction layer.
[0080] In the embodiment of the present application, by centrally calculating and processing all the video frame data of the panoramic camera in the hardware abstraction layer, the process nodes of the video frame data are effectively reduced, the processing time of the video frame data is shortened, and the data processing efficiency is improved to adapt to the system of the panoramic camera, enabling the panoramic camera to quickly obtain the split-screen display effect of the video frame.
[0081] Embodiment Two.
[0082] Figure 2 The schematic diagram of the module composition of a video processing device provided in Embodiment Two of the present application is shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown.
[0083] A video processing device according to an embodiment of the present application, the video processing device includes:
[0084] A panoramic video frame processing module, which is used to process a first video frame obtained by a first lens and a second video frame obtained by a second lens in a hardware abstraction layer to obtain a panoramic video frame;
[0085] An initialization module, which is used to initialize a video memory module in the hardware abstraction layer, and the video memory module includes a first video memory area and a second video memory area;
[0086] A mapping module, which is used to map the panoramic video frame to the video memory module to obtain first data of a picture to be displayed and second data of a picture to be displayed. The first video memory area processes the first data of the picture to be displayed, and the second video memory area processes the second data of the picture to be displayed;
[0087] A transmission module, which is used to transmit the first data of the picture to be displayed and the second data of the picture to be displayed from the hardware abstraction layer to an application layer;
[0088] A split-screen display module, which is used to render the first data of the picture to be displayed and the second data of the picture to be displayed in the application layer to obtain a first display picture and a second display picture, and display them on a display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display picture, and the second display window displays the second display picture.
[0089] A video processing device according to an embodiment of the present application is used to implement the video processing method provided by any specific implementation manner of Embodiment 1 of the present application:
[0090] In a hardware abstraction layer, process a first video frame obtained by a first lens and a second video frame obtained by a second lens to obtain a panoramic video frame;
[0091] Initialize the video memory module in the hardware abstraction layer, and the video memory module includes a first video memory area and a second video memory area;
[0092] Map the panoramic video frame to the video memory module to obtain first data of a picture to be displayed and second data of a picture to be displayed. The first video memory area processes the first data of the picture to be displayed, and the second video memory area processes the second data of the picture to be displayed;
[0093] The hardware abstraction layer transmits the first data of the picture to be displayed and the second data of the picture to be displayed to the application layer;
[0094] In the application layer, the first data of the to-be-displayed screen and the second data of the to-be-displayed screen are rendered to obtain a first display screen and a second display screen, and are displayed on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display screen, and the second display window displays the second display screen.
[0095] It should be noted that each module in the above video processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0096] It should be noted that for the technical details not described in detail in this embodiment, reference can be made to the video processing method provided in any specific implementation manner of the above Embodiment 1, which will not be elaborated here.
[0097] Embodiment 3:
[0098] In an embodiment of the present application, a computer device is provided. Figure 3 It is a schematic internal structure diagram of the computer device.
[0099] The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the video processing method in any specific implementation manner provided in Embodiment 1 of the present application, specifically including:
[0100] In the hardware abstraction layer, the first video frame obtained by the first lens and the second video frame obtained by the second lens are processed to obtain a panoramic video frame.
[0101] Initialize the video memory module in the hardware abstraction layer. The video memory module includes a first video memory area and a second video memory area.
[0102] Map the panoramic video frame to the video memory module to obtain the first data of the to-be-displayed screen and the second data of the to-be-displayed screen. The first video memory area processes the first data of the to-be-displayed screen, and the second video memory area processes the second data of the to-be-displayed screen.
[0103] The hardware abstraction layer transmits the first data of the to-be-displayed screen and the second data of the to-be-displayed screen to the application layer.
[0104] In the application layer, the first to-be-displayed screen data and the second to-be-displayed screen data are rendered to obtain a first display screen and a second display screen, and are displayed on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display screen, and the second display window displays the second display screen.
[0105] It should be noted that the computer device may be a terminal, and its internal structure diagram may be as Figure 3 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a video generation method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0106] Those skilled in the art can understand that Figure 3 the structure shown in
[0107] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0108] Embodiment 4.
[0109] In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the video processing method in any specific implementation manner provided in Embodiment 1 of the present application, specifically including:
[0110] In the hardware abstraction layer, the first video frame obtained by the first lens and the second video frame obtained by the second lens are processed to obtain a panoramic video frame;
[0111] Initialize the video memory module in the hardware abstraction layer, where the video memory module includes a first video memory area and a second video memory area;
[0112] Map the panoramic video frame to the video memory module to obtain first data of a frame to be displayed and second data of a frame to be displayed. The first video memory area processes the first data of the frame to be displayed, and the second video memory area processes the second data of the frame to be displayed;
[0113] The hardware abstraction layer transmits the first data of the frame to be displayed and the second data of the frame to be displayed to the application layer;
[0114] In the application layer, render the first data of the frame to be displayed and the second data of the frame to be displayed to obtain a first display frame and a second display frame, and display them on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display frame, and the second display window displays the second display frame.
[0115] It should be noted that for technical details not described in detail in this embodiment, reference can be made to the video processing method provided in the first embodiment above, which will not be elaborated here.
[0116] Different from the prior art, a video processing method, apparatus, computer device, and storage medium provided by an embodiment of the present application. The video processing method is applied to a panoramic camera, and the video processing method includes:
[0117] In the hardware abstraction layer, process a first video frame obtained by a first lens and a second video frame obtained by a second lens to obtain a panoramic video frame;
[0118] Initialize the video memory module in the hardware abstraction layer, where the video memory module includes a first video memory area and a second video memory area;
[0119] Map the panoramic video frame to the video memory module to obtain first data of a frame to be displayed and second data of a frame to be displayed. The first video memory area processes the first data of the frame to be displayed, and the second video memory area processes the second data of the frame to be displayed;
[0120] The hardware abstraction layer transmits the first data of the frame to be displayed and the second data of the frame to be displayed to the application layer;
[0121] In the application layer, the first data of the to-be-displayed screen and the second data of the to-be-displayed screen are rendered to obtain a first display screen and a second display screen, which are then displayed on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display screen, and the second display window displays the second display screen.
[0122] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:
[0123] In the present application, all the video frame data of the panoramic camera is centrally calculated and processed in the hardware abstraction layer, effectively reducing the process nodes of the video frame data, shortening the processing time of the video frame data, improving the data processing efficiency, and adapting to the system of the panoramic camera, so that the panoramic camera can quickly obtain the split-screen display effect.
[0124] The video processing method of the present application provides a brand-new panoramic video screen display for the user's motion scene, adds a brand-new way of playing panoramic videos, and improves the playability of the panoramic camera for the user.
[0125] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, in each embodiment of the present application, the functional modules can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0127] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a terminal device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0128] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A video processing method, which is applied to a panoramic camera, and is characterized in that, The video processing method includes: In the hardware abstraction layer, process the first video frame obtained by the first lens and the second video frame obtained by the second lens to obtain a panoramic video frame; Initialize the video memory module in the hardware abstraction layer, where the video memory module includes a first video memory area and a second video memory area; Map the panoramic video frame to the video memory module to obtain first data to be displayed and second data to be displayed. The first video memory area processes the first data to be displayed, and the second video memory area processes the second data to be displayed; The hardware abstraction layer transmits the first data to be displayed and the second data to be displayed to the application layer; In the application layer, render the first data to be displayed and the second data to be displayed to obtain a first display image and a second display image, and display them on the display screen of the panoramic camera. The display screen includes a first display window and a second display window. The first display window displays the first display image, and the second display window displays the second display image.
2. The video processing method according to claim 1, wherein The initialization of the video memory module in the hardware abstraction layer, where the video memory module includes a first video memory area and a second video memory area, includes: The video memory module obtains the display screen parameters of the panoramic camera and allocates the video memory sizes of the first video memory area and the second video memory area.
3. The video processing method according to claim 2, wherein: The display screen parameters include the resolution parameters of the display screen. The video memory module obtains the resolution parameters of the display screen, calculates the resolution parameters of the first display window and the second display window according to the resolution parameters of the display screen, and allocates the video memory sizes of the first video memory area and the second video memory area according to the resolution parameters of the first display window and the second display window.
4. A video processing method according to claim 2, characterized in that Mapping the panoramic video frame to the video memory module to obtain first data to be displayed and second data to be displayed includes: The video memory module obtains the picture position information. According to the picture position information, map the corresponding picture data from the panoramic video frame to the pixel positions corresponding to the first video memory area to obtain the first data to be displayed, and map the corresponding picture data from the panoramic video frame to the pixel positions corresponding to the second video memory area to obtain the second data to be displayed.
5. A video processing method according to claim 4, wherein The video memory module obtains the picture position information, including: The hardware abstraction layer obtains the perspective adjustment operations of the user on the first display image and the second display image through the interaction interface of the application layer, generates picture position information, and the video memory module obtains the picture position information; Or, the picture position information is the intermediate area information of the preset first video frame and the second video frame.
6. A video processing method according to any one of claims 1 to 5, characterized in that In the hardware abstraction layer, processing the first video frame obtained by the first lens and the second video frame obtained by the second lens to obtain a panoramic video frame includes: In the hardware abstraction layer, anti-shake processing is performed on the first video frame and the second video frame to obtain a stable first video frame and a stable second video frame, and the stable first video frame and the stable second video frame are spliced to obtain the panoramic video frame.
7. A video processing method according to claim 6, characterized in that, The hardware abstraction layer transmits the first data of the picture to be displayed and the second data of the picture to be displayed to the application layer, including: The hardware abstraction layer transmits the first data of the picture to be displayed and the second data of the picture to be displayed to the application layer through the camera framework layer, and stores the first data of the picture to be displayed, the second data of the picture to be displayed and the corresponding timestamps in the cache queue.
8. A video processing device, characterized in that, The video processing device includes: A panoramic video frame processing module, which is used to process the first video frame obtained by the first lens and the second video frame obtained by the second lens in the hardware abstraction layer to obtain a panoramic video frame; An initialization module, which is used to initialize the video memory module in the hardware abstraction layer, and the video memory module includes a first video memory area and a second video memory area; A mapping module, which is used to map the panoramic video frame to the video memory module to obtain the first data of the picture to be displayed and the second data of the picture to be displayed, and the first video memory area processes the first data of the picture to be displayed, and the second video memory area processes the second data of the picture to be displayed; A transmission module, which is used for the hardware abstraction layer to transmit the first data of the picture to be displayed and the second data of the picture to be displayed to the application layer; A split-screen display module, which is used to render the first data of the picture to be displayed and the second data of the picture to be displayed in the application layer to obtain a first display picture and a second display picture, and display them on the display screen of the panoramic camera. The display screen includes a first display window and a second display window, and the first display window displays the first display picture, and the second display window displays the second display picture.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the video processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the video processing method according to any one of claims 1 to 7.