Panoramic video processing method, system and device, computer equipment and medium
Through video slice indexing and slice video stream processing between the client and the server, the problem of poor panoramic video transmission under low bandwidth is solved, efficient and clear panoramic video transmission is achieved, and network bandwidth requirements are reduced.
Patent Information
- Application Number
- CN202410861549.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-06
AI Technical Summary
Existing panoramic video transmission methods require large network bandwidth for real-time transmission, resulting in high cost, and it is difficult to ensure efficient transmission under low bandwidth conditions.
By determining the user's viewing area between the client and the server, obtaining and sending the corresponding video slice index, using the video slice index to obtain the slice video stream, and switching new slice video streams when the user's viewing area changes, using panoramic video The low-resolution code stream is used as the background code stream to ensure smooth transmission.
Under low-bandwidth conditions, the network bandwidth requirements for panoramic video transmission and processing are significantly reduced, the smoothness and clarity of the video are maintained, and the decoding and rendering burden on user equipment is reduced.
Smart Images

Figure CN118612477A
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a method, system, device, computer equipment and medium for processing panoramic videos. Background Art
[0002] Panoramic video is a video that uses a 3D camera to shoot 360 degrees in all directions. When watching the video, users can adjust the direction of the video at will. Since panoramic video can cover 360-degree full-scale picture content, the bit rate of complete panoramic video is generally very high. Therefore, when transmitting complete panoramic video, a large network bandwidth is generally required to ensure the smoothness of video transmission. Based on this, a large network bandwidth is currently required in the process of real-time transmission of panoramic video, which leads to the problem of high cost of traditional panoramic video transmission methods.
[0003] Therefore, how to ensure efficient transmission under low bandwidth is a technical problem that needs to be solved urgently in the current panoramic video processing technology. Summary of the invention
[0004] Based on this, it is necessary to provide a processing method, system, device, computer equipment and medium for panoramic video that can ensure efficient transmission under low bandwidth in response to the above technical problems.
[0005] In a first aspect, the present application provides a panoramic video processing method, which is applied to a client, and the method includes:
[0006] Determine a current viewing area of the user, and obtain a corresponding target video stream based on the viewing area;
[0007] Decoding and rendering the target video stream into the viewing area;
[0008] When it is detected that the user's viewing area has changed, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the process of replacing the new target video stream. The background stream is a low-resolution stream of the panoramic video.
[0009] In one embodiment, the method further comprises:
[0010] When it is detected that the display cannot normally display the target video stream, the background code stream is displayed.
[0011] In one of the embodiments, when it is detected that the display cannot normally display the target video stream, displaying the background stream includes:
[0012] When the target video stream cannot be pulled from the server in time, the background stream is displayed on the display.
[0013] In one of the embodiments, determining the current viewing area of the user and acquiring the corresponding target video stream based on the viewing area includes:
[0014] Determine a current viewing area of the user, and determine a corresponding video slice index based on the viewing area, where the video slice index is an index of a slice video in the panoramic video;
[0015] Acquire a corresponding slice video stream based on the video slice index, where the slice video stream is the target video stream;
[0016] When it is detected that the viewing area of the user has changed, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the process of replacing the new target video stream, wherein the background stream is a low-resolution stream of the panoramic video, including:
[0017] When it is detected that the user's viewing area has changed, the new video slice index corresponding to the changed viewing area is determined, and the corresponding new slice video stream is pulled based on the new video slice index, and the background code stream is displayed during the process of replacing the new slice video stream.
[0018] In one of the embodiments, obtaining a corresponding slice video stream based on the video slice index includes:
[0019] Sending the video slice index to a server, so that the server determines a slice video stream to send based on the video slice index;
[0020] Receive the sliced video stream sent by the server.
[0021] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0022] The video slice index includes: a layer number index and a slice index of the same layer. Different layers correspond to different resolutions, and the resolution of the same layer is the same.
[0023] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0024] The method further comprises:
[0025] Determine the viewing angle size corresponding to the viewing area;
[0026] Determine a corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client;
[0027] The obtaining a corresponding slice video stream based on the video slice index includes:
[0028] Receive a slice video stream sent by the server based on the video slice index and the target resolution.
[0029] In one embodiment, the server stores slice videos with different resolutions for the same slice, including:
[0030] The server determines a search range corresponding to each of the sliced videos;
[0031] The server performs motion search within each of the search ranges to obtain motion vectors corresponding to each of the search ranges;
[0032] The server encodes each of the slice videos according to the motion vector corresponding to each of the search ranges to obtain a plurality of encoded slice videos;
[0033] The server stores the multiple encoded sliced videos.
[0034] In one embodiment, the panoramic video is a fisheye image captured by a fisheye camera; the server stores slice videos of different resolutions for the same slice, including:
[0035] The server maps the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image;
[0036] The server performs image rendering on the preset expansion diagram according to different preset resolutions to obtain cube expansion diagrams corresponding to the different resolutions;
[0037] The server segments the expanded cube image according to segmentation requirements to obtain a plurality of sliced videos.
[0038] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0039] The method further comprises:
[0040] Determine the field of view angle size corresponding to the viewing area, and send the field of view angle size to the server, so that the server determines the corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client, and determines the slice video stream to be sent according to the video slice index and the target resolution.
[0041] In one of the embodiments, determining the corresponding video slice index based on the viewing area includes:
[0042] The video slice index is determined according to a position where each pixel point in the viewing area is projected onto the panoramic video.
[0043] In one of the embodiments, determining the video slice index according to the position of each pixel point in the viewing area projected on the panoramic video includes:
[0044] Determining a rendering window according to a viewing angle parameter of a current rendering picture corresponding to the viewing area;
[0045] Determine a target pixel point on the expanded cube image corresponding to the panoramic video that falls within the rendering window;
[0046] The video slice index is determined according to the target pixel point.
[0047] In one of the embodiments, determining the target pixel point on the expanded cube image corresponding to the panoramic video that falls in the rendering window includes:
[0048] Projecting each pixel point in the expanded cube image onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image; the grayscale value of the pixel point contained in the rendering window on the mask image is a first value, and the grayscale value of the pixel point contained in other areas on the mask image is a second value;
[0049] According to the mask image, a target pixel point on the expanded image of the cube that falls within the rendering window is determined.
[0050] In one embodiment, projecting each pixel point in the expanded cube image onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image includes:
[0051] Projecting each pixel point in the expanded image of the cube onto the plane where the rendering window is located to obtain each pixel point after projection;
[0052] The grayscale values of the pixels within the rendering window are set to the first value, and the grayscale values of the other pixels are set to the second value, to obtain the mask image.
[0053] In one of the embodiments, decoding and rendering the sliced video stream to the viewing area includes:
[0054] Merging the sliced video streams to obtain a merged video stream;
[0055] Decoding the merged video stream to obtain decoded frame data;
[0056] The decoded frame data is uploaded to a renderer, and the position of each pixel point in the viewing area on the decoded frame data is determined by the renderer to render the decoded frame data to the viewing area.
[0057] In a second aspect, the present application provides a method for processing panoramic video, which is applied to a server, and the method includes:
[0058] Receive a video slice index sent by a client; the video slice index is determined based on a current viewing area of a user, and the video slice index is an index of a slice video in a panoramic video;
[0059] Based on the video slice index, the corresponding slice video stream and background code stream are sent to the client, where the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream during the process of replacing the new slice video stream.
[0060] In one embodiment, the method further comprises:
[0061] Receiving the uploaded panoramic video;
[0062] The panoramic video is divided into a plurality of sliced videos, and the plurality of sliced videos are stored.
[0063] In one embodiment, the method further comprises:
[0064] Encoding each of the sliced videos to obtain a plurality of encoded sliced videos;
[0065] The storing of the plurality of sliced videos comprises:
[0066] The multiple encoded slice videos are stored in a video database.
[0067] In one embodiment, encoding each of the sliced videos to obtain a plurality of encoded sliced videos includes:
[0068] Determine the search range corresponding to each of the sliced videos;
[0069] Perform motion search within each of the search ranges to obtain motion vectors corresponding to each of the search ranges;
[0070] Each of the sliced videos is encoded according to the motion vector corresponding to each of the search ranges to obtain the multiple encoded sliced videos.
[0071] In one embodiment, determining the search range corresponding to each of the sliced videos includes:
[0072] For each of the sliced videos, a search range corresponding to each of the coding blocks is determined according to the size of the sliced video and the position of the coding block in the sliced video.
[0073] In one of the embodiments, dividing the panoramic video into a plurality of sliced videos includes:
[0074] Generate a corresponding cube expansion diagram according to the panoramic video;
[0075] The cube expansion diagram is segmented according to segmentation requirements to obtain the multiple slice videos.
[0076] In one embodiment, the panoramic video is a fisheye image captured by a fisheye camera; and the step of generating a corresponding expanded cube image according to the panoramic video includes:
[0077] According to the mapping relationship between the fisheye image and the expanded image, mapping the fisheye image onto a preset expanded image;
[0078] According to different preset resolutions, image rendering is performed on the preset expansion diagram to obtain cube expansion diagrams corresponding to the different resolutions.
[0079] In one embodiment, the rendering of the preset expansion diagram according to different preset resolutions to obtain the cube expansion diagram corresponding to the different resolutions includes:
[0080] According to the maximum resolution among the preset different resolutions, the preset expansion image is rendered to obtain a cube expansion image corresponding to the maximum resolution;
[0081] According to other resolutions among the different resolutions, downsampling processing is performed on the expanded image corresponding to the maximum resolution to obtain the expanded images of the cube corresponding to the other resolutions.
[0082] In one embodiment, the method further comprises:
[0083] Dividing the texture features in the expanded image into a first texture region and a second texture region; the contrast degree of the texture features in the first texture region is higher than the contrast degree of the texture features in the second texture region;
[0084] Adjust the range of the first texture area and the second texture area in the expanded image to obtain a new expanded image;
[0085] Constructing a mapping relationship between the new unfolded image and the fisheye image;
[0086] Mapping the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image includes:
[0087] According to the mapping relationship between the new expanded image and the fisheye image, the fisheye image is mapped onto the preset expanded image.
[0088] In one embodiment, adjusting the range of the first texture area and the second texture area in the expanded image to obtain a new expanded image includes:
[0089] The range of the first texture area is expanded, and the range of the second texture area is reduced to obtain the new expanded image; the first range in the new expanded image is equal to the second range in the expanded image; the first range is the sum of the range of the first texture area and the range of the second texture area in the new expanded image, and the second range is the sum of the range of the first texture area and the range of the second texture area in the expanded image.
[0090] In a third aspect, the present application provides a panoramic video processing system, the system comprising: a camera end, a client end, and a server end;
[0091] The camera end is used to send the captured panoramic video to the server end;
[0092] The server is used to divide the panoramic video into multiple slice videos, store the multiple slice videos, and generate a video slice index corresponding to each slice video;
[0093] The server is further configured to generate a low-resolution code stream of the panoramic video based on the panoramic video as a background code stream;
[0094] The client is used to determine the current viewing area of the user, determine the corresponding video slice index based on the viewing area, and send the video slice index to the server;
[0095] The server is also used to send the corresponding slice video stream and background code stream to the client based on the video slice index, so that the client can display the background code stream during the process of replacing the new slice video stream.
[0096] In a fourth aspect, the present application further provides a panoramic video processing device, which is applied to a client, and the device includes:
[0097] A first determination module is used to determine a current viewing area of a user, and determine a corresponding video slice index based on the viewing area, wherein the video slice index is an index of a slice video in a panoramic video;
[0098] An acquisition module, used for acquiring a corresponding slice video stream based on the video slice index;
[0099] A decoding and rendering module, used for decoding and rendering the sliced video stream to the viewing area;
[0100] The second determination module is used to determine the new video slice index corresponding to the changed viewing area when it is detected that the user's viewing area has changed, and pull the corresponding new slice video stream based on the new video slice index, and display the background code stream during the process of replacing the new slice video stream. The background code stream is a low-resolution code stream of the panoramic video.
[0101] In a fifth aspect, the present application further provides a panoramic video processing device, which is applied to a server, and the device includes:
[0102] A receiving module, configured to receive a video slice index sent by a client; the video slice index is determined based on a current viewing area of a user, and the video slice index is an index of a slice video in a panoramic video;
[0103] A sending module is used to send the corresponding slice video stream and background code stream to the client based on the video slice index, and the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream during the process of replacing the new slice video stream.
[0104] In a sixth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0105] In a seventh aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0106] In an eighth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0107] The above-mentioned panoramic video processing method, system, device, computer equipment and medium determine the user's current viewing area, obtain the corresponding target video stream based on the viewing area; decode and render the target video stream to the viewing area; when it is detected that the user's viewing area has changed, determine the new target video stream corresponding to the changed viewing area, and display the background stream in the process of replacing the new target video stream. The background stream is a low-resolution stream of the panoramic video. Since users usually only watch the content of a part of the area when watching a panoramic video, the present application can process only the target video stream corresponding to the viewing area without transmitting and processing the entire panoramic video, which can greatly reduce the network bandwidth during the transmission and processing of the panoramic video, and will not affect the effect of the user watching the sliced video, thereby ensuring the smooth and efficient transmission and clarity of the panoramic video under low bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0109] Figure 1 A diagram of an application environment of a panoramic video processing method in one embodiment;
[0110] Figure 2 is a flow chart of a method for processing panoramic video applied to a client in one embodiment;
[0111] Figure 3 A schematic flow chart of a method for processing a panoramic video including a step of obtaining a target video stream in one embodiment;
[0112] Figure 4 is a flowchart of a method for processing panoramic video in another embodiment;
[0113] Figure 5 is a flowchart of a method for processing panoramic video in yet another embodiment;
[0114] Figure 6 is a flow chart of a method for processing panoramic video applied to a server in one embodiment;
[0115] Figure 7 A schematic flow chart of a method for processing a panoramic video including a step of segmenting the panoramic video in one embodiment;
[0116] Figure 8is a flowchart of a method for processing a panoramic video including an encoding step in one embodiment;
[0117] Fig. 9 A schematic diagram of a flow chart of an encoding step in an embodiment;
[0118] Fig.10 A schematic diagram of a flow chart of a step of segmenting a panoramic video in one embodiment;
[0119] Fig.11 A schematic diagram of a flow chart of steps for generating a cube expansion diagram in one embodiment;
[0120] Fig.12 A schematic flow chart of the steps of generating a cube expansion diagram in another embodiment;
[0121] Fig.13 is a structural block diagram of a panoramic video processing device in one embodiment;
[0122] Fig.14 is a structural block diagram of a panoramic video processing device in another embodiment;
[0123] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0124] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0125] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0126] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0127] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0128] Panoramic video is a video that uses a 3D camera to shoot 360 degrees in all directions. When watching the video, users can adjust the direction of the video at will. Since panoramic video can cover 360-degree full-scale picture content, the bit rate of complete panoramic video is generally very high. Therefore, when transmitting complete panoramic video, a large network bandwidth is generally required to ensure the smoothness of video transmission. Based on this, a large network bandwidth is currently required in the process of real-time transmission of panoramic video, which leads to the problem of high cost of traditional panoramic video transmission methods.
[0129] Therefore, how to ensure smooth, efficient transmission and clarity of panoramic videos under low bandwidth is a technical problem that needs to be solved urgently in the current panoramic video processing technology.
[0130] After introducing the background technology of the panoramic video processing method provided by the embodiment of the present application, the implementation environment involved in the panoramic video processing method provided by the embodiment of the present application will be briefly described below. The panoramic video processing method provided by the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the client 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the client 102 can be a terminal. For example, the client 102 can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0131] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0132] In one embodiment, Figure 2 As shown, a method for processing panoramic video is provided, and the method is applied to Figure 1 The following steps are used as an example to illustrate the client:
[0133] S111, determining the current viewing area of the user, and acquiring a corresponding target video stream based on the viewing area.
[0134] In the embodiment of the present application, since the longitude range of the panoramic video is 0 to 360 degrees, the latitude range of the panoramic video is 0 to 360 degrees, and the user usually only watches the content of a part of the area when watching the panoramic video, generally, the longitude range of the user's viewing area is less than 180 degrees, and the latitude range is less than 180. Therefore, the embodiment of the present application does not need to transmit and decode the picture for the area that the user has not watched. Based on this, the client can determine the position of the user's current viewing area in the panoramic video, and based on the viewing area, obtain the target video stream corresponding to the viewing area from the panoramic video. Among them, the target video stream refers to the video corresponding to the area that needs to be transmitted and decoded.
[0135] Optionally, the step of determining the target video stream may include but is not limited to the following two implementation methods: first, assuming that the panoramic video is not divided into multiple slice videos, the client can directly obtain the target video stream corresponding to the viewing area from the panoramic video based on the viewing area; second, assuming that the panoramic video is pre-divided into multiple slice videos, the client can determine the video slice index corresponding to the viewing area from the indexes of multiple slice videos in the panoramic video based on the viewing area, and determine the slice video corresponding to the video slice index as the target video stream corresponding to the viewing area.
[0136] S112, decoding and rendering the target video stream into the viewing area.
[0137] In an embodiment of the present application, the client can decode the target video stream and render the decoded target video stream to the user's current viewing area. That is, the embodiment of the present application only needs to decode and render the target video stream, and there is no need to decode and render the entire panoramic video. Therefore, the network bandwidth during the panoramic video processing can be greatly reduced.
[0138] S113, when it is detected that the viewing area of the user has changed, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the process of replacing the new target video stream, where the background stream is a low-resolution stream of the panoramic video.
[0139] In an embodiment of the present application, the client can monitor the user's current viewing area in real time, and when it detects that the user's viewing area has changed, it can determine the changed viewing area, and then determine the new target video stream corresponding to the changed viewing area based on the changed viewing area. After that, the client can pull the new target video stream. In addition, since there are always two streams for the client, one of which is a sliced video stream and the other is a background stream, the client can also display the background stream on the client's display interface during the process of replacing the new target video stream, and immediately display the new target video stream on the client's display interface after the client pulls the new target video stream. Among them, the background stream is a low-resolution stream of the panoramic video.
[0140] In the above-mentioned panoramic video processing method, the user's current viewing area is determined, and the corresponding target video stream is obtained based on the viewing area; the target video stream is decoded and rendered to the viewing area; when a change in the user's viewing area is detected, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the replacement of the new target video stream. The background stream is a low-resolution stream of the panoramic video. Since users usually only watch the content of a part of the area when watching a panoramic video, the present application can process only the target video stream corresponding to the viewing area without transmitting and processing the entire panoramic video, which can greatly reduce the network bandwidth during the transmission and processing of the panoramic video and will not affect the effect of the user watching the sliced video. Thus, the smooth and efficient transmission and clarity of the panoramic video can be guaranteed under low bandwidth.
[0141] In one embodiment, a method for displaying a background code stream is provided, and the panoramic video processing method further includes:
[0142] When it is detected that the display cannot display the target video stream normally, the background stream is displayed.
[0143] In the embodiment of the present application, since there are always two code streams for the client, one of which is a sliced video stream and the other is a background code stream, the client can detect in real time or periodically whether the display can normally display the target video stream during the process of replacing the new target video stream. If the client detects that the display can normally display the target video stream, the client can display the target video stream on the display interface of the client; if the client detects that the display cannot normally display the target video stream, the client can display the background code stream on the display interface of the client. Exemplarily, the situation where the display cannot normally display the target video stream may include but is not limited to: the target video stream cannot be pulled from the server in time, or the target video stream cannot be decoded and rendered to the viewing area in time, etc.
[0144] In this embodiment, when it is detected that the display cannot normally display the target video stream, the background code stream can be displayed, which can improve the effect of the user watching the panoramic video.
[0145] In one embodiment, a method for displaying a background code stream is provided, that is, when the client executes the above-mentioned "when it is detected that the display cannot normally display the target video stream, display the background code stream", it includes:
[0146] When the target video stream cannot be pulled from the server in time, the background stream is displayed on the monitor.
[0147] In the embodiment of the present application, the client can detect in real time or periodically whether the target video stream can be pulled from the server in time during the process of replacing the new target video stream. If the client detects that the display can pull the target video stream from the server in time, the client can display the target video stream on the client's display interface; if the client detects that the target video stream cannot be pulled from the server in time, the client can display the background code stream on the client's display interface.
[0148] In this embodiment, when the target video stream cannot be pulled from the server in time, the background stream is displayed on the display, which can improve the effect of the user watching the panoramic video.
[0149] In one embodiment, Figure 3 As shown, a method for implementing obtaining a target video stream corresponding to a viewing area is provided, that is, when the client executes the above-mentioned S111 of "determining the current viewing area of the user, and obtaining the corresponding target video stream based on the viewing area", it includes:
[0150] S201, determining a current viewing area of a user, and determining a corresponding video slice index based on the viewing area, where the video slice index is an index of a slice video in a panoramic video.
[0151] In an embodiment of the present application, the client can determine the position of the user's current viewing area in the panoramic video, and based on the viewing area, determine the video slice index corresponding to the viewing area from the indexes of multiple slice videos in the panoramic video.
[0152] Optionally, the step of determining the video slice index corresponding to the viewing area may include but is not limited to the following two implementations: first, when an index corresponds to multiple different resolutions, the client may first determine the index of at least one video slice corresponding to the viewing area based on the position of the user's current viewing area in the panoramic video, and then obtain the multiple resolutions corresponding to the index of the at least one video slice, and select the target resolution set in the preset clarity requirement from the multiple resolutions according to the preset clarity requirement, thereby, the index of the index of the at least one video slice with a resolution of the target resolution can be determined as the video slice index; second, when an index corresponds to only one resolution, the client may first determine the index of at least one video slice corresponding to the viewing area based on the position of the user's current viewing area in the panoramic video, and then directly determine the index of the at least one video slice as the video slice index.
[0153] S202, obtaining a corresponding slice video stream based on the video slice index, where the slice video stream is the target video stream.
[0154] In an embodiment of the present application, optionally, the implementation methods of the client obtaining the corresponding slice video stream based on the video slice index may include but are not limited to the following two methods: first, if the panoramic video and multiple slice videos in the panoramic video have been stored locally on the client in advance, the client can directly read the slice video stream corresponding to the video slice index from the local disk; second, if the panoramic video and multiple slice videos in the panoramic video have been stored in the server in advance, the client can send the video slice index to the server, so that the server determines the slice video stream corresponding to the video slice index based on the video slice index, and sends the slice video stream corresponding to the video slice index to the client, so that the client can receive the slice video stream corresponding to the video slice index.
[0155] S112 includes:
[0156] S203, decoding and rendering the sliced video stream to the viewing area;
[0157] In the embodiment of the present application, since the sliced video stream is the target video stream, the client can decode the sliced video stream and render the decoded sliced video stream to the user's current viewing area. That is, the embodiment of the present application only needs to decode and render the sliced video corresponding to the video slice index, and there is no need to decode and render the entire panoramic video. Therefore, the network bandwidth during the panoramic video processing can be greatly reduced.
[0158] S113 includes:
[0159] S204, when it is detected that the viewing area of the user has changed, a new video slice index corresponding to the changed viewing area is determined, and a corresponding new slice video stream is pulled based on the new video slice index, and the background code stream is displayed during the process of replacing the new slice video stream.
[0160] In an embodiment of the present application, the client can monitor the user's current viewing area in real time, and when detecting that the user's viewing area has changed, determine the changed viewing area, and then determine the new video slice index corresponding to the changed viewing area based on the changed viewing area. Afterwards, the client can pull the corresponding new slice video stream based on the new video slice index. Among them, the steps of determining the new video slice index and obtaining the new slice video stream can refer to the above S201 and S202, which will not be repeated here.
[0161] In addition, since there are always two streams for the client, one of which is the slice video stream and the other is the background stream, the client can also display the background stream on the client's display interface during the process of replacing the new slice video stream, and immediately display the slice video stream on the client's display interface after the client pulls the new slice video stream. Among them, the background stream is a low-resolution stream of the panoramic video.
[0162] In this embodiment, since users usually only watch the content of a partial area when watching a panoramic video, the present application can only process the sliced video stream corresponding to the viewing area without transmitting and processing the entire panoramic video. This can greatly reduce the network bandwidth during the transmission and processing of the panoramic video and will not affect the effect of the user watching the sliced video. Therefore, it can ensure smooth and efficient transmission and clarity of the panoramic video under low bandwidth.
[0163] In one embodiment, a method for obtaining a video slice index corresponding to a viewing area is provided, that is, when the client executes the "obtaining a corresponding slice video stream based on the video slice index" in S202, it includes:
[0164] S211, sending the video slice index to the server, so that the server determines the slice video stream to be sent based on the video slice index.
[0165] S212, receiving the sliced video stream sent by the server.
[0166] In an embodiment of the present application, the client can send the determined video slice index corresponding to the viewing area to the server, so that the server can determine the slice video stream based on the received video slice index and send the slice video stream to the client. The video slice index is the index of the slice video in the panoramic video, the slice video stream refers to the slice video corresponding to the video slice index, and the slice video refers to the video containing the partial picture of the panoramic video. Afterwards, the client can receive the slice video stream sent by the server, that is, the embodiment of the present application only needs to transmit the slice video corresponding to the video slice index, and there is no need to transmit the entire panoramic video. Therefore, the network bandwidth during the panoramic video transmission process can be greatly reduced.
[0167] In this embodiment, the video slice index is sent to the server so that the server determines the slice video stream to be sent based on the video slice index; and the slice video stream sent by the server is received. If the server has pre-stored the slice videos in the panoramic video, the slice video stream corresponding to the video slice index can be obtained from the server based on the video slice index, so that only the slice video stream corresponding to the viewing area can be transmitted and processed without transmitting and processing the entire panoramic video, which can greatly reduce the network bandwidth during the panoramic video transmission process and will not affect the effect of users watching the slice video, so that the smooth and efficient transmission and clarity of the panoramic video can be guaranteed under low bandwidth.
[0168] In one embodiment, the server stores slice videos with different resolutions for the same slice;
[0169] The video slice index includes: layer number index and slice index of the same layer. Different layers correspond to different resolutions, while the same layer has the same resolution.
[0170] Among them, the layer index refers to the index of each layer contained in the video slice, and the slice index of the same layer refers to the index of each video slice contained in the same layer. It should be noted that the number of layers is divided based on the resolution, that is, it can be understood that different layers correspond to different resolutions, and the resolution of the same layer is the same.
[0171] In this embodiment, by setting different resolutions for different layers of the sliced video, the most suitable resolution can be selected from different resolutions according to the preset clarity requirements, so that only the sliced video corresponding to the most suitable resolution can be transmitted and processed, thereby ensuring the clarity of the transmitted and processed sliced video stream.
[0172] In one embodiment, the server stores slice videos with different resolutions for the same slice, such as Figure 4 As shown, the above panoramic video processing method also includes:
[0173] S205: Determine the viewing angle size corresponding to the viewing area.
[0174] S206: Determine a corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client.
[0175] S202 includes:
[0176] S207, receiving a slice video stream sent by the server based on the video slice index and the target resolution.
[0177] In an embodiment of the present application, the client can predetermine the current network bandwidth of the client, and after determining the current viewing area of the user, determine the field of view (FOV) corresponding to the viewing area, and then determine the target resolution corresponding to the viewing area based on the field of view and / or the current network bandwidth of the client. After that, the client can send the target resolution corresponding to the viewing area to the server. The client can send the video slice index to the server, so that the server can determine the slice video stream corresponding to the viewing area based on the video slice index and the target resolution, and send the slice video stream corresponding to the viewing area to the client. Then, the client can receive the slice video stream sent by the server based on the video slice index and the target resolution. Among them, the target resolution refers to the resolution suitable for the user to watch the slice video corresponding to the current viewing area.
[0178] In this embodiment, the client can determine the corresponding target resolution based on the determined field of view angle size and / or the client's current network bandwidth, and transmit the corresponding target resolution to the server, so that the server can accurately determine the slice video stream that meets the target resolution requirements and corresponds to the viewing area based on the video slice index and the target resolution, so that the client can receive the accurate slice video stream.
[0179] In one embodiment, the server stores slice videos with different resolutions for the same slice, including:
[0180] The server determines the search range corresponding to each slice video.
[0181] In the embodiment of the present application, the server determines the search range corresponding to each slice video. Optionally, the server can determine the search range corresponding to each coding block for each slice video according to the size of the slice video and the position of the coding block in the slice video; or, the server can also determine the search range corresponding to the current coding block according to the coordinates of the current coding block, the width of the current coding block and the height of the current coding block, combined with the consideration of the image edge error that may be caused by sub-pixel interpolation. Wherein, the search range refers to the search range corresponding to each coding block in the slice video. It should be noted that the purpose of setting the search range in the embodiment of the present application is to ensure that the searched reference block is located in the same slice video, and cannot cross other slice videos or use pixels of other slice videos to ensure the relative independence between the slice videos, so as to ensure that no error code error will be generated when the slice videos are subsequently spliced. Of course, the embodiment of the present application does not limit the specific method for determining the search range. In addition to the above-mentioned method for determining the search range, it is exemplary that the search range corresponding to the current coding block can also be determined according to the coordinates of the current coding block, the width of the current coding block and the height of the current coding block, combined with the consideration of the image edge error that may be caused by sub-pixel interpolation.
[0182] The server performs motion search in each search range to obtain a motion vector corresponding to each search range.
[0183] In the embodiment of the present application, the server can perform motion search in the search range corresponding to each coding block through each coding block to obtain the motion vector (MV) corresponding to each search range. It should be noted that the current coding block can only be searched within the search range where the coding block is located during motion search, and if the search result involves sub-pixels, since sub-pixels are calculated from whole pixels, it is also necessary to ensure that the pixels for calculating these sub-pixels are also within the search range, so as to ensure the relative independence between the sliced videos.
[0184] The server encodes each slice video according to the motion vector corresponding to each search range to obtain a plurality of encoded slice videos.
[0185] In an embodiment of the present application, for each slice video, the server can calculate the pixel residual according to the motion vector corresponding to each search range, perform DCT (Discrete Cosine Transform) and quantize the pixel residual, and then entropy encode the slice video after the above processing to obtain multiple encoded slice videos.
[0186] The server stores multiple encoded sliced videos.
[0187] In the embodiment of the present application, the server can store multiple encoded sliced videos in a video database, and set a corresponding index for each sliced video. It should be noted that the sliced videos and the indexes are in a one-to-one correspondence.
[0188] In this embodiment, in order to ensure that multiple sliced video streams can be merged into one video stream, it is necessary to set the search range corresponding to each coding block on the server side when encoding each sliced video, limit the search range of inter-frame prediction coding, thereby ensuring the relative independence between the sliced videos, ensuring that the motion vector determined in each sliced video cannot exceed the range of the current sliced video, thereby ensuring that no bit errors will occur when the sliced videos are subsequently spliced, and ensuring that the multiple sliced video streams can still be decoded normally after being merged.
[0189] In one embodiment, the panoramic video is a fisheye image captured by a fisheye camera; the server stores slice videos of different resolutions for the same slice, including:
[0190] The server maps the fisheye image onto the preset expanded image according to the mapping relationship between the fisheye image and the expanded image.
[0191] In the embodiment of the present application, for each pixel in the expanded image, the server can first project each pixel in the expanded image onto the unit sphere according to the cube projection relationship, obtain the three-dimensional point corresponding to each pixel in the expanded image on the unit sphere, and then project the three-dimensional point corresponding to each pixel onto the fisheye image according to the fisheye calibration information to obtain the corresponding point on the fisheye image corresponding to each pixel. In this way, the mapping relationship between the fisheye image and the expanded image can be obtained. In addition, the seamless splicing algorithm can be used to adjust the mapping relationship obtained above to align the images at the seams, eliminate ghosting and fault phenomena, and ensure that the expanded image of the cube has a seamless splicing effect. Among them, the mapping relationship between the fisheye image and the expanded image can be in the form of a graph or a table. Of course, the embodiment of the present application does not limit the specific form of the mapping relationship between the fisheye image and the expanded image. Afterwards, the server can map the fisheye image taken by the fisheye camera to the preset expanded image according to the mapping relationship between the fisheye image and the expanded image. Among them, the preset expanded image refers to a cube expanded image that only includes each position information but not color information.
[0192] The server performs image rendering on the preset expansion diagram according to the preset different resolutions to obtain the cube expansion diagrams corresponding to the different resolutions.
[0193] In the embodiment of the present application, the server can perform image rendering on the preset expansion diagram according to different preset resolutions to obtain cube expansion diagrams corresponding to different resolutions. Optionally, the server can use different preset resolutions to perform different image renderings on the preset expansion diagram to obtain cube expansion diagrams corresponding to different resolutions; or, the server can first use the maximum resolution among the preset different resolutions to perform image rendering on the preset expansion diagram to generate a cube expansion diagram corresponding to the maximum resolution, and then downsample the cube expansion diagram corresponding to the maximum resolution according to the preset different resolutions, so as to obtain cube expansion diagrams corresponding to different resolutions. Of course, the embodiment of the present application does not limit the specific implementation method of generating the cube expansion diagram. Among them, for the splicing area, image fusion operation needs to be performed during the image rendering process, and the embodiment of the present application does not limit the specific implementation method of image fusion.
[0194] It should be noted that the present application can also implement the extension process of the cube face. Specifically, each expanded cube face corresponding to the expanded cube diagram will have a portion of the screen around it that is larger than the actual cube face, and the screen content of these extra parts is the same as the edge screen content of the adjacent cube face. When rendering the edge pixels of the cube face, the sampling can be completed within the same cube face based on the above-mentioned extended screen content, without the need for cross-cube sampling (i.e., sampling from multiple cube faces), so as to facilitate rendering sampling of edge pixels.
[0195] The server segments the expanded cube image according to segmentation requirements to obtain multiple slice videos.
[0196] In an embodiment of the present application, the server can segment the expanded cube diagram according to the segmentation requirements to obtain multiple sliced videos. The segmentation requirements may include a preset segmentation size, a preset segmentation shape, etc. Of course, the embodiment of the present application does not limit the segmentation requirements. For example, assuming that the segmentation requirements require the above-mentioned slices to be rectangular slices with a width of W and a height of H, and the size of the overlapping area between adjacent slices is required to be O, then the coordinates of the upper left vertex of the sliced video in the yth row and xth column after segmentation in the expanded cube diagram are (x*(WO), y*(HO)).
[0197] In this embodiment, the server can map the fisheye image to the preset expansion image according to the mapping relationship between the fisheye image and the expansion image, and the server can render the preset expansion image according to different preset resolutions to obtain cubic expansion images corresponding to different resolutions. In this way, the server can comprehensively consider the processing cost, bandwidth and image quality experience of the panoramic video, and determine the most suitable resolution corresponding to each layer, so as to generate cubic expansion images corresponding to different resolutions based on the most suitable resolution corresponding to each layer. Afterwards, the server can segment the cubic expansion images corresponding to different resolutions according to the segmentation requirements to obtain multiple sliced videos with more uniform pixel density.
[0198] In one embodiment, the server stores slice videos with different resolutions for the same slice, such as Figure 5 As shown, the above panoramic video processing method also includes:
[0199] S208, determine the field of view angle size corresponding to the viewing area, and send the field of view angle size to the server, so that the server determines the corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client, and determines the slice video stream to be sent according to the video slice index and the target resolution.
[0200] In an embodiment of the present application, after determining the current viewing area of the user, the client can determine the field of view angle size corresponding to the viewing area and send the field of view angle size to the server. In addition, the client can also predetermine the current network bandwidth of the client and send the current network bandwidth of the client to the server. The client can send the video slice index to the server, so that the server can determine the target resolution corresponding to the viewing area based on the received field of view angle size and / or the current network bandwidth of the client, and then determine the slice video stream corresponding to the viewing area based on the video slice index and the target resolution, and send the slice video stream corresponding to the viewing area to the client. Then, the client can receive the slice video stream sent by the server based on the video slice index and the target resolution.
[0201] In this embodiment, by transmitting the field of view angle size corresponding to the viewing area and / or the current network bandwidth of the client to the server, the server can accurately determine the target resolution based on the field of view angle size and / or the current network bandwidth of the client, so that the server can accurately determine the slice video stream that meets the target resolution requirement and corresponds to the viewing area based on the video slice index and the target resolution.
[0202] In one embodiment, a method for determining a video slice index corresponding to a viewing area is provided, that is, when the client executes the “determining a corresponding video slice index based on the viewing area” in S201 above, the specific steps are as follows:
[0203] Determine the video slice index according to the position where each pixel point in the viewing area is projected onto the panoramic video.
[0204] In the embodiment of the present application, the client can calculate the position where each pixel point in the viewing area is projected onto the panoramic video according to the user's current viewing area, so that the number of slice videos required and the video slice index can be determined according to the position where each pixel point in the viewing area is projected onto the panoramic video. Among them, assuming that the number of slice videos is K and the total number of slice videos corresponding to the panoramic video is N, then K < N / 2. In this way, only the hardware decoding ability of K / N of the original panoramic video and the transmission bandwidth of K / N are required to transmit and process the 8K panoramic video, which can not only reduce the requirements for the user's bandwidth when viewing the 8K panoramic video, but also reduce the requirements for the user's machine performance when viewing the 8K panoramic video, that is, it can reduce the requirements for the decoding ability of the user's machine, and since the decoding resolution is reduced, the power consumption can be correspondingly reduced.
[0205] In this embodiment, by determining the video slice index according to the position where each pixel point in the viewing area is projected onto the panoramic video, the slice video stream corresponding to the video slice index can be accurately determined for transmission and processing, which can not only reduce the requirements for the user's bandwidth when viewing the 8K panoramic video, but also reduce the requirements for the decoding ability of the user's machine.
[0206] In one of the embodiments, determining the video slice index according to the position where each pixel point in the viewing area is projected onto the panoramic video includes:
[0207] Determine the rendering window according to the viewing angle parameters of the current rendered image corresponding to the viewing area.
[0208] Determine the target pixel points on the cube unfolding diagram corresponding to the panoramic video that fall within the rendering window.
[0209] Determine the video slice index according to the target pixel points.
[0210] In the embodiment of the present application, the client can pre-acquire the viewing angle parameters of the current rendered image corresponding to the viewing area and convert the panoramic video into a cube unfolding diagram. Then, the client can determine the rendering window according to the viewing angle parameters of the current rendered image corresponding to the viewing area, so that according to the projection conversion relationship between the current rendered image and the cube unfolding diagram, the area where the current rendered image is located can be located in the cube unfolding diagram, that is, all the pixel points in this area can be determined as the target pixel points on the cube unfolding diagram corresponding to the panoramic video that fall within the rendering window. Then, the client can count the indexes of the slice videos corresponding to the target pixel points and determine the indexes of the slice videos corresponding to the target pixel points as the video slice index.
[0211] In this embodiment, by accurately determining the rendering window according to the viewing angle parameters of the current rendering picture corresponding to the viewing area, the target pixel point falling in the rendering window on the expanded cube image corresponding to the panoramic video can be accurately determined, and then the index of the sliced video corresponding to the target pixel point can be determined as the video slice index, that is, the video slice index can be accurately determined.
[0212] In one embodiment, determining a target pixel point on a cube expansion image corresponding to a panoramic video that falls within a rendering window includes:
[0213] Each pixel point in the expanded cube image is projected onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image; the grayscale value of the pixel points contained in the rendering window on the mask image is a first value, and the grayscale value of the pixel points contained in other areas on the mask image is a second value.
[0214] According to the mask image, the target pixel point on the expanded cube image that falls in the rendering window is determined.
[0215] In an embodiment of the present application, the client can project each pixel point in the expanded cube map corresponding to the panoramic video to the plane where the rendering window is located to obtain a mask map corresponding to the expanded cube map. Among them, the grayscale value of the pixel points contained in the rendering window on the mask map is a first value, and the grayscale value of the pixel points contained in other areas on the mask map is a second value. For example, the first value can be 255, and the second value can be 0. Thus, the client can count each pixel point with a grayscale value of the first value according to the mask map corresponding to the expanded cube map, and determine each pixel point with a grayscale value of the first value as a target pixel point on the expanded cube map that falls in the rendering window.
[0216] In this embodiment, by constructing a mask image, the target pixel points on the expanded cube image corresponding to the panoramic video that fall in the rendering window corresponding to the viewing area can be accurately determined, so that the video slice index can be accurately determined based on the accurate target pixel points.
[0217] In one embodiment, each pixel point in the expanded cube image is projected onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image, including:
[0218] Project each pixel point in the expanded image of the cube onto the plane where the rendering window is located to obtain each pixel point after projection.
[0219] The grayscale values of pixels within the rendering window are set to a first value, and the grayscale values of other pixels are set to a second value, to obtain a mask image.
[0220] Exemplarily, for each pixel point in the expanded cube map, the client can project each pixel point in the expanded cube map to the plane where the rendering window is located according to the projection relationship between the expanded cube map and the rendering window, and obtain each pixel point after projection. Afterwards, the client can determine whether each pixel point after projection is within the range of the rendering window. If each pixel point after projection is within the range of the rendering window, the client can set the grayscale value of the pixel point within the rendering window to the first value; if each pixel point after projection is not within the range of the rendering window, the client can set the grayscale value of other pixel points that are not within the range of the rendering window to the second value, thereby obtaining a mask map.
[0221] In this embodiment, each pixel point in the expanded cube image is projected onto the plane where the rendering window is located to obtain the projected pixel points, and the grayscale value of the pixel points located in the rendering window is set to a first value, and the grayscale value of other pixel points is set to a second value. That is, based on whether each pixel point is projected into the rendering window, a mask image can be accurately constructed, and the target pixel point on the expanded cube image corresponding to the panoramic video that falls in the rendering window corresponding to the viewing area can be accurately determined, so that the video slice index can be accurately determined based on the accurate target pixel point.
[0222] In one embodiment, a method for implementing decoding and rendering of sliced videos is provided, that is, when the client executes the "decoding and rendering the sliced video stream to the viewing area" in the above S203, it specifically includes:
[0223] The sliced video streams are merged to obtain a merged video stream.
[0224] The merged video stream is decoded to obtain decoded frame data.
[0225] The decoded frame data is uploaded to the renderer, and the position of each pixel point in the viewing area on the decoded frame data is determined by the renderer to render the decoded frame data into the viewing area.
[0226] In the related art, when the client decodes multiple slice video streams, it is necessary to call multiple decoders to decode the multiple slice video streams respectively, which affects the client performance, and when the number of slice streams is large, the client does not have enough decoders to decode. Based on this, in an embodiment of the present application, the client can first merge the slice video streams corresponding to the video slice index to obtain a merged video stream, and then decode the merged video stream to obtain decoded frame data. Afterwards, the client can upload the decoded frame data to the renderer, and the renderer calculates the position of each pixel point in the current viewing area on the decoded frame data according to the current viewing area, so as to render the decoded frame data to the viewing area. Exemplarily, the client can project each pixel point in the rendering window corresponding to the viewing area into the corresponding cube expansion map slice according to the projection relationship between the rendering window and the cube expansion map slice, and then perform pixel sampling and image rendering on each pixel point in the rendering window corresponding to the viewing area from the slice.
[0227] In this embodiment, the sliced video streams are first merged and then decoded and rendered, that is, one decoder can be used to decode the merged video stream. As a result, the client will not encounter a situation where there are not enough decoders for decoding due to too many sliced video streams pulled, and the decoding power consumption of the client can be reduced.
[0228] In one embodiment, Figure 6 As shown, a method for processing panoramic video is provided, and the method is applied to Figure 1 The server corresponding to the server in is used as an example to illustrate, including the following steps:
[0229] S301, receiving a video slice index sent by a client; the video slice index is determined based on the user's current viewing area, and the video slice index is an index of a slice video in a panoramic video.
[0230] In the embodiment of the present application, since the client can send the video slice index corresponding to the determined viewing area to the server, the server corresponding to the server can receive the video slice index sent by the client. The video slice index is determined by the client from the indexes of multiple slice videos in the panoramic video based on the user's current viewing area, and the video slice index is the index of the slice video in the panoramic video. The specific steps for the client to determine the video slice index can refer to the above embodiment, which will not be repeated here.
[0231] S302, sending the corresponding slice video stream and background code stream to the client based on the video slice index, where the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream when changing to a new slice video stream.
[0232] In the embodiment of the present application, the server can determine the slice video stream corresponding to the video slice index from multiple slice videos in the panoramic video based on the received video slice index, and the server can pre-set the background code stream, so that the server can send the slice video stream and background code stream corresponding to the video slice index to the client, so that the client can display the background code stream in the process of replacing the new slice video stream. The background code stream is a low-resolution code stream of the panoramic video.
[0233] In the above-mentioned panoramic video processing method, a video slice index sent by the client is received; the video slice index is determined based on the user's current viewing area, and the video slice index is the index of the slice video in the panoramic video; based on the video slice index, the corresponding slice video stream and background code stream are sent to the client, and the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream in the process of replacing the new slice video stream. Since users usually only watch the content of a part of the area when watching a panoramic video, the present application can only transmit and process the slice video stream corresponding to the viewing area without transmitting and processing the entire panoramic video, which can greatly reduce the network bandwidth during the panoramic video transmission process and will not affect the effect of the user watching the slice video, thereby ensuring the smooth and efficient transmission and clarity of the panoramic video under low bandwidth. It has been verified that when the panoramic video processing method of the present application is used for real-time transmission and processing of panoramic videos, the transmission bandwidth can be reduced to 20% to 25% of the original transmission bandwidth while ensuring sufficient clarity of the panoramic video.
[0234] In one embodiment, Figure 7 As shown, the above panoramic video processing method also includes:
[0235] S303, receiving the uploaded panoramic video.
[0236] In the embodiment of the present application, optionally, the camera can pre-shoot a panoramic video and send the captured panoramic video to the server, so that the server can obtain the panoramic video captured by the client. Alternatively, the camera can pre-shoot a panoramic video and store the captured panoramic video in the cloud, so that the server can receive the uploaded panoramic video from the cloud. Of course, the embodiment of the present application does not limit the specific implementation method for obtaining the panoramic video.
[0237] S304, dividing the panoramic video into a plurality of sliced videos, and storing the plurality of sliced videos.
[0238] In an embodiment of the present application, optionally, the server may divide a direct panoramic video into multiple sliced videos; or, the server may first perform format conversion processing on the panoramic video to obtain a panoramic video after format conversion, and then divide the panoramic video after format conversion into multiple sliced videos. Among them, the format of the panoramic video includes but is not limited to fisheye image format or panoramic image format. Exemplarily, if the panoramic video is in a panoramic image format, the server may divide the direct panoramic image into multiple sliced videos; if the panoramic video is in a fisheye image format, the server may first convert the fisheye image into a cube expansion image, and then divide the cube expansion image into multiple sliced videos. Afterwards, the server may store the multiple sliced videos. Among them, optionally, the multiple sliced videos may be stored in a preset database or memory location. Of course, the embodiment of the present application does not limit the storage location of the multiple sliced videos.
[0239] In this embodiment, by receiving an uploaded panoramic video, dividing the panoramic video into a plurality of sliced videos, and storing the plurality of sliced videos, a plurality of sliced videos corresponding to the panoramic video can be obtained.
[0240] In one embodiment, Figure 8 As shown, the above panoramic video processing method also includes:
[0241] S305: Encode each slice video to obtain a plurality of encoded slice videos.
[0242] In an embodiment of the present application, the server may use a preset video encoding method to encode each slice video to obtain a plurality of encoded slice videos. Among them, the preset video encoding method may include but is not limited to H.264 (Advanced Video Coding), H.265 (High Efficiency Video Coding), AV1 (AOMedia Video 1, a new video encoding format), etc. In general, the video encoding process includes an intra-frame prediction encoding step and an inter-frame prediction encoding step. Among them, the intra-frame prediction encoding step may include: first, for each slice video, obtain the reference pixels required for intra-frame prediction from each slice video; secondly, filter the reference pixels; thirdly, according to the principle of minimum rate-distortion cost, select the optimal intra-frame prediction mode from various intra-frame prediction modes; then, use the optimal intra-frame prediction mode to perform intra-frame prediction encoding to obtain each encoded slice video. It should be noted that the embodiment of the present application improves the inter-frame prediction encoding step. The specific inter-frame prediction encoding step can be found in detail below Fig. 9 The corresponding embodiments.
[0243] The step of "storing multiple sliced videos" in S304 includes:
[0244] S306: Store the plurality of encoded sliced videos into a video database.
[0245] In the embodiment of the present application, the server can store multiple encoded sliced videos in a video database, and set a corresponding index for each sliced video. It should be noted that the sliced videos and the indexes are in a one-to-one correspondence.
[0246] In this embodiment, in order to ensure that multiple sliced video streams can be merged into one video stream, it is necessary to first encode each sliced video to obtain multiple encoded sliced videos, and then store the multiple encoded sliced videos in a video database. In this way, the sliced video stream can be determined from the multiple encoded sliced videos, thereby ensuring that no bit errors will occur when the sliced video streams are subsequently spliced together, and ensuring that the multiple sliced video streams can still be decoded normally after being merged.
[0247] In one embodiment, the inter-frame prediction encoding step is improved, such as Fig. 9 As shown, S305 includes:
[0248] S401, determining the search range corresponding to each slice video.
[0249] In an embodiment of the present application, optionally, the server can determine the search range corresponding to each coding block for each sliced video according to the size of the sliced video and the position of the coding block in the sliced video; or, the server can also determine the search range corresponding to the current coding block according to the coordinates of the current coding block, the width of the current coding block and the height of the current coding block, combined with the consideration of the image edge errors that may be caused by sub-pixel interpolation. Of course, the embodiment of the present application does not limit the specific implementation method for determining the search range. Among them, the search range refers to the search range corresponding to each coding block in the sliced video.
[0250] It should be noted that the purpose of setting the search range corresponding to each coding block in the embodiment of the present application is to ensure that the searched reference block is located in the same slice video and cannot span other slice videos or use pixels of other slice videos, so as to ensure the relative independence between the slice videos, thereby ensuring that no bit errors will occur when the slice videos are subsequently spliced.
[0251] S402, performing motion search in each search range to obtain a motion vector corresponding to each search range.
[0252] In the embodiment of the present application, the server can perform motion search in the search range corresponding to each coding block through each coding block to obtain the motion vector (MV) corresponding to each search range. It should be noted that the current coding block can only be searched within the search range where the coding block is located during motion search, and if the search result involves sub-pixels, since sub-pixels are calculated from whole pixels, it is also necessary to ensure that the pixels for calculating these sub-pixels are also within the search range, so as to ensure the relative independence between the sliced videos.
[0253] S403, encoding each slice video according to the motion vector corresponding to each search range to obtain a plurality of encoded slice videos.
[0254] In an embodiment of the present application, for each slice video, the server can calculate the pixel residual according to the motion vector corresponding to each search range, perform DCT (Discrete Cosine Transform) and quantize the pixel residual, and then entropy encode the slice video after the above processing to obtain multiple encoded slice videos.
[0255] In this embodiment, in order to ensure that multiple sliced video streams can be merged into one video stream, it is necessary to limit the search range of inter-frame prediction coding by setting the search range corresponding to each coding block when encoding each sliced video, so as to ensure the relative independence between the sliced videos and ensure that the motion vector determined in each sliced video cannot exceed the range of the current sliced video, thereby ensuring that no bit errors will occur when the sliced video streams are subsequently spliced together, and ensuring that the multiple sliced video streams can still be decoded normally after being merged.
[0256] In one embodiment, S401 includes:
[0257] For each sliced video, a search range corresponding to each coding block is determined according to the size of the sliced video and the position of the coding block in the sliced video.
[0258] In an embodiment of the present application, for each sliced video, the server can obtain the position of each coding block in each sliced video, and determine the search range corresponding to each coding block according to the size of the sliced video and the position of each coding block in the sliced video. Exemplarily, assuming that the sliced video is a rectangle with a length and width of n, and the coordinate position of the current coding block in the sliced video is (x, y) = (1, 1), then it can be determined that the search range corresponding to the current coding block is -1 <= x <= n–1, -1 <= y <= n–1.
[0259] In this embodiment, for each sliced video, the search range corresponding to each coding block can be accurately determined according to the size of the sliced video and the position of the coding block in the sliced video, and the search range of inter-frame prediction coding can be accurately limited, so as to ensure the relative independence between the sliced videos, ensure that the determined motion vector in each sliced video does not exceed the range of the current sliced video, and further ensure that no bit errors will occur when the sliced video streams are subsequently spliced, and ensure that multiple sliced video streams can still be decoded normally after being merged.
[0260] In one embodiment, Fig.10 As shown, a method for implementing the segmentation of the panoramic video is provided, that is, when the server executes the step of "segmenting the panoramic video into a plurality of sliced videos" in the above S304, it specifically includes:
[0261] S501, generating a corresponding expanded cube diagram according to the panoramic video.
[0262] Among them, the panoramic video may include but is not limited to a panoramic image or a fisheye image, and a cube map (cubemap) is a graphic in which each face of a cube is unfolded and laid out on a plane. In an embodiment of the present application, optionally, if the panoramic video is a panoramic image taken with a panoramic camera, the server may generate a corresponding cube map based on the panoramic image; or, if the panoramic video is a fisheye image taken with a fisheye camera, the server may generate a corresponding cube map based on the fisheye image. Of course, the embodiment of the present application does not limit the specific implementation method for generating the cube map. It should be noted that the embodiment of the present application improves the step of generating a cube map based on a fisheye image. The specific step of generating a cube map based on a fisheye image can be found in detail below. Fig.11 The corresponding embodiments.
[0263] S502, segmenting the expanded cube image according to segmentation requirements to obtain a plurality of sliced videos.
[0264] In an embodiment of the present application, the server can segment the expanded cube diagram according to the segmentation requirements to obtain multiple sliced videos. The segmentation requirements may include a preset segmentation size, a preset segmentation shape, etc. Of course, the embodiment of the present application does not limit the segmentation requirements. For example, assuming that the segmentation requirements require the above-mentioned slices to be rectangular slices with a width of W and a height of H, and the size of the overlapping area between adjacent slices is required to be O, then the coordinates of the upper left vertex of the sliced video in the yth row and xth column after segmentation in the expanded cube diagram are (x*(WO), y*(HO)).
[0265] In this embodiment, a corresponding expanded cube image may be generated according to the panoramic video, and then the expanded cube image may be segmented according to segmentation requirements to obtain multiple sliced videos, so that the pixel density of the multiple sliced videos may be more uniform.
[0266] In one embodiment, if Fig.11 As shown, if the panoramic video is a fisheye image taken by a fisheye camera, S501 includes:
[0267] S601, mapping the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image.
[0268] In the embodiment of the present application, for each pixel in the expanded image, the server can first project each pixel in the expanded image onto the unit sphere according to the cube projection relationship, obtain the three-dimensional point corresponding to each pixel in the expanded image on the unit sphere, and then project the three-dimensional point corresponding to each pixel onto the fisheye image according to the fisheye calibration information to obtain the corresponding point on the fisheye image corresponding to each pixel. In this way, the mapping relationship between the fisheye image and the expanded image can be obtained. In addition, the seamless splicing algorithm can be used to adjust the mapping relationship obtained above to align the images at the seams, eliminate ghosting and fault phenomena, and ensure that the expanded image of the cube has a seamless splicing effect. Among them, the mapping relationship between the fisheye image and the expanded image can be in the form of a graph or a table. Of course, the embodiment of the present application does not limit the specific form of the mapping relationship between the fisheye image and the expanded image. Afterwards, the server can map the fisheye image taken by the fisheye camera to the preset expanded image according to the mapping relationship between the fisheye image and the expanded image. Among them, the preset expanded image refers to a cube expanded image that only includes each position information but not color information.
[0269] S602, performing image rendering on the preset unfolded image according to different preset resolutions to obtain cube unfolded images corresponding to different resolutions.
[0270] In the embodiment of the present application, the server can perform image rendering on the preset expansion diagram according to different preset resolutions to obtain cube expansion diagrams corresponding to different resolutions. Optionally, the server can use different preset resolutions to perform different image renderings on the preset expansion diagram to obtain cube expansion diagrams corresponding to different resolutions; or, the server can first use the maximum resolution among the preset different resolutions to perform image rendering on the preset expansion diagram to generate a cube expansion diagram corresponding to the maximum resolution, and then downsample the cube expansion diagram corresponding to the maximum resolution according to the preset different resolutions, so as to obtain cube expansion diagrams corresponding to different resolutions. Of course, the embodiment of the present application does not limit the specific implementation method of generating the cube expansion diagram. Among them, for the splicing area, image fusion operation needs to be performed during the image rendering process, and the embodiment of the present application does not limit the specific implementation method of image fusion.
[0271] It should be noted that the present application can also implement the extension process of the cube face. Specifically, each expanded cube face corresponding to the expanded cube diagram will have a portion of the screen around it that is larger than the actual cube face, and the screen content of these extra parts is the same as the edge screen content of the adjacent cube face. When rendering the edge pixels of the cube face, the sampling can be completed within the same cube face based on the above-mentioned extended screen content, without the need for cross-cube sampling (i.e., sampling from multiple cube faces), so as to facilitate rendering sampling of edge pixels.
[0272] In this embodiment, the server can map the fisheye image to the preset expanded image according to the mapping relationship between the fisheye image and the expanded image, and the server can render the preset expanded image according to the preset different resolutions to obtain cube expanded images corresponding to different resolutions. In this way, the server can comprehensively consider the processing cost, bandwidth and client's image quality experience of the panoramic video, and determine the most suitable resolution corresponding to each layer, so as to generate cube expanded images corresponding to different resolutions based on the most suitable resolution corresponding to each layer.
[0273] In one embodiment, S602 includes:
[0274] According to the maximum resolution among the preset different resolutions, the preset unfolded image is rendered to obtain the cube unfolded image corresponding to the maximum resolution.
[0275] According to other resolutions among different resolutions, the expanded images corresponding to the maximum resolution are downsampled to obtain the expanded images of the cubes corresponding to other resolutions.
[0276] In an embodiment of the present application, the server can pre-set the number of pyramid layers and preset different resolutions, wherein the setting principles of the number of pyramid layers and preset different resolutions may include but are not limited to: first, when the rendering window performs image rendering at any field of view angle allowed by the client, a suitable resolution level can be selected from the multiple layers of the pyramid to ensure that the image quality of the rendered image is clear and the required bandwidth is optimal at the current resolution level; second, it is necessary to comprehensively consider the storage transcoding cost and the rendering performance of the client to determine the number of pyramid layers and the different resolutions corresponding to each layer. Among them, each different resolution corresponds to each layer of the pyramid. Afterwards, the server can determine the maximum resolution among the preset different resolutions, and use the maximum resolution among the preset different resolutions to render the preset expansion image, generate a cube expansion image corresponding to the maximum resolution, and then downsample the cube expansion image corresponding to the maximum resolution according to other resolutions among the preset different resolutions, respectively, to obtain cube expansion images corresponding to other resolutions, thereby generating cube expansion images corresponding to different resolutions.
[0277] In this embodiment, the server can render the preset expansion image according to the maximum resolution among the preset different resolutions to obtain the cube expansion image corresponding to the maximum resolution, and can downsample the expansion image corresponding to the maximum resolution according to other resolutions among the different resolutions to obtain the cube expansion images corresponding to other resolutions. In this way, the server can determine the most suitable resolution corresponding to each layer by comprehensively considering the processing cost, bandwidth and client's image quality experience of the panoramic video, and thus can generate cube expansion images corresponding to different resolutions based on the most suitable resolution corresponding to each layer.
[0278] In one embodiment, Fig.12 As shown, the above panoramic video processing method also includes:
[0279] S603, dividing the texture features in the expanded image into a first texture region and a second texture region; the contrast degree of the texture features in the first texture region is higher than the contrast degree of the texture features in the second texture region.
[0280] In an embodiment of the present application, the server may quantify the texture richness of the expanded image in advance, and divide the texture features in the expanded image into a first texture area and a second texture area according to the quantified texture richness of the expanded image. Exemplarily, the server may compare the texture features of each pixel in the expanded image with a preset texture threshold. If the texture features of the pixel in the expanded image are greater than or equal to the preset texture threshold, the pixel may be divided into a first texture area; if the texture features of the pixel in the expanded image are less than the preset texture threshold, the pixel may be divided into a second texture area. Optionally, the shapes of the first texture area and the second texture area may be a regular square grid, or may be an irregular polygonal grid. Of course, the embodiment of the present application does not limit the shapes of the first texture area and the second texture area. The contrast of the texture features in the first texture area is higher than the contrast of the texture features in the second texture area, that is, the texture richness in the first texture area is higher than the texture richness in the second texture area. The way to quantify the texture richness of an image may include but is not limited to image gradient calculation, edge detection, saliency detection, and the like. In addition, optionally, the texture area division may be performed on the original fisheye image, or the texture area division may be performed on the expanded image. Of course, the embodiments of the present application are not limited to this.
[0281] S604, adjusting the range of the first texture area and the second texture area in the expanded image to obtain a new expanded image.
[0282] In an embodiment of the present application, the server can obtain a new expanded image by adjusting the range or area of the first texture area and the second texture area in the expanded image. Exemplarily, the server can expand the range of the first texture area according to the first scaling ratio, and can reduce the range of the second texture area according to the second scaling ratio, thereby obtaining a new expanded image, wherein, optionally, the reciprocal of the first scaling ratio and the second scaling ratio can be equal, or the reciprocal of the first scaling ratio and the second scaling ratio can also be unequal. Of course, the embodiment of the present application does not limit the specific values of the first scaling ratio and the second scaling ratio.
[0283] S605: construct a mapping relationship between the new expanded image and the fisheye image.
[0284] S601 includes:
[0285] S606, mapping the fisheye image onto the preset expanded image according to the mapping relationship between the new expanded image and the fisheye image.
[0286] In an embodiment of the present application, for each pixel point in the new expanded image, the server can first project each pixel point in the new expanded image onto the unit sphere according to the cube projection relationship, and obtain the three-dimensional point corresponding to each pixel point in the new expanded image on the unit sphere surface, and then project the three-dimensional point corresponding to each pixel point onto the fisheye image according to the fisheye calibration information to obtain the corresponding point on the fisheye image corresponding to each pixel point. In this way, the mapping relationship between the fisheye image and the new expanded image can be obtained. Among them, the mapping relationship between the fisheye image and the new expanded image can be in the form of a graph or a table. Of course, the embodiment of the present application does not limit the specific form of the mapping relationship between the fisheye image and the new expanded image. Afterwards, the server can map the fisheye image taken by the fisheye camera to the preset expanded image according to the mapping relationship between the fisheye image and the new expanded image.
[0287] In this embodiment, by dividing the texture features in the expanded image into a first texture area and a second texture area, and adjusting the range of the first texture area and the second texture area in the expanded image, a new expanded image is obtained, and the proportion of the picture area in the expanded image can be reallocated according to the texture richness of the picture. In this way, the clarity of the texture-rich area of the picture (i.e., the first texture area) can be improved without changing the resolution of the expanded image.
[0288] In one embodiment, S604 includes:
[0289] The range of the first texture area is expanded, and the range of the second texture area is reduced to obtain a new expanded image; the first range in the new expanded image is equal to the second range in the expanded image; the first range is the sum of the range of the first texture area and the range of the second texture area in the new expanded image, and the second range is the sum of the range of the first texture area and the range of the second texture area in the expanded image.
[0290] In an embodiment of the present application, the server can expand the range of the first texture area to obtain a new range of the first texture area, and can reduce the range of the second texture area to obtain a new range of the second texture area. In addition, it is necessary to ensure that the first range in the new expanded view is equal to the second range in the expanded view, and directly enlarge the image content in the original first texture area to the new first texture area, and directly reduce the image content in the original second texture area to the new second texture area, so as to obtain a new expanded view. Among them, the first range is the sum of the range of the first texture area and the range of the second texture area in the new expanded view, and the second range is the sum of the range of the first texture area and the range of the second texture area in the expanded view, that is, when adjusting the range of the first texture area and the second texture area in the expanded view, the embodiment of the present application needs to ensure that the sum of the range of the new first texture area and the range of the new second texture area is equal to the sum of the range of the first texture area and the range of the second texture area.
[0291] In this embodiment, a new expanded image can be obtained by expanding the range of the first texture area and reducing the range of the second texture area, that is, the clarity of the image with rich texture (i.e., the first texture area) can be improved without changing the resolution of the expanded image.
[0292] In one embodiment, a panoramic video processing system is provided, the panoramic video processing system comprising: a camera end, a client end, and a server end;
[0293] The camera is used to send the captured panoramic video to the server.
[0294] The server is used to divide the panoramic video into multiple slice videos, store the multiple slice videos, and generate a video slice index corresponding to each slice video.
[0295] The server is also used to generate a low-resolution code stream of the panoramic video based on the panoramic video as a background code stream.
[0296] The client is used to determine the user's current viewing area, determine the corresponding video slice index based on the viewing area, and send the video slice index to the server.
[0297] The server is also used to send the corresponding slice video stream and background code stream to the client based on the video slice index, so that the client can display the background code stream during the process of changing to a new slice video stream.
[0298] In an embodiment of the present application, a panoramic video processing system includes a camera end, a client end, and a server end, wherein the camera end is used to capture panoramic videos, the server end may include but is not limited to the cloud, the client end is a playback terminal, and data can be transmitted between the camera end, the client end, and the server end. The camera end can capture panoramic videos and send the captured panoramic videos to the server end. The server end can divide the received panoramic video into multiple slice videos and store the multiple slice videos. In addition, the server end can also generate a video slice index corresponding to each slice video, and store the video slice index together with the corresponding slice video. The server end can also generate a low-resolution stream of the panoramic video based on the high-definition panoramic video, and store the low-resolution stream of the panoramic video as a background stream.
[0299] When the user needs to watch a panoramic video, the client can determine the user's current viewing area, and based on the viewing area, determine the video slice index corresponding to the viewing area from the indexes of multiple slice videos in the panoramic video, and send the video slice index to the server. Thus, the server can determine the slice video stream corresponding to the video slice index based on the received video slice index, and send the slice video stream and the pre-stored background code stream to the client. Furthermore, the client can decode and render the received slice video stream to the viewing area, and when the client detects that the user's viewing area has changed, it can determine the new video slice index corresponding to the changed viewing area, and pull the corresponding new slice video stream based on the new video slice index, and display the background code stream in the process of replacing the new slice video stream to improve the user's viewing effect of the panoramic video.
[0300] In the above-mentioned panoramic video processing system, the panoramic video processing system includes a camera end, a client end and a server end; the camera end is used to send the captured panoramic video to the server end; the server end is used to divide the panoramic video into multiple slice videos, store the multiple slice videos, and generate a video slice index corresponding to each slice video; the server end is also used to generate a low-resolution code stream of the panoramic video based on the panoramic video as a background code stream; the client end is used to determine the current viewing area of the user, determine the corresponding video slice index based on the viewing area, and send the video slice index to the server end; the server end is also used to send the corresponding slice video stream and background code stream to the client end based on the video slice index, so that the client end can display the background code stream in the process of replacing the new slice video stream. By transmitting data between the camera end, the client end and the server end, when the user needs to watch the panoramic video, the client end only needs to receive and process the slice video stream and the background code stream corresponding to the viewing area, without transmitting and processing the entire panoramic video, which can greatly reduce the network bandwidth in the transmission and processing process of the panoramic video, and will not affect the effect of the user watching the slice video, thereby ensuring the smooth and efficient transmission and clarity of the panoramic video under low bandwidth. In addition, since the client can receive the background code stream, the client can display the background code stream during the process of replacing the new slice video stream to improve the user's viewing experience of the panoramic video.
[0301] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0302] Based on the same inventive concept, the embodiment of the present application also provides a panoramic video processing device for implementing the panoramic video processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more panoramic video processing device embodiments provided below can refer to the limitations of the panoramic video processing method above, and will not be repeated here.
[0303] In an exemplary embodiment, Fig.13 As shown, a panoramic video processing device is provided, comprising: a target video stream determination module 11, a decoding and rendering module 12 and a new target video stream determination module 13, which is applied to a client, wherein:
[0304] The target video stream determination module 11 is used to determine the current viewing area of the user and obtain the corresponding target video stream based on the viewing area.
[0305] The decoding and rendering module 12 is used to decode and render the target video stream into the viewing area.
[0306] The new target video stream determination module 13 is used to determine the new target video stream corresponding to the changed viewing area when a change in the user's viewing area is detected, and to display the background stream during the process of replacing the new target video stream. The background stream is a low-resolution stream of the panoramic video.
[0307] In one embodiment, the panoramic video processing device further includes:
[0308] The display module is used to display the background code stream when it is detected that the display cannot normally display the target video stream.
[0309] In one embodiment, the display module includes:
[0310] The display unit is used to display the background stream on the display when the target video stream cannot be pulled from the server in time.
[0311] In one embodiment, the target video stream determination module 11 includes:
[0312] A first determination submodule is used to determine the current viewing area of the user, and determine a corresponding video slice index based on the viewing area, where the video slice index is an index of a slice video in the panoramic video;
[0313] An acquisition submodule is used to acquire a corresponding slice video stream based on a video slice index, where the slice video stream is a target video stream;
[0314] The new target video stream determination module 13 comprises:
[0315] The second determination submodule is used to determine the new video slice index corresponding to the changed viewing area when a change in the user's viewing area is detected, and to pull the corresponding new slice video stream based on the new video slice index, and to display the background code stream during the process of replacing the new slice video stream.
[0316] In one embodiment, the acquisition submodule includes:
[0317] A sending unit, configured to send the video slice index to the server, so that the server determines the slice video stream to be sent based on the video slice index;
[0318] The receiving unit is used to receive the sliced video stream sent by the server.
[0319] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0320] The video slice index includes: layer number index and slice index of the same layer. Different layers correspond to different resolutions, while the same layer has the same resolution.
[0321] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0322] The panoramic video processing device further includes:
[0323] A viewing angle size determination module, used to determine the viewing angle size corresponding to the viewing area;
[0324] A target resolution determination module is used to determine the corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client;
[0325] Get submodules include:
[0326] The first receiving unit is used to receive a slice video stream sent by a server based on a video slice index and a target resolution.
[0327] In one embodiment, the server stores slice videos with different resolutions for the same slice, including:
[0328] The server determines the search range corresponding to each slice video;
[0329] The server performs motion search in each search range to obtain a motion vector corresponding to each search range;
[0330] The server encodes each slice video according to the motion vector corresponding to each search range to obtain multiple encoded slice videos;
[0331] The server stores multiple encoded sliced videos.
[0332] In one embodiment, the panoramic video is a fisheye image captured by a fisheye camera; the server stores slice videos of different resolutions for the same slice, including:
[0333] The server maps the fisheye image onto the preset expanded image according to the mapping relationship between the fisheye image and the expanded image;
[0334] The server performs image rendering on the preset expansion diagram according to different preset resolutions to obtain cube expansion diagrams corresponding to different resolutions;
[0335] The server segments the expanded cube image according to segmentation requirements to obtain multiple slice videos.
[0336] In one of the embodiments, the server stores slice videos with different resolutions for the same slice;
[0337] The panoramic video processing device further includes:
[0338] The sliced video stream determination module is used to determine the field of view angle size corresponding to the viewing area, and send the field of view angle size to the server so that the server determines the corresponding target resolution based on the field of view angle size and / or the current network bandwidth of the client, and determines the sliced video stream to be sent based on the video slice index and the target resolution.
[0339] In one embodiment, the first sending module includes:
[0340] The video slice index determination unit is used to determine the video slice index according to the position of each pixel point in the viewing area projected on the panoramic video.
[0341] In one of the embodiments, the video slice index determination unit includes:
[0342] A rendering window determination subunit, used to determine the rendering window according to the viewing angle parameters of the current rendering picture corresponding to the viewing area;
[0343] A target pixel point determination subunit is used to determine a target pixel point that falls in the rendering window on the expanded cube image corresponding to the panoramic video;
[0344] The video slice index determination subunit is used to determine the video slice index according to the target pixel point.
[0345] In one embodiment, the target pixel determination subunit includes:
[0346] The mask image generating subunit is used to project each pixel point in the expanded image of the cube onto the plane where the rendering window is located, so as to obtain a mask image corresponding to the expanded image of the cube; the grayscale value of the pixel point contained in the rendering window on the mask image is a first value, and the grayscale value of the pixel point contained in other areas on the mask image is a second value;
[0347] The target pixel point selection subunit is used to determine the target pixel points on the expanded image of the cube that fall within the rendering window according to the mask image.
[0348] In one embodiment, the mask image generating subunit includes:
[0349] The sub-unit for generating each pixel point after projection is used to project each pixel point in the expanded image of the cube to the plane where the rendering window is located to obtain each pixel point after projection;
[0350] The mask image obtaining subunit is used to set the grayscale value of the pixel points located in the rendering window to the first value, and set the grayscale values of other pixel points to the second value, so as to obtain the mask image.
[0351] In one embodiment, the decoding and rendering module includes:
[0352] A merging unit, used for merging the sliced video streams to obtain a merged video stream;
[0353] A decoding unit, used for decoding the merged video stream to obtain decoded frame data;
[0354] The rendering unit is used to upload the decoded frame data to the renderer, and determine the position of each pixel point in the viewing area on the decoded frame data through the renderer to render the decoded frame data into the viewing area.
[0355] In an exemplary embodiment, Fig.14 As shown, a panoramic video processing device is provided, including: a receiving module 21 and a sending module 22, which are applied to a server, wherein:
[0356] The receiving module 21 is used to receive the video slice index sent by the client; the video slice index is determined based on the user's current viewing area, and the video slice index is the index of the slice video in the panoramic video.
[0357] The sending module 22 is used to send the corresponding slice video stream and background code stream to the client based on the video slice index. The background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream when changing to a new slice video stream.
[0358] In one embodiment, the panoramic video processing device further includes:
[0359] A panoramic video acquisition module, used to receive uploaded panoramic videos;
[0360] The segmentation module is used to segment the panoramic video into multiple sliced videos and store the multiple sliced videos.
[0361] In one embodiment, the panoramic video processing device further includes:
[0362] The encoding module is used to encode each slice video to obtain a plurality of encoded slice videos;
[0363] The segmentation modules include:
[0364] The storage unit is used to store the plurality of encoded sliced videos in a video database.
[0365] In one embodiment, the encoding module includes:
[0366] A search range determination unit, used to determine the search range corresponding to each slice video;
[0367] A motion search unit, used to perform motion search in each search range to obtain a motion vector corresponding to each search range;
[0368] The encoding unit is used to encode each slice video according to the motion vector corresponding to each search range to obtain a plurality of encoded slice videos.
[0369] In one of the embodiments, the search range determination unit includes:
[0370] The search range determination unit subunit is used to determine the search range corresponding to each coding block for each slice video according to the size of the slice video and the position of the coding block in the slice video.
[0371] In one embodiment, the segmentation module includes:
[0372] A cube expansion diagram generating unit, used to generate a corresponding cube expansion diagram according to the panoramic video;
[0373] The segmentation unit is used to segment the expanded cube image according to segmentation requirements to obtain multiple slice videos.
[0374] In one embodiment, the panoramic video is a fisheye image captured by a fisheye camera; and the cube expansion image generating unit includes:
[0375] A mapping subunit, used for mapping the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image;
[0376] The cube expansion image generating subunit is used to perform image rendering on the preset expansion image according to different preset resolutions to obtain the cube expansion images corresponding to the different resolutions.
[0377] In one embodiment, the cube expansion diagram generating subunit includes:
[0378] An image rendering subunit, used for performing image rendering on a preset expansion image according to a maximum resolution among preset different resolutions, to obtain a cube expansion image corresponding to the maximum resolution;
[0379] The downsampling subunit is used to downsample the expanded image corresponding to the maximum resolution according to other resolutions among the different resolutions, so as to obtain the expanded images of the cube corresponding to other resolutions.
[0380] In one embodiment, the panoramic video processing device further includes:
[0381] A division module, used to divide the texture features in the expanded image into a first texture area and a second texture area; the contrast degree of the texture features in the first texture area is higher than the contrast degree of the texture features in the second texture area;
[0382] A new expansion graph generation module, used for adjusting the range of the first texture area and the second texture area in the expansion graph to obtain a new expansion graph;
[0383] A new mapping relationship building module is used to build a new mapping relationship between the unfolded image and the fisheye image;
[0384] The mapping subunits include:
[0385] The new mapping subunit is used to map the fisheye image onto the preset expanded image according to the mapping relationship between the new expanded image and the fisheye image.
[0386] In one embodiment, the new expansion diagram generation module includes:
[0387] A new expansion diagram generation unit is used to expand the range of the first texture area and reduce the range of the second texture area to obtain a new expansion diagram; the first range in the new expansion diagram is equal to the second range in the expansion diagram; the first range is the sum of the range of the first texture area and the range of the second texture area in the new expansion diagram, and the second range is the sum of the range of the first texture area and the range of the second texture area in the expansion diagram.
[0388] Each module in the above-mentioned panoramic video processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0389] In an exemplary embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Fig.15 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. 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 input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external client in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for processing a panoramic video is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0390] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a part of the structure 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 certain components, or have a different arrangement of components.
[0391] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0392] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0393] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0394] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0395] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0396] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0397] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing panoramic video, characterized in that: Applied to a client, the method comprises: Determine a current viewing area of the user, and obtain a corresponding target video stream based on the viewing area; Decoding and rendering the target video stream into the viewing area; When it is detected that the user's viewing area has changed, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the process of replacing the new target video stream. The background stream is a low-resolution stream of the panoramic video.
2. The method according to claim 1, characterized in that The method further comprises: When it is detected that the display cannot normally display the target video stream, the background code stream is displayed.
3. The method according to claim 2, characterized in that When it is detected that the display cannot normally display the target video stream, displaying the background stream includes: When the target video stream cannot be pulled from the server in time, the background stream is displayed on the display.
4. The method according to claim 1, characterized in that: The determining the current viewing area of the user and acquiring the corresponding target video stream based on the viewing area includes: Determine a current viewing area of the user, and determine a corresponding video slice index based on the viewing area, where the video slice index is an index of a slice video in the panoramic video; Acquire a corresponding slice video stream based on the video slice index, where the slice video stream is the target video stream; When it is detected that the viewing area of the user has changed, a new target video stream corresponding to the changed viewing area is determined, and a background stream is displayed during the process of replacing the new target video stream, wherein the background stream is a low-resolution stream of the panoramic video, including: When it is detected that the user's viewing area has changed, the new video slice index corresponding to the changed viewing area is determined, and the corresponding new slice video stream is pulled based on the new video slice index, and the background code stream is displayed during the process of replacing the new slice video stream.
5. The method according to claim 4, characterized in that The obtaining a corresponding slice video stream based on the video slice index includes: Sending the video slice index to a server, so that the server determines a slice video stream to send based on the video slice index; Receive the sliced video stream sent by the server.
6. The method according to claim 5, characterized in that The server stores slice videos with different resolutions for the same slice; The video slice index includes: a layer number index and a slice index of the same layer. Different layers correspond to different resolutions, and the resolution of the same layer is the same.
7. The method according to claim 5, characterized in that The server stores slice videos with different resolutions for the same slice; The method further comprises: Determine the viewing angle size corresponding to the viewing area; Determine a corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client; The obtaining a corresponding slice video stream based on the video slice index includes: Receive a slice video stream sent by the server based on the video slice index and the target resolution.
8. The method according to claim 7, characterized in that The server stores slice videos with different resolutions for the same slice, including: The server determines a search range corresponding to each of the sliced videos; The server performs motion search within each of the search ranges to obtain motion vectors corresponding to each of the search ranges; The server encodes each of the slice videos according to the motion vector corresponding to each of the search ranges to obtain a plurality of encoded slice videos; The server stores the multiple encoded sliced videos.
9. The method according to claim 7, characterized in that: The panoramic video is a fisheye image taken by a fisheye camera; the server stores slice videos of different resolutions for the same slice, including: The server maps the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image; The server performs image rendering on the preset expansion diagram according to different preset resolutions to obtain cube expansion diagrams corresponding to the different resolutions; The server segments the expanded cube image according to segmentation requirements to obtain a plurality of sliced videos.
10. The method according to claim 5, characterized in that The server stores slice videos with different resolutions for the same slice; The method further comprises: Determine the field of view angle size corresponding to the viewing area, and send the field of view angle size to the server, so that the server determines the corresponding target resolution according to the field of view angle size and / or the current network bandwidth of the client, and determines the slice video stream to be sent according to the video slice index and the target resolution.
11. The method according to claim 4, characterized in that The determining the corresponding video slice index based on the viewing area includes: The video slice index is determined according to a position where each pixel point in the viewing area is projected onto the panoramic video.
12. The method according to claim 11, characterized in that The determining the video slice index according to the position of each pixel point in the viewing area projected on the panoramic video includes: Determining a rendering window according to a viewing angle parameter of a current rendering picture corresponding to the viewing area; Determine a target pixel point on the expanded cube image corresponding to the panoramic video that falls within the rendering window; The video slice index is determined according to the target pixel point.
13. The method according to claim 12, characterized in that The step of determining a target pixel point on the expanded cube image corresponding to the panoramic video that falls within the rendering window includes: Projecting each pixel point in the expanded cube image onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image; the grayscale value of the pixel point contained in the rendering window on the mask image is a first value, and the grayscale value of the pixel point contained in other areas on the mask image is a second value; According to the mask image, a target pixel point on the expanded image of the cube that falls within the rendering window is determined.
14. The method according to claim 13, characterized in that The step of projecting each pixel point in the expanded cube image onto the plane where the rendering window is located to obtain a mask image corresponding to the expanded cube image includes: Projecting each pixel point in the expanded image of the cube onto the plane where the rendering window is located to obtain each pixel point after projection; The grayscale values of the pixels within the rendering window are set to the first value, and the grayscale values of the other pixels are set to the second value, to obtain the mask image.
15. The method according to any one of claims 1 to 14, characterized in that: The decoding and rendering of the sliced video stream to the viewing area includes: Merging the sliced video streams to obtain a merged video stream; Decoding the merged video stream to obtain decoded frame data; The decoded frame data is uploaded to a renderer, and the position of each pixel point in the viewing area on the decoded frame data is determined by the renderer to render the decoded frame data to the viewing area.
16. A method for processing panoramic video, characterized in that: Applied to the server, the method includes: Receive a video slice index sent by a client; the video slice index is determined based on a current viewing area of a user, and the video slice index is an index of a slice video in a panoramic video; Based on the video slice index, the corresponding slice video stream and background code stream are sent to the client, where the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream during the process of replacing the new slice video stream.
17. The method according to claim 16, characterized in that The method further comprises: Receiving the uploaded panoramic video; The panoramic video is divided into a plurality of sliced videos, and the plurality of sliced videos are stored.
18. The method according to claim 17, characterized in that The method further comprises: Encoding each of the sliced videos to obtain a plurality of encoded sliced videos; The storing of the plurality of sliced videos comprises: The multiple encoded slice videos are stored in a video database.
19. The method according to claim 18, characterized in that The encoding process is performed on each of the sliced videos to obtain a plurality of encoded sliced videos, including: Determine the search range corresponding to each of the sliced videos; Perform motion search within each of the search ranges to obtain motion vectors corresponding to each of the search ranges; Each of the sliced videos is encoded according to the motion vector corresponding to each of the search ranges to obtain the multiple encoded sliced videos.
20. The method according to claim 19, characterized in that The determining of the search range corresponding to each of the sliced videos includes: For each of the sliced videos, a search range corresponding to each of the coding blocks is determined according to the size of the sliced video and the position of the coding block in the sliced video.
21. The method according to claim 17, characterized in that The step of dividing the panoramic video into a plurality of sliced videos includes: Generate a corresponding cube expansion diagram according to the panoramic video; The cube expansion diagram is segmented according to segmentation requirements to obtain the multiple slice videos.
22. The method according to claim 21, characterized in that The panoramic video is a fisheye image captured by a fisheye camera; and the step of generating a corresponding expanded cube image according to the panoramic video includes: According to the mapping relationship between the fisheye image and the expanded image, mapping the fisheye image onto a preset expanded image; According to different preset resolutions, image rendering is performed on the preset expansion diagram to obtain cube expansion diagrams corresponding to the different resolutions.
23. The method according to claim 22, characterized in that The step of performing image rendering on the preset expanded image according to the preset different resolutions to obtain the expanded images of the cube corresponding to the different resolutions includes: According to the maximum resolution among the preset different resolutions, the preset expansion image is rendered to obtain a cube expansion image corresponding to the maximum resolution; According to other resolutions among the different resolutions, downsampling processing is performed on the expanded image corresponding to the maximum resolution to obtain the expanded images of the cube corresponding to the other resolutions.
24. The method according to claim 22, characterized in that The method further comprises: Dividing the texture features in the expanded image into a first texture region and a second texture region; the contrast degree of the texture features in the first texture region is higher than the contrast degree of the texture features in the second texture region; Adjust the range of the first texture area and the second texture area in the expanded image to obtain a new expanded image; Constructing a mapping relationship between the new unfolded image and the fisheye image; Mapping the fisheye image onto a preset expanded image according to a mapping relationship between the fisheye image and the expanded image includes: According to the mapping relationship between the new expanded image and the fisheye image, the fisheye image is mapped onto the preset expanded image.
25. The method according to claim 24, characterized in that The adjusting the range of the first texture area and the second texture area in the expanded image to obtain a new expanded image comprises: The range of the first texture area is expanded, and the range of the second texture area is reduced to obtain the new expanded image; the first range in the new expanded image is equal to the second range in the expanded image; the first range is the sum of the range of the first texture area and the range of the second texture area in the new expanded image, and the second range is the sum of the range of the first texture area and the range of the second texture area in the expanded image.
26. A panoramic video processing system, characterized in that: The system comprises: a camera end, a client end, and a server end; The camera end is used to send the captured panoramic video to the server end; The server is used to divide the panoramic video into multiple slice videos, store the multiple slice videos, and generate a video slice index corresponding to each slice video; The server is further configured to generate a low-resolution code stream of the panoramic video based on the panoramic video as a background code stream; The client is used to determine the current viewing area of the user, determine the corresponding video slice index based on the viewing area, and send the video slice index to the server; The server is also used to send the corresponding slice video stream and background code stream to the client based on the video slice index, so that the client can display the background code stream during the process of replacing the new slice video stream.
27. A panoramic video processing device, characterized in that: Applied to a client, the device comprises: A target video stream determination module, used to determine a current viewing area of a user, and obtain a corresponding target video stream based on the viewing area; A decoding and rendering module, used for decoding and rendering the target video stream into the viewing area; The new target video stream determination module is used to determine the new target video stream corresponding to the changed viewing area when a change in the user's viewing area is detected, and to display the background code stream during the process of replacing the new target video stream. The background code stream is a low-resolution code stream of the panoramic video.
28. A panoramic video processing device, characterized in that: Applied to the server, the device comprises: A receiving module, configured to receive a video slice index sent by a client; the video slice index is determined based on a current viewing area of a user, and the video slice index is an index of a slice video in a panoramic video; A sending module is used to send the corresponding slice video stream and background code stream to the client based on the video slice index, and the background code stream is a low-resolution code stream of the panoramic video, so that the client can display the background code stream during the process of replacing the new slice video stream.
29. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 25 are implemented.
30. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 25 are implemented.
