Video encoding method, device and electronic equipment

By arranging the target images of multi-view videos in the first half and using images with a default viewing angle or angle difference as reference frames, the problem of low encoding efficiency of multi-view videos in the prior art is solved, and more efficient encoding and Faster decoding playback.

CN113949873BActive Publication Date: 2024-12-06BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111202332.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-15
Publication Date
2024-12-06
Estimated Expiration
2041-10-15

AI Technical Summary

Technical Problem

The existing multi-view video encoding method leads to low encoding efficiency, mainly due to certain errors every time the encoding is used, and the difference in the picture content between some images and the previous frame image is large, resulting in low encoding efficiency.

Method used

By arranging the target image in the first half of the video to be encoded, setting the image corresponding to the default viewing angle or an image whose angle difference is not greater than the preset threshold is the reference frame to reduce the difference in picture content between images and thereby improving encoding efficiency.

Benefits of technology

It significantly improves the encoding efficiency of multi-view video, reduces encoding errors, and can obtain the default viewing image faster during decoding, reducing display delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113949873B_ABST
    Figure CN113949873B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a video encoding method, device and electronic device, the method comprising: obtaining multiple frames of images to be encoded shot at the same time point, arranging a target image at a target position in the first half of all the images to be encoded, and obtaining a video to be encoded, wherein the target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded shot by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold, and then encoding the video to be encoded to obtain an encoded multi-view video, wherein the image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame. The difference between the target image and the remaining images to be encoded is relatively small, and the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame, and the difference in picture content is minimal, which can improve encoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video encoding technology, and in particular to a video encoding method, device and electronic equipment. Background Art

[0002] As users' needs for watching videos diversify, there are more and more video formats. Among them, multi-view videos can meet users' needs to watch the same scene from multiple perspectives. Multi-view videos require multiple cameras to surround the scene from different angles, and then arrange and encode the images of each perspective at the same time point to obtain the encoded multi-view video. When the user wants to watch the multi-view video through the terminal, the terminal can obtain the multi-view video and decode and play it. For the time point with multiple perspective images, the terminal plays the picture corresponding to the default perspective by default. If the user wants to watch the pictures of other perspectives, it can be achieved by dragging the progress bar and other operations.

[0003] At present, the encoding method for images with multiple viewpoints is to encode the images with multiple viewpoints at the same time point in the order of camera numbers. Since the multi-view video is to gradually arrange multiple cameras from the default viewpoint to both sides, the camera number corresponding to the default viewpoint is in the middle. For example, there are 30 cameras in total, among which the camera corresponding to the default viewpoint is the 15th camera, and the images taken by these 30 cameras are P1, P2...P30 respectively. Then the 30 frames of images are arranged in the order of P1, P2...P30 and encoded.

[0004] Taking the H.264 coding standard as an example, it uses the previous frame as the reference frame for coding, that is, P2 is coded with P1 as the reference frame, P3 is coded with P2 as the reference frame, and so on. Since there will be certain errors in each coding, and the picture content difference between some images and their previous frames may be large, the current video coding method will result in low coding efficiency of multi-view videos. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a video encoding method, device and electronic device to improve the encoding efficiency of multi-view videos. The specific technical solution is as follows:

[0006] In a first aspect, an embodiment of the present invention provides a video encoding method, the method comprising:

[0007] Acquire multiple frames of images to be encoded captured at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene;

[0008] Arranging a target image at a target position in the first half of all images to be encoded to obtain a video to be encoded, wherein the target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded taken by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold;

[0009] The video to be encoded is encoded to obtain an encoded multi-view video, wherein the image to be encoded taken by a camera adjacent to the camera corresponding to the default view uses the image to be encoded corresponding to the default view as a reference frame.

[0010] Optionally, the target image is an image to be encoded corresponding to the default viewing angle;

[0011] The step of arranging the target image at the target position of the first half of all the images to be encoded to obtain the video to be encoded includes:

[0012] Arrange the images to be encoded taken by the camera on the side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0013] Arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0014] The target image is arranged at the target position in the first half to obtain the video to be encoded.

[0015] Optionally, the step of encoding the video to be encoded to obtain an encoded multi-view video includes:

[0016] According to the arrangement order of the images in the to-be-encoded video, the to-be-encoded images are encoded in sequence, and when the to-be-encoded image currently being encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the to-be-encoded image corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded;

[0017] When the currently encoded image to be encoded is another image to be encoded, a reference frame of the other image to be encoded is determined according to the current encoding standard, and the other image to be encoded is encoded to obtain an encoded multi-view video.

[0018] Optionally, before the step of encoding the image to be encoded corresponding to the default viewing angle as a reference frame, the method further includes:

[0019] The image to be encoded corresponding to the default viewing angle is set as the reference frame with the least encoding bitstream bytes corresponding to the image to be encoded; or,

[0020] The image to be encoded corresponding to the default viewing angle is placed in the first frame of the reference frame queue.

[0021] Optionally, the target position is the first frame of all images to be encoded.

[0022] In a second aspect, an embodiment of the present invention provides a video encoding device, the device comprising:

[0023] An acquisition module, used to acquire multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene;

[0024] An arrangement module is used to arrange a target image at a target position in the first half of all images to be encoded to obtain a video to be encoded, wherein the target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded taken by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold;

[0025] The encoding module is used to encode the video to be encoded to obtain an encoded multi-view video, wherein the image to be encoded taken by the camera adjacent to the camera corresponding to the default view uses the image to be encoded corresponding to the default view as a reference frame.

[0026] Optionally, the target image is an image to be encoded corresponding to the default viewing angle;

[0027] The arrangement module comprises:

[0028] A first arrangement unit, configured to arrange the images to be encoded taken by the camera on one side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0029] A second arrangement unit, configured to arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0030] The third arrangement unit is used to arrange the target image at a target position in the first half to obtain a video to be encoded.

[0031] Optionally, the encoding module includes:

[0032] A first encoding unit is used to encode the to-be-encoded images in sequence according to the arrangement order of the images in the to-be-encoded video, and when the to-be-encoded image currently being encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the to-be-encoded image corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded;

[0033] The second encoding unit is used to determine the reference frame of other images to be encoded according to the current encoding standard when the image to be encoded currently is other images to be encoded, and encode the other images to be encoded to obtain the encoded multi-view video.

[0034] Optionally, the encoding module further includes:

[0035] a reference frame setting unit, configured to set the image to be encoded corresponding to the default viewing angle as a reference frame having the least bytes of the encoding code stream corresponding to the image to be encoded, before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame; or

[0036] The reference frame placement unit is used to place the image to be encoded corresponding to the default viewing angle into the first frame of the reference frame queue before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame.

[0037] Optionally, the target position is the first frame of all images to be encoded.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0039] Memory, used to store computer programs;

[0040] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.

[0041] In the scheme provided by an embodiment of the present invention, an electronic device can obtain multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene, and arrange the target image at the target position in the first half of all the images to be encoded to obtain a video to be encoded, wherein the target image is the image to be encoded corresponding to a default perspective or the image to be encoded taken by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, and then, the video to be encoded is encoded to obtain an encoded multi-perspective video, wherein the image to be encoded taken by a camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame.

[0042] Since the target image in the video to be encoded is arranged at the target position in the front half of all the images to be encoded, and the target image is the image to be encoded corresponding to the default viewing angle or the image to be encoded shot by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold, that is to say, the picture content difference between the target image and the remaining images to be encoded is relatively small. When encoding the video to be encoded, the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame, and the picture content difference between the two is minimal, thereby improving the encoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0044] Figure 1 A flowchart of a video encoding method provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of encoding multiple frames of images to be encoded is shown in FIG.

[0046] Figure 3 Based on Figure 1 A schematic diagram of the encoding process of the illustrated embodiment;

[0047] Figure 4 for Figure 1 A specific flow chart of step S102 in the illustrated embodiment;

[0048] Figure 5 Another schematic diagram of encoding multiple frames of images to be encoded is shown;

[0049] Figure 6 Based on Figure 1 Another schematic diagram of the encoding process of the illustrated embodiment;

[0050] Figure 7 Based on Figure 1 Another schematic diagram of the encoding process of the illustrated embodiment;

[0051] Figure 8 A schematic diagram of the structure of a video encoding device provided by an embodiment of the present invention;

[0052] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0054] In order to improve the coding efficiency of multi-view videos, embodiments of the present invention provide a video coding method, apparatus, electronic device, computer-readable storage medium, and computer program product. First, a video coding method provided by an embodiment of the present invention is introduced.

[0055] The video encoding method provided in the embodiment of the present invention can be applied to any electronic device that needs to perform multi-view video encoding, for example, a server, an encoding device, a management device, etc., which is not specifically limited here. For the sake of clarity, it is hereinafter referred to as an electronic device.

[0056] like Figure 1 As shown, a video encoding method, the method comprising:

[0057] S101, obtaining multiple frames of images to be encoded taken at the same time point;

[0058] The multiple frames of images to be encoded are images of different viewing angles corresponding to the same scene.

[0059] S102, arranging the target image at the target position of the first half of all the images to be encoded to obtain a video to be encoded;

[0060] The target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded shot by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold.

[0061] S103, encoding the video to be encoded to obtain an encoded multi-view video.

[0062] The image to be encoded captured by a camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame.

[0063] It can be seen that in the scheme provided by the embodiment of the present invention, the electronic device can obtain multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene, and the target image is arranged at the target position of the first half of all the images to be encoded to obtain a video to be encoded, wherein the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, and then, the video to be encoded is encoded to obtain an encoded multi-perspective video, wherein the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame. Since the target image in the video to be encoded is arranged at the target position of the first half of all the images to be encoded, and the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, that is, the difference in picture content between the target image and the remaining images to be encoded is relatively small, when encoding the video to be encoded, the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame, and the difference in picture content between the two is minimal, so the encoding efficiency can be improved.

[0064] In order to enable users to watch multi-view videos, multiple cameras can be used to capture images of the same scene from different perspectives, and these images can be encoded to obtain multi-view videos. During the encoding process, the electronic device can obtain multiple frames of images to be encoded captured at the same time point.

[0065] Among them, the above-mentioned multiple frames of images to be encoded are images of different perspectives corresponding to the same scene, that is, images taken by multiple cameras from different perspectives of the same scene. In order to facilitate the determination of the perspectives corresponding to each image to be encoded, in one embodiment, the electronic device can number the multiple cameras, and the images to be encoded taken by the multiple cameras can be identified by the corresponding camera numbers. Since in the shooting scene of the multi-perspective video, multiple cameras are gradually arranged from the position corresponding to the default perspective to both sides for shooting, the number of the camera corresponding to the default perspective is generally in the middle of the numbers of all cameras.

[0066] For example, 30 cameras with different shooting angles shoot a certain scene, and 30 frames of images to be encoded with different viewing angles are obtained. The images to be encoded shot by the 30 cameras are numbered P1, P2...P30, respectively. Then the 5th frame of the image to be encoded shot by the 5th camera can be recorded as image P5. The camera corresponding to the default viewing angle is the 15th camera, so the image to be encoded corresponding to the default viewing angle is image P15.

[0067] After acquiring multiple frames of images to be encoded taken at the same time point, the electronic device can execute the above step S102, that is, arrange the target image at the target position of the first half of all images to be encoded to obtain the video to be encoded. In order to improve the encoding efficiency, the electronic device can arrange the target image at the target position of the first half of all images to be encoded, and the arrangement order of other images to be encoded is still arranged according to the order of the corresponding cameras, or according to the angle difference between the cameras corresponding to the default viewing angle, which is reasonable. Among them, the target position is the position corresponding to the first half of all images to be encoded. For example, there are 30 images to be encoded, then the target position is one or more of the first 15 positions.

[0068] In one implementation, since the images to be encoded captured by each camera are based on the image to be encoded at the default viewing angle, the greater the difference in shooting angles, the greater the difference in picture content, so the target image may be the image to be encoded corresponding to the default viewing angle. For example, the camera corresponding to the default viewing angle is the 15th camera, and the target image may be the image to be encoded captured by the 15th camera.

[0069] In another embodiment, since the picture difference between the image to be encoded taken by a camera whose angle difference with the camera shooting the image to be encoded at the default viewing angle is not greater than a preset threshold and the image to be encoded at the default viewing angle is relatively small, the target image may also be an image to be encoded taken by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than the preset threshold. The image to be encoded includes the image to be encoded at the default viewing angle. The preset threshold can be set according to factors such as the number of cameras and the angle difference. For example, it can be 5 degrees, 10 degrees, -12 degrees, etc., which are not specifically limited here. The positive or negative value of the preset threshold can be used to identify that the corresponding camera is located on the left or right side of the camera corresponding to the default viewing angle.

[0070] For example, there are 35 cameras evenly arranged around a circle, that is, the angle between each camera is 10°, the camera corresponding to the default viewing angle is the 18th camera, and the preset threshold is 25°. Then, the image to be encoded taken by the camera located to the right of the 18th camera and within 25° of the 18th camera can be used as the target image, that is, the target image can be the image to be encoded taken by the 16th camera, the 17th camera, and the 18th camera.

[0071] In this case, the electronic device can arrange the target image at the target position in the front half of all the images to be encoded, and the order between each target image is the arrangement order of the corresponding camera. For example, for the target images taken by the 16th camera, the 17th camera and the 18th camera, the electronic device can arrange the three target images P16, P17 and P18 in the front half of all the images to be encoded in this order. For example, the target image can be arranged in the front position to obtain the videos to be encoded P16, P17, P18, P1-P15, P19-P35. The target image can also be arranged in the front position, and the other images to be encoded can be arranged in the order of the angle difference from the image to be encoded of the default viewing angle from small to large, to obtain the videos to be encoded P16, P17, P18, P15-P1, P19-P35.

[0072] Of course, the order between the target images may also be other arrangement orders. In one implementation, the image to be encoded of the default perspective may be arranged first, and the other target images may be arranged after it.

[0073] For example, for the target images captured by the 16th camera, the 17th camera and the 18th camera, the electronic device can arrange them in the order of P18, P16, P17 in the first half of all the images to be encoded, or can arrange them in the order of P18, P17, P16 in the first half of all the images to be encoded, which is reasonable.

[0074] After obtaining the video to be encoded, since the images to be encoded taken by each camera are based on the image to be encoded of the default perspective, the greater the difference in shooting angles, the greater the difference in picture content. The difference between the image to be encoded taken by the camera adjacent to the camera corresponding to the default perspective and the picture content of the image to be encoded of the default perspective is the smallest.

[0075] Then, when encoding the video to be encoded, for the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle, the electronic device can use the image to be encoded corresponding to the default viewing angle as a reference frame, so that the encoding efficiency of the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle can be significantly improved, and the encoding efficiency of other subsequent images to be encoded will also be improved accordingly. Among them, the encoding standard based on which the video to be encoded is encoded can be a video encoding standard such as H.264, H.265 or H.261, which is not specifically limited here.

[0076] For example, Figure 3As shown, the order of the images to be encoded in the video to be encoded is P15, P14, P13...P1, P16, P17...P30, wherein the image to be encoded P15 corresponding to the default viewing angle is located at the first position, and the image to be encoded P14 and the image to be encoded P16 are images taken by the adjacent cameras on the left and right sides thereof, respectively. Then, for the image to be encoded P14 and the image to be encoded P16, when encoding, the image to be encoded P15 can be used as a reference frame.

[0077] In video coding, video frames are generally divided into three categories: I (Intra-Prediction) frames, B (Bi-prediction) frames, and P (Prediction) frames. When encoding an I frame, reference blocks are only searched in the current frame; when encoding a B frame, reference blocks are searched for both in the already encoded frames and in the frames to be encoded; when encoding a P frame, reference blocks are only searched for in the already encoded frames.

[0078] Take the H.264 encoding standard as an example. Figure 2 As shown, currently, when encoding multiple frames of multi-perspective images to be encoded collected at the same time point, P1 is used as the I frame, that is, when encoding P1, P1 is encoded with P1 itself as the reference frame, and the remaining images to be encoded are P frames, that is, P2 is encoded with P1 as the reference frame, P3 is encoded with P2 as the reference frame, and so on.

[0079] When the video encoding method provided by the embodiment of the present invention is used to encode the video to be encoded, taking the H.264 encoding standard as an example, Figure 3 As shown, P15 is used as an I frame, that is, when encoding P15, P15 itself is used as a reference frame for encoding, P14 is encoded with P15 as a reference frame, P13 is encoded with P14 as a reference frame, and so on, until encoding to P1. When encoding P16, P16 is encoded with P15 as a reference frame, P17 is encoded with P16 as a reference frame, and so on, until encoding to P30. In this way, since P15 is an I frame and is encoded with itself as a reference frame, the difference in picture content between P14 and P15 and the difference in picture content between P16 and P15 are both small, and in the entire encoding process, P16 is used as a node, and P16 is re-encoded with P15 as a reference frame. Compared with the target encoding method of encoding 30 frames of images to be encoded in sequence, the cumulative encoding error can be reduced by half, so the encoding efficiency can be improved as a whole.

[0080] In addition, since the target image is arranged at the target position in the first half of all the images to be encoded to obtain the video to be encoded, the video to be encoded is encoded to obtain a multi-view video. After sending it to the terminal, when the terminal decodes the multi-view video, it can obtain the image to be encoded taken by the camera corresponding to the default view faster than the current multi-view video, thereby reducing display delay.

[0081] For example, if the image to be encoded shot by the camera corresponding to the default viewing angle is ranked first, then the picture corresponding to the default viewing angle can be displayed as long as the first frame of the image is decoded. If the image to be encoded shot by the camera corresponding to the default viewing angle is ranked in the first few positions, then the image corresponding to the default viewing angle can be obtained after decoding a few video frames, and then the picture corresponding to the default viewing angle can be displayed, which reduces the display delay of the picture corresponding to the default viewing angle displayed by the terminal.

[0082] As an implementation method of the embodiment of the present invention, Figure 4 As shown, for the case where the target image is the image to be encoded corresponding to the default viewing angle, the step of arranging the target image at the target position of the first half of all the images to be encoded to obtain the video to be encoded may include:

[0083] S401, arranging the images to be encoded taken by the camera on the side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0084] The arrangement of the above-mentioned multiple cameras can be around one circle, around half a circle, around three quarters of a circle, etc., which can be determined according to the width of the viewing angle required for shooting, and is not specifically limited here. Since the default viewing angle is generally the positive viewing angle of the scene, the camera corresponding to the default viewing angle is located in the central position, and the other cameras are distributed on both sides of the camera corresponding to the default viewing angle, and the difference between the image to be encoded and the image to be encoded corresponding to the default viewing angle gradually increases.

[0085] When arranging the images to be encoded, the electronic device can arrange the images to be encoded taken by the camera on the side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle, so that the arrangement order of the images to be encoded is proportional to the difference between the pictures of the images to be encoded corresponding to the default viewing angle. Among them, this part of the images to be encoded can be taken by the camera located on the left side of the camera corresponding to the default viewing angle, or by the camera located on the right side of the camera corresponding to the default viewing angle, which is reasonable.

[0086] For example, for a scene to be captured, 35 cameras are arranged around a circle, the angle difference between each camera is 10°, and the default viewing angle corresponds to the 18th camera, that is, the target image is P18. Then the electronic device can arrange the images to be encoded taken by the 1st to 17th cameras located to the left of the camera corresponding to the default viewing angle in the first half of the 35 images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle, that is, P17, P16, P15...P1.

[0087] S402, arranging the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0088] Similarly, for the images to be encoded taken by the camera located on the other side of the camera corresponding to the default viewing angle, the electronic device can arrange them in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle.

[0089] For example, for the images P19-P35 to be encoded taken by the 19th to 35th cameras located on the right side of the camera corresponding to the default viewing angle, the electronic device can arrange them in the second half of the 35 images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle, namely P19, P20, P21...P35.

[0090] S403, arranging the target image at the target position in the first half to obtain the video to be encoded.

[0091] After the images to be encoded captured by the cameras on both sides of the default viewing angle are arranged according to the angle difference, the electronic device can arrange the target image at the target position in the first half to obtain the video to be encoded. If the target image only includes the image to be encoded corresponding to the default viewing angle, the electronic device can arrange the image to be encoded corresponding to the default viewing angle at the target position in the first half, for example, the first position, the second position, etc.

[0092] For example, the arrangement of the images to be encoded after arrangement according to the above steps S401 and S402 is: P17, P16, P15...P1, P19, P20, P21...P35, then the electronic device can place the target image P18 at the target position in the first half, that is, any position between P17-P1, which can be the position corresponding to the first frame, then the arrangement of the video to be encoded is: P18, P17, P16, P15...P1, P19, P20, P21...P35.

[0093] In another case, the target image includes both the image to be encoded corresponding to the default perspective and other images to be encoded adjacent to the image to be encoded corresponding to the default perspective. After the electronic device completes step S401 and step S402, it can arrange the other images to be encoded and the image to be encoded corresponding to the default perspective together at the target position in the first half.

[0094] For example, the arrangement of the images to be encoded after arrangement according to the above steps S401 and S402 is: P17, P16, P15...P1, P19, P20, P21...P35, the target image includes both P18 and P17 and P19, the electronic device can arrange P18, P17 and P19 in the target position in the first half, for example, the first three positions, then the order of the images to be encoded after arrangement is: P18, P17, P19, P16, P15...P1, P20, P21...P35.

[0095] It can be seen that in this embodiment, the electronic device can arrange the images to be encoded taken by the camera on one side of the camera corresponding to the default viewing angle in the first half of all images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle, arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle, arrange the target image at the target position in the first half, and obtain the video to be encoded. By sorting the images to be encoded in this way, the target image can be arranged at the target position in the first half, and the other images to be encoded can be sorted according to the picture differences between the images to be encoded corresponding to the default viewing angle, which can further improve the overall encoding efficiency of the video to be encoded.

[0096] As an implementation manner of an embodiment of the present invention, the step of encoding the video to be encoded to obtain an encoded multi-view video may include:

[0097] According to the arrangement order of the images in the video to be encoded, the images to be encoded are encoded in sequence. When the image to be encoded currently is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded; when the image to be encoded currently is other images to be encoded, the reference frame of the other images to be encoded is determined according to the current encoding standard, and the other images to be encoded are encoded to obtain an encoded multi-view video.

[0098] In the process of encoding the images to be encoded in sequence according to the arrangement order of the images in the above-mentioned video to be encoded, when the currently encoded image to be encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, since the picture difference between the image to be encoded corresponding to the default viewing angle and the image to be encoded is the smallest, the electronic device can use the image to be encoded corresponding to the default viewing angle as a reference frame to encode the image to be encoded, so that the encoding efficiency is higher.

[0099] For different coding standards, the number of reference frames may be different when an electronic device is encoding an image to be encoded. Regardless of which coding standard is used, when the image to be encoded currently is an image to be encoded shot by a camera adjacent to a camera corresponding to a default viewing angle, the reference frames of the image to be encoded currently include the image to be encoded corresponding to the default viewing angle, so as to ensure that the picture difference between the reference frame and the current image to be encoded can be reduced, thereby improving the coding efficiency and coding effect.

[0100] When the currently encoded image to be encoded is another image to be encoded, the electronic device may determine a reference frame of the other image to be encoded according to the current encoding standard, and encode the other image to be encoded to obtain an encoded multi-view video.

[0101] For example, taking the H.265 coding standard as an example, the H.265 coding standard uses one B frame in the coding, that is, during the coding process, a frame to be coded searches for reference blocks in both the coded frames and the frames to be coded. Figure 5 As shown, P1 is an I frame, that is, P1 is encoded with P1 itself as a reference frame, P3 is a P frame, that is, P3 is encoded with P1 as a reference frame, P2 must refer to both the encoded P1 and the encoded P3, P4 must refer to both the encoded P3 and the encoded P5, and so on, until P30 is encoded, thereby obtaining the encoded multi-view video.

[0102] In the solution provided in this embodiment, the process of encoding the video to be encoded is as follows: Figure 6As shown, the image P15 to be encoded corresponding to the default viewing angle is an I frame, that is, P15 is encoded with P15 itself as the reference frame. The reference frames of the image P16 to be encoded and the image P14 to be encoded taken by the camera adjacent to the camera corresponding to the default viewing angle include at least P15, that is, P16 must refer to both the encoded P15 and the encoded P17 as a P frame, and P14 must refer to both the encoded P15 and the encoded P13 as a P frame. For P18-P30 and P12-P1, the reference frame is determined and encoded according to the H.265 encoding standard, that is, P18 must refer to both the encoded P17 and the encoded P19, and so on, thereby obtaining the encoded multi-view video.

[0103] It can be seen that in this embodiment, the electronic device can encode the images to be encoded in sequence according to the arrangement order of the images in the video to be encoded. When the image to be encoded currently is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded. When the image to be encoded currently is other images to be encoded, the reference frame of the other images to be encoded is determined according to the current encoding standard, and the other images to be encoded are encoded to obtain the encoded multi-view video. Since when encoding the video to be encoded, the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame, the difference in the content of the two images is minimal, thereby improving the encoding efficiency.

[0104] As an implementation mode of an embodiment of the present invention, in order to ensure that when encoding an image to be encoded captured by a camera adjacent to a camera corresponding to a default viewing angle, the image to be encoded corresponding to the default viewing angle can be successfully found as a reference frame, the electronic device can always place the image to be encoded corresponding to the default viewing angle in a reference frame queue, and execute any one of the following three methods to ensure that the image to be encoded corresponding to the default viewing angle can be successfully found as a reference frame:

[0105] In the first method, before the step of encoding the image to be encoded corresponding to the default viewing angle as a reference frame, the electronic device can set the image to be encoded corresponding to the default viewing angle as a reference frame with the least encoding code stream bytes corresponding to the image to be encoded.

[0106] Because in some encoding protocols, the reference frame with the least coded bitstream bytes will be determined as the reference frame to be actually used, that is, during encoding, the bytes occupied by the videos encoded based on different reference frames are generally compared, and the reference frame with the least coded bitstream bytes is selected as the reference frame of the current image to be encoded for actual encoding. The reference frame with the least coded bitstream bytes is the image with the smallest difference from the current image to be encoded.

[0107] Therefore, in order to ensure that when encoding the image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle can be successfully found and used as a reference frame, the electronic device can set the image to be encoded corresponding to the default viewing angle to the reference frame with the least encoding code stream bytes corresponding to the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle. In this way, when encoding the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle can be used as a reference frame.

[0108] In a second manner, before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame, the electronic device may place the image to be encoded corresponding to the default viewing angle in the first frame of a reference frame queue.

[0109] Before encoding the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle, the electronic device may place the image to be encoded corresponding to the default viewing angle in the first frame of the reference frame queue. Then, when encoding the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle located in the first frame may be searched first, and then the image to be encoded corresponding to the default viewing angle may be used as a reference frame.

[0110] In the third method, when searching for a reference frame in the reference frame queue, in order to improve the search efficiency, the electronic device can directly search for the image to be encoded corresponding to the default perspective, that is, skip other reference frames except the image to be encoded corresponding to the default perspective, and then find the image to be encoded corresponding to the default perspective, and use the image to be encoded corresponding to the default perspective as the reference frame.

[0111] For example, in the reference frame queue, the image to be encoded corresponding to the default perspective is located in the third frame. When searching for reference frames, the electronic device can directly search for the reference frame located in the third frame, that is, the image to be encoded corresponding to the default perspective. In this way, the image to be encoded corresponding to the default perspective can be quickly found, and the image to be encoded corresponding to the default perspective can be used as a reference frame to encode the image to be encoded.

[0112] It can be seen that in this embodiment, the electronic device can adopt any one of the above three methods to determine the reference frame of the image to be encoded taken by the camera adjacent to the camera corresponding to the default viewing angle. No matter which method is adopted, when encoding the image to be encoded taken by the camera adjacent to the camera corresponding to the default viewing angle, the image to be encoded corresponding to the default viewing angle can be smoothly used as a reference frame to ensure that the video encoding process can be smooth and the effect of improving the encoding efficiency can be achieved.

[0113] As an implementation manner of the embodiment of the present invention, the target image may be an image to be encoded corresponding to a default viewing angle.

[0114] As an implementation manner of the embodiment of the present invention, the target position may be the first frame of all images to be encoded.

[0115] The target image may be the image to be encoded corresponding to the default viewing angle, and the target position may be the first frame of all the images to be encoded. Then, in the video to be encoded, the image to be encoded corresponding to the default viewing angle is arranged in the first frame. When encoding the video to be encoded, the image to be encoded corresponding to the default viewing angle may be encoded as an I frame. Subsequently, when encoding the image to be encoded taken by a camera adjacent to the camera corresponding to the default viewing angle, the first frame image is used as a reference frame, thereby improving the encoding efficiency. At the same time, in the process of decoding and playing the multi-view video, the terminal can first decode and obtain the image to be encoded corresponding to the default viewing angle, so that the display delay can be reduced.

[0116] For example, taking the H.264 encoding standard as an example, Figure 7 As shown in the figure, there are 30 cameras shooting multi-view videos. The images shot by these 30 cameras are P1, P2...P30 respectively. The camera corresponding to the default view angle is the 15th camera, that is, the image to be encoded corresponding to the default view angle is P15. If the target image is P15, the target position is the first frame of all the images to be encoded. At this time, the order of the images to be encoded is: P15, P16,...P30, P14, P13...P1. In the process of encoding the images to be encoded, P15 is an I frame, that is, when encoding P15, P15 itself is used as a reference frame for encoding, P16 is used as a reference frame for encoding, P17 is used as a reference frame for encoding, and so on, until encoding to P30.

[0117] When encoding P14, since P14 is the image to be encoded shot by the camera adjacent to the camera corresponding to the default viewing angle P15, P14 is encoded with P15 as the reference frame. The subsequent P13 is encoded with P14 as the reference frame, and so on until P1 is encoded. In this way, since P15 is an I frame and is encoded with itself as a reference frame, the difference in picture content between P16 and P15 and the difference in picture content between P14 and P15 are both small, and in the entire encoding process, with P14 as a node, P14 is re-encoded with P15 as the reference frame. Compared with the target encoding method of encoding 30 frames of images to be encoded in sequence, the cumulative encoding error can be reduced by half, so the overall encoding efficiency can be improved.

[0118] At the same time, P15 is the first frame of all images to be encoded. Therefore, when the terminal decodes and plays the multi-view video, it can first decode P15. For the target encoding method, the terminal needs to decode the first 15 frames of images in sequence to obtain the image to be encoded corresponding to the default view. The display delay of the default view is greatly reduced.

[0119] Corresponding to the above-mentioned video encoding method, an embodiment of the present invention further provides a video encoding device. The video encoding device provided by the embodiment of the present invention is introduced below.

[0120] like Figure 8 As shown, a video encoding device may include:

[0121] An acquisition module 810 is used to acquire multiple frames of images to be encoded taken at the same time point;

[0122] The multiple frames of images to be encoded are images of different viewing angles corresponding to the same scene.

[0123] An arrangement module 820, used to arrange the target image at a target position in the first half of all the images to be encoded, to obtain a video to be encoded;

[0124] The target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded shot by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold.

[0125] The encoding module 830 is used to encode the video to be encoded to obtain an encoded multi-view video.

[0126] The image to be encoded captured by a camera adjacent to the camera corresponding to the default viewing angle uses the image to be encoded corresponding to the default viewing angle as a reference frame.

[0127] It can be seen that in the scheme provided by the embodiment of the present invention, the electronic device can obtain multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene, and the target image is arranged at the target position of the first half of all the images to be encoded to obtain a video to be encoded, wherein the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, and then, the video to be encoded is encoded to obtain an encoded multi-perspective video, wherein the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame. Since the target image in the video to be encoded is arranged at the target position of the first half of all the images to be encoded, and the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, that is, the difference in picture content between the target image and the remaining images to be encoded is relatively small, when encoding the video to be encoded, the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame, and the difference in picture content between the two is minimal, so the encoding efficiency can be improved.

[0128] As an implementation manner of the embodiment of the present invention, the target image is the image to be encoded corresponding to the default viewing angle;

[0129] The arrangement module 820 may include:

[0130] A first arrangement unit, configured to arrange the images to be encoded taken by the camera on one side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0131] A second arrangement unit, configured to arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle;

[0132] The third arrangement unit is used to arrange the target image at a target position in the first half to obtain a video to be encoded.

[0133] As an implementation of the embodiment of the present invention, the encoding module 830 may include:

[0134] A first encoding unit is used to encode the to-be-encoded images in sequence according to the arrangement order of the images in the to-be-encoded video, and when the to-be-encoded image currently being encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the to-be-encoded image corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded;

[0135] The second encoding unit is used to determine the reference frame of other images to be encoded according to the current encoding standard when the image to be encoded currently is other images to be encoded, and encode the other images to be encoded to obtain the encoded multi-view video.

[0136] As an implementation of the embodiment of the present invention, the encoding module 830 may further include:

[0137] a reference frame setting unit, configured to set the image to be encoded corresponding to the default viewing angle as a reference frame having the least bytes of the encoding code stream corresponding to the image to be encoded, before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame; or

[0138] The reference frame placement unit is used to place the image to be encoded corresponding to the default viewing angle into the first frame of the reference frame queue before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame.

[0139] As an implementation manner of the embodiment of the present invention, the target position may be the first frame of all images to be encoded.

[0140] The embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0141] Memory 903, used for storing computer programs;

[0142] The processor 901 is configured to implement the steps of the video encoding method described in any of the above embodiments when executing the program stored in the memory 903.

[0143] It can be seen that in the scheme provided by the embodiment of the present invention, the electronic device can obtain multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene, and the target image is arranged at the target position of the first half of all the images to be encoded to obtain a video to be encoded, wherein the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, and then, the video to be encoded is encoded to obtain an encoded multi-perspective video, wherein the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame. Since the target image in the video to be encoded is arranged at the target position of the first half of all the images to be encoded, and the target image is the image to be encoded corresponding to the default perspective or the image to be encoded captured by a camera whose angle difference with the camera corresponding to the default perspective is not greater than a preset threshold, that is, the difference in picture content between the target image and the remaining images to be encoded is relatively small, when encoding the video to be encoded, the image to be encoded captured by the camera adjacent to the camera corresponding to the default perspective uses the image to be encoded corresponding to the default perspective as a reference frame, and the difference in picture content between the two is minimal, so the encoding efficiency can be improved.

[0144] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0145] The communication interface is used for communication between the above electronic device and other devices.

[0146] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0148] In another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the video encoding method described in any one of the above embodiments is implemented.

[0149] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the video encoding method described in any one of the above embodiments.

[0150] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0151] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0152] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for a video encoding method, device, electronic device, computer-readable storage medium, and computer program product, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0153] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A video encoding method, characterized in that: The method comprises: Acquire multiple frames of images to be encoded captured at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene; Arranging a target image at a target position in the first half of all images to be encoded to obtain a video to be encoded, wherein the target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded taken by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold; Encoding the video to be encoded to obtain an encoded multi-view video, wherein the image to be encoded captured by a camera adjacent to the camera corresponding to the default view uses the image to be encoded corresponding to the default view as a reference frame; The step of encoding the video to be encoded to obtain an encoded multi-view video includes: According to the arrangement order of the images in the to-be-encoded video, the to-be-encoded images are encoded in sequence, and when the to-be-encoded image currently being encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the to-be-encoded image corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded; When the currently encoded image to be encoded is another image to be encoded, a reference frame of the other image to be encoded is determined according to the current encoding standard, and the other image to be encoded is encoded to obtain an encoded multi-view video.

2. The method according to claim 1, characterized in that The target image is the image to be encoded corresponding to the default viewing angle; The step of arranging the target image at the target position of the first half of all the images to be encoded to obtain the video to be encoded includes: Arrange the images to be encoded taken by the camera on the side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle; Arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle; The target image is arranged at the target position in the first half to obtain the video to be encoded.

3. The method according to claim 1, characterized in that Before the step of encoding the image to be encoded corresponding to the default viewing angle as a reference frame, the method further includes: The image to be encoded corresponding to the default viewing angle is set as the reference frame with the least encoding bitstream bytes corresponding to the image to be encoded; or, The image to be encoded corresponding to the default viewing angle is placed in the first frame of the reference frame queue.

4. The method according to any one of claims 1 to 3, characterized in that: The target position is the first frame of all images to be encoded.

5. A video encoding device, characterized in that: The device comprises: An acquisition module, used to acquire multiple frames of images to be encoded taken at the same time point, wherein the multiple frames of images to be encoded are images of different perspectives corresponding to the same scene; An arrangement module is used to arrange a target image at a target position in the first half of all images to be encoded to obtain a video to be encoded, wherein the target image is an image to be encoded corresponding to a default viewing angle or an image to be encoded taken by a camera whose angle difference with the camera corresponding to the default viewing angle is not greater than a preset threshold; An encoding module, used for encoding the video to be encoded to obtain an encoded multi-view video, wherein the image to be encoded taken by a camera adjacent to the camera corresponding to the default view uses the image to be encoded corresponding to the default view as a reference frame; The encoding module comprises: A first encoding unit is used to encode the to-be-encoded images in sequence according to the arrangement order of the images in the to-be-encoded video, and when the to-be-encoded image currently being encoded is an image to be encoded shot by a camera adjacent to the camera corresponding to the default viewing angle, the to-be-encoded image corresponding to the default viewing angle is used as a reference frame to encode the image to be encoded; The second encoding unit is used to determine the reference frame of other images to be encoded according to the current encoding standard when the image to be encoded currently is other images to be encoded, and encode the other images to be encoded to obtain the encoded multi-view video.

6. The device according to claim 5, characterized in that The target image is the image to be encoded corresponding to the default viewing angle; The arrangement module comprises: A first arrangement unit, configured to arrange the images to be encoded taken by the camera on one side of the camera corresponding to the default viewing angle in the first half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle; A second arrangement unit, configured to arrange the images to be encoded taken by the camera on the other side of the camera corresponding to the default viewing angle in the second half of all the images to be encoded according to the angle difference between the cameras corresponding to the default viewing angle; The third arrangement unit is used to arrange the target image at a target position in the first half to obtain a video to be encoded.

7. The device according to claim 5, characterized in that The encoding module also includes: a reference frame setting unit, configured to set the image to be encoded corresponding to the default viewing angle as a reference frame having the least bytes of the encoding code stream corresponding to the image to be encoded, before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame; or The reference frame placement unit is used to place the image to be encoded corresponding to the default viewing angle into the first frame of the reference frame queue before the step of encoding the image to be encoded using the image to be encoded corresponding to the default viewing angle as a reference frame.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 4 when executing a program stored in a memory.