Video transcoding and video display method, apparatus and electronic device

The video transcoding method adjusts sub-image resolutions to meet user requirements, overcoming limitations of encoder capabilities and achieving desired final resolutions in video screens composed of multiple images.

JP2024545784AActive Publication Date: 2024-12-11HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD

Patent Information

Application Number
JP2024539377
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-12-30
Filing Date
2022-12-16
Publication Date
2024-12-11
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

Existing video processing systems struggle to transcode a video screen composed of multiple video images to achieve a desired resolution that meets user needs, as the resolution after stitching is typically the sum of individual screens, limiting flexibility and compatibility with encoder capabilities.

Method used

A method and apparatus for video transcoding that involves determining initial resolutions for sub-images, encoding each sub-image to a target resolution, and combining them to achieve a final resolution that matches user requirements, while avoiding limitations of encoder maximum input and output resolutions.

Benefits of technology

The method allows for flexible transcoding of video screens, ensuring the final displayed resolution meets user needs and avoids restrictions on encoder capabilities, enabling more efficient use of encoder resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024545784000001_ABST
    Figure 2024545784000001_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a video transcoding and video display method, apparatus and electronic device, which are related to the technical field of video processing. The video transcoding method includes: obtaining a first image of an initial image obtained by splicing together a plurality of video images; determining an initial resolution of each initial sub-image, where each initial resolution is equal to or lower than a maximum resolution of input data that a preset encoder can support, and a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or lower than a maximum resolution of output data that the preset encoder can support; dividing a target image to be divided into each initial sub-image according to each initial resolution; and encoding each initial sub-image according to the target resolution of the target sub-image obtained by transcoding each initial sub-image by the preset encoder to obtain each target bitstream. Compared with the prior art, the application of the technical solution of the embodiments of the present application can realize transcoding of a video image obtained by splicing together a plurality of video images.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202111657026.X and entitled "Video Transcoding and Video Display Method, Apparatus and Electronic Device" filed with the State Intellectual Property Office of the People's Republic of China on December 30, 2021, the entire contents of which are hereby incorporated by reference.

[0002] The present application relates to the field of video processing technology, in particular to a video transcoding and video display method, apparatus and electronic device. [Background technology]

[0003] Currently, in order to display a scenario screen of an area more comprehensively from various angles, multiple video collection devices are installed in the area, and it is desired to completely cover the entire space of the area. Then, in order to display all the video screens of the area simultaneously, the multiple video screens collected by the multiple video collection devices are usually stitched together and the stitched video screen is displayed.

[0004] The resolution of the stitched video image is the sum of the resolutions of the multiple video frames. However, in some cases, a user may wish to display a scene within the stitched video frame at a different resolution. For example, the user may wish to display the stitched video frame at a different resolution. Also, for example, the user may wish to display a portion of the stitched video frame at a different resolution.

[0005] Based on this, how to transcode a video screen that splices together multiple videos so that the resolution of the video screen displayed after decoding meets the needs of users has become an urgent problem to be solved. Summary of the Invention

[0006] The present embodiment aims to provide a video transcoding and video display method, apparatus and electronic device for transcoding a video screen spliced ​​together from multiple video screens, so that the resolution of the video screen displayed after decoding meets the needs of users. The specific technical solutions are as follows:

[0007] In a first aspect, embodiments of the present application provide a method of video transcoding, the method comprising: Obtaining a first image in an initial image sequence obtained by stitching together a plurality of video images; determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image; Dividing the image to be divided into initial sub-images to be transcoded based on initial resolutions; and encoding the initial sub-images by the preset encoder according to a target resolution of the target sub-images obtained by transcoding each initial sub-image to obtain each target bitstream.

[0008] Optionally, in one specific embodiment, the method further comprises: adding a specific information structure to the bitstream information of each target bitstream to obtain each bitstream to be encapsulated; encapsulating each of the bitstreams to be encapsulated and adding the specified information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image; Further includes:

[0009] Optionally, in one specific embodiment, the method further comprises: The method further includes copying a bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device.

[0010] Optionally, in one specific embodiment, determining an initial resolution for each initial sub-image to be transcoded includes: determining a target resolution for each target sub-image after the preset transcoding; For each target resolution, determine an initial resolution corresponding to the target resolution based on a first ratio of the target resolution to the preset resolution and a designated resolution of the first image, and set the initial resolution of the initial sub-image corresponding to the target resolution; Including, A second percentage of the specified resolution that each initial resolution occupies is the same as a first percentage of the preset resolution that the target resolution corresponding to that initial resolution occupies.

[0011] Optionally, in one specific embodiment, dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions includes: The method includes dividing the image to be divided into initial sub-images to be transcoded according to the determined initial resolutions, the sub-images having no overlapping regions.

[0012] Optionally, in one specific embodiment, before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, the method further comprises: increasing each initial resolution that does not satisfy a byte alignment requirement of the preset encoder to a resolution that satisfies the byte alignment requirement to obtain each division resolution; Dividing the first image into initial sub-images to be transcoded based on the initial resolutions includes: Dividing the first image into respective initial sub-images to be transcoded based on respective available resolutions and respective division resolutions, the respective available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including an initial sub-image having an overlapping region; encoding the initial sub-images according to a target resolution of the target sub-images obtained by transcoding each initial sub-image with the preset encoder to obtain each target bitstream; for each initial sub-image whose resolution is an available resolution, encoding the initial sub-image by the preset encoder according to a target resolution of a target sub-image obtained by transcoding the initial sub-image to obtain a target bitstream; For each initial sub-image whose resolution is the sub-resolution, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and adding marks related to designated pixels to bitstream information of the resulting bitstream to obtain a target bitstream; The encoding resolution is the product of a target resolution of a target subimage obtained by transcoding the initial subimage and a specified multiple, the specified multiple being the ratio of the division resolution of the initial subimage to the initial resolution of the initial subimage, and the specified pixels are pixels added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution.

[0013] Optionally, in one specific embodiment, before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, the method further comprises: determining whether a division resolution of the initial sub-image is equal to or less than a maximum resolution of input data that the preset encoder can support, and whether an encoding resolution of the initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support; if the answer is YES, encoding the initial sub-image by the preset encoder according to an encoding resolution of the initial sub-image; If the answer is NO, the method returns to the step of determining the initial resolution of each initial sub-image to be transcoded.

[0014] In a second aspect, an embodiment of the present application provides a method for displaying video. The method comprises: obtaining a respective target bitstream relating to a target image, said target bitstream being obtained according to any of the video transcoding methods according to the first aspect; decoding each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream; and stitching and displaying each of the resulting target sub-images to obtain a target image.

[0015] Optionally, in one specific embodiment, decoding each of the target bitstreams to obtain a transcoded target sub-image corresponding to each of the target bitstreams may include: for each target bitstream, detecting whether a mark for a specified pixel is present in the target bitstream; if the mark exists, decoding the target bitstream, and cropping an image area corresponding to the designated pixel in the image obtained after decoding to obtain a transcoded target sub-image corresponding to the target bitstream; if the mark is not present, decoding the destination bitstream to obtain a transcoded destination sub-picture corresponding to the destination bitstream; Includes.

[0016] In a third aspect, an embodiment of the present application provides a video transcoding apparatus. The apparatus comprises: an image capture module for capturing a first image in an initial image stitched together from a plurality of video images; a resolution determination module for determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that a preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image; an image segmentation module for segmenting the image to be segmented into initial sub-images to be transcoded based on initial resolutions; an image encoding module for encoding each initial sub-image according to a target resolution of a target sub-image obtained by transcoding each initial sub-image by the preset encoder to obtain each target bitstream; Includes.

[0017] Optionally, in one specific embodiment, the device further comprises: The device further includes a bitstream encapsulation module for adding a specific information structure to bitstream information of each target bitstream, obtaining a bitstream of each encapsulation target, encapsulating the bitstream of each encapsulation target, and adding the specific information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image.

[0018] Optionally, in one specific embodiment, the device further comprises: The apparatus further includes a bitstream copy module for copying a bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device.

[0019] Optionally, in one specific embodiment, the resolution determination module specifically includes: determining a target resolution for each target sub-image after the preset transcoding; For each target resolution, determine an initial resolution corresponding to the target resolution based on a first ratio of the target resolution to the preset resolution and a designated resolution of the first image, and set the initial resolution of the initial sub-image corresponding to the target resolution; A second percentage of the specified resolution that each initial resolution occupies is the same as a first percentage of the preset resolution that the target resolution corresponding to that initial resolution occupies.

[0020] Optionally, in one specific embodiment, the image division module is specifically used for dividing the image to be divided into initial sub-images to be transcoded, each of which has no overlapping area, according to each determined initial resolution.

[0021] Optionally, in one specific embodiment, the device further includes a resolution change module for increasing each initial resolution that does not satisfy a byte alignment requirement of the preset encoder to a resolution that satisfies the byte alignment requirement before dividing the image to be divided into each initial sub-image to be transcoded according to each initial resolution, to obtain each division resolution; The image division module is specifically used for dividing the first image into initial sub-images to be transcoded according to available resolutions and division resolutions, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image includes an initial sub-image with an overlapping area; Specifically, the image encoding module: for each initial sub-image whose resolution is an available resolution, encoding the initial sub-image by the preset encoder according to a target resolution of a target sub-image obtained by transcoding the initial sub-image to obtain a target bitstream; For each initial sub-image whose resolution is the sub-resolution, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and adding marks related to designated pixels to bitstream information of the resulting bitstream to obtain a target bitstream; The encoding resolution is the product of a target resolution of a target subimage obtained by transcoding the initial subimage and a specified multiple, the specified multiple being the ratio of the division resolution of the initial subimage to the initial resolution of the initial subimage, and the specified pixels are pixels added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution.

[0022] Optionally, in one specific embodiment, the device further includes a resolution determination module for determining whether the division resolution of the initial sub-image is equal to or less than a maximum resolution of input data that the preset encoder can support and whether the encoding resolution of the initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support before encoding the initial sub-image according to the encoding resolution of the initial sub-image by the preset encoder, and triggering the image encoding module if the judgment result is YES, and triggering the resolution determination module if the judgment result is NO.

[0023] In a fourth aspect, embodiments of the present application provide a video display device comprising: - a bitstream retrieval module for retrieving a respective target bitstream relating to a target image, said target bitstream being obtained according to any of the video transcoding methods according to the first aspect; a bitstream decoding module for decoding each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream; and an image stitching module for stitching and displaying each of the obtained target sub-images to obtain a target image.

[0024] Optionally, in one specific embodiment, the bitstream decoding module specifically comprises: for each target bitstream, detecting whether a mark for a specified pixel is present in the target bitstream; if the mark exists, decoding the target bitstream, and cropping an image area corresponding to the designated pixel in the image obtained after decoding to obtain a transcoded target sub-image corresponding to the target bitstream; If the mark is not present, decoding the target bitstream to obtain a transcoded target sub-picture corresponding to the target bitstream.

[0025] In a fifth aspect, an embodiment of the present application provides an electronic device including a processor, a communication interface, a memory and a communication bus, the processor, the communication interface and the memory communicating with each other via the communication bus, the memory being for storing a computer program, and the processor, when executing the computer program stored in the memory, for realizing steps of any of the video transcoding methods according to the first aspect above and / or steps of any of the video display methods according to the second aspect above.

[0026] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, the computer program being configured to, when executed by a processor, realise steps of any of the video transcoding methods according to the first aspect above and / or steps of any of the video display methods according to the second aspect above.

[0027] In a seventh aspect, an embodiment of the present application provides a computer program product comprising commands which, when executed on a computer, cause the computer to perform steps of any of the video transcoding methods according to the first aspect and / or steps of any of the video display methods according to the second aspect.

[0028] The embodiments of the present application have the following beneficial effects: As can be seen from the above, when applying the technical solutions of the embodiments of the present application, when transcoding a video screen obtained by stitching together multiple video images, an encoder for transcoding can be preset according to user needs, and the maximum resolution of input data and the maximum resolution of output data that can be supported by the preset encoder can be determined.

[0029] In this way, after obtaining an initial image to be transcoded obtained by splicing together a plurality of video images, a first image to be transcoded is obtained from the initial image. Then, an initial resolution of each initial sub-image to be transcoded obtained by dividing the first image is determined. Each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by encoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image. Then, the first image is divided into each initial sub-image to be transcoded based on each initial resolution, and the initial sub-image is encoded by the preset encoder according to a target resolution of the target sub-image obtained by transcoding each initial sub-image to obtain each target bitstream.

[0030] For each initial sub-image, the initial sub-image is encoded according to a target resolution of the target sub-image obtained by transcoding the initial sub-image, so that the resolution of the target sub-image obtained by decoding the target bitstream obtained after encoding is the target resolution. Furthermore, the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, so that the sum of the resolutions of the target sub-images obtained by decoding the target bitstreams is also the preset resolution. In this way, the transcoding of the first image can be realized so that the resolution of the second image displayed after decoding meets the needs of the user.

[0031] In addition, when applying the technical solution according to the embodiment of the present application, the transcoding of the first image is achieved by encoding a plurality of initial sub-images, so that the encoding of the entire first image can be avoided by the maximum resolution of the input data and the maximum resolution of the output data that the preset encoder can support. And the number of the plurality of target sub-images does not have to be equal to the number of the plurality of video images to obtain the initial image by splicing together. This avoids the restriction that the preset resolution of the target image after transcoding must be an integer multiple of the number of the plurality of video images when encoding each of the plurality of video images to obtain the first image by splicing together. In this way, the first image can be transcoded more flexibly.

[0032] Of course, any product or method embodying the present disclosure need not necessarily achieve all of the above advantages simultaneously. [Brief description of the drawings]

[0033] In order to more clearly describe the technical solutions of the embodiments of the present application and the prior art, the drawings necessary for the embodiments and the prior art are briefly described below. The drawings described below are merely according to some of the embodiments of the present application, and it is obvious that a person skilled in the art can obtain other drawings based on these drawings without creative work. [Figure 1]FIG. 1 is a flow diagram of a video transcoding method according to an embodiment of the present application. [Diagram 2] FIG. 2 is a schematic diagram showing an example of splicing together multi-track bitstreams contained in a bitstream of a multi-track stream. [Diagram 3] FIG. 3 is a schematic diagram of the initial resolution of each initial image in one example. [Figure 4] FIG. 4 is a flow diagram of another video transcoding method according to an embodiment of the present application. [Diagram 5] FIG. 5 is a flow diagram of another video transcoding method according to an embodiment of the present application. [Figure 6] FIG. 6 is a flow diagram of another video transcoding method according to an embodiment of the present application. [Figure 7] FIG. 7 is a flow diagram of another video transcoding method according to an embodiment of the present application. [Figure 8] FIG. 8 is a flow diagram of a video display method according to an embodiment of the present application. [Figure 9] FIG. 9 is a schematic diagram of the structure of a video transcoding device according to an embodiment of the present application. [Figure 10] FIG. 10 is a schematic diagram of the structure of a video display device according to an embodiment of the present application. [Figure 11] FIG. 11 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the present application will be described in more detail by giving examples with reference to the drawings. It is clear that the described embodiments are only some of the embodiments of the present application, and are not all of the embodiments. Based on the embodiments of the present application, all other embodiments that a person skilled in the art can obtain without creative labor fall within the scope of protection of the present application.

[0035] In the related art, the resolution of a spliced ​​video image is the sum of the resolutions of multiple video images. However, in some cases, a user may want to display a scene in the spliced ​​video screen with another resolution. For example, the spliced ​​video screen may be displayed with another resolution, or a part of the spliced ​​video screen may be displayed with another resolution. Based on this, how to transcode a video screen spliced ​​from multiple videos so that the resolution of the video screen displayed after decoding meets the needs of the user is currently an issue that needs to be urgently solved.

[0036] To solve the above technical problems, an embodiment of the present application provides a video transcoding method.

[0037] Transcoding refers to the process of decoding a video bitstream and then re-encoding the decoded video bitstream into a bitstream with customized bitstream format or parameters so that the re-encoded bitstream meets the user's requirements, such as network bandwidth limitations and access to a specific platform.

[0038] The method is applicable to any application scenario that requires transcoding images in a video image obtained by stitching together multiple video scenes, such as a factory scenario, a road traffic scenario, etc. The method may be applied to an electronic device that transcodes a video scene to obtain a video bitstream, such as a collection device with an image processing function, a server communicatively connected to the collection device, a display device communicatively connected to the collection device, etc. Based on this, the embodiments of the present application do not specifically limit the application scenario and execution subject of the method.

[0039] A video transcoding method according to an embodiment of the present application includes: acquiring a first image in an initial image sequence obtained by stitching together a plurality of video images; determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image; dividing the image to be divided into initial sub-images to be transcoded based on initial resolutions; encoding the initial sub-images by the preset encoder according to a target resolution of the target sub-images obtained by transcoding each initial sub-image to obtain each target bitstream; Includes.

[0040] As can be seen from the above, when applying the technical solutions of the embodiments of the present application, when transcoding a video screen obtained by stitching together multiple video images, an encoder for transcoding can be preset according to user needs, and the maximum resolution of input data and the maximum resolution of output data that can be supported by this preset encoder can be determined.

[0041] In this way, after obtaining an initial image to be transcoded obtained by splicing together a plurality of video images, a first image to be transcoded is first obtained from the initial image. Furthermore, an initial resolution of each initial sub-image to be transcoded obtained by dividing the first image can be determined, where each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by encoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of each target resolution is a preset resolution of a second image obtained by transcoding the first image. Then, the first image is divided into each initial sub-image to be transcoded based on each initial resolution, and the initial sub-image is encoded by the preset encoder according to a target resolution of the target sub-image obtained by transcoding each initial sub-image to obtain each target bitstream.

[0042] For each initial sub-image, the initial sub-image is encoded according to a target resolution of the target sub-image obtained by transcoding the initial sub-image, so that the resolution of the target sub-image obtained by decoding the target bitstream obtained after encoding is the target resolution. Furthermore, the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, so that the sum of the resolutions of the target sub-images obtained by decoding the target bitstreams is also the preset resolution. In this way, the transcoding of the first image can be realized so that the resolution of the second image displayed after decoding meets the needs of the user.

[0043] In addition, when applying the technical solution according to the embodiment of the present application, the transcoding of the first image is achieved by encoding a plurality of initial sub-images, so that the encoding of the entire first image can be avoided by the maximum resolution of input data and the maximum resolution of output data that the preset encoder can support. And the number of the plurality of target sub-images does not need to be equal to the number of the plurality of video images for obtaining the initial image by splicing, so that the restriction that the preset resolution of the target image after transcoding must be an integer multiple of the number of the plurality of video images when encoding each of the plurality of video images for obtaining the first image by splicing can be avoided. In this way, the first image can be transcoded more flexibly.

[0044] Hereinafter, a video transcoding method according to an embodiment of the present application will be described in detail with reference to the accompanying drawings.

[0045] FIG. 1 is a flow diagram of a video transcoding method according to an embodiment of the present application. As shown in FIG. 1, the method may include the following steps:

[0046] S101: A first image in an initial image obtained by stitching together a plurality of video images is obtained.

[0047] When performing video transcoding, first, an initial image obtained by splicing together a plurality of video images is obtained, and then a first image to be transcoded is obtained from the initial image.

[0048] Here, the first image may be a complete initial image, in which case the initial image is transcoded, or the first image may be a partial image of the initial image, in which case the partial image of the initial image is transcoded.

[0049] A plurality of video acquisition devices may be set, and each video acquisition device may perform video acquisition for its corresponding acquisition area, thereby obtaining a plurality of video bitstreams. Furthermore, after decoding the plurality of video bitstreams, a plurality of video images can be obtained. In this way, the plurality of video images can be stitched together to obtain an initial image, and the resolution of the initial image is the sum of the resolutions of the plurality of video images.

[0050] Optionally, the initial image is obtained by decoding a bitstream of a multi-track stream.

[0051] The bitstream of a multi-track stream refers to a video bitstream consisting of a multi-track video bitstream. Specifically, a multi-track video bitstream is obtained by one physical channel, and the multi-track video bitstream is obtained by performing video image processing on the obtained multi-track video bitstream in the physical channel. In this case, the physical channel may be called a multi-track stream channel.

[0052] That is, the multimedia data collected from multiple multimedia data collection devices may be encapsulated into a multi-track stream, and the bit stream of the multi-track stream includes the multimedia data collected by the multiple multimedia data collection devices at the same timing, and the multimedia data of each multimedia data collection device may be coded separately. The same timing does not necessarily mean that the time is exactly the same, and may allow a preset error.

[0053] For example, multimedia data collected by multiple multimedia data collection devices may be encapsulated into a multi-track stream according to a preset encapsulation protocol, which may include, but is not limited to, RTP (Real-time Transport Protocol).

[0054] Also, for example, the encoded multimedia data of the multiple target multimedia data collection devices may be encapsulated into a multi-track stream according to a preset transmission encapsulation protocol.

[0055] In this way, the video screen corresponding to the bit stream of the multi-track stream is a screen displayed on the same total display surface obtained by seamlessly connecting together video screens corresponding to each of the multi-track video bit streams constituting the bit stream of the multi-track stream. In other words, the initial image is a screen displayed on the same total display surface obtained by seamlessly connecting together video screens corresponding to each of the multi-track video bit streams constituting the bit stream of the multi-track stream.

[0056] Compared with a normal bitstream that corresponds to only one track video bitstream, an MFI (Multiframe Frame Indicator, composite frame information byte) information structure is added to the encapsulation information corresponding to the multi-track stream bitstream and the source bitstream information of each included track bitstream, and the MFI information structure is intended to represent the number of tracks of the video bitstream included in the multi-track stream bitstream, the start and end marks of the video bitstream, and splicing information between video screens corresponding to the video bitstream of each track, etc.

[0057] That is, the MFI information structure may include, but is not limited to, a data packet type identifier, a frame start identifier, a frame end identifier, a composite frame number, and a total number of tracks in the composite frame. For example, the bitstream of a multi-track stream of n tracks is RTP0 header + RTP0 payload + MFI0 + RTP1 header + RTP1 payload + MFI1 + RTPn header + ... + RTPn payload + MFIn.

[0058] Here, the data packet type identifier is for identifying the type of data packet added to the bitstream of the multi-track stream, including but not limited to video data, audio data, or image data, etc. For example, the data packet type identifier may include at least four identification values ​​for respectively identifying video, audio, private frame, etc. Exemplarily, 00 identifies video, 01 identifies audio, 10 identifies private frame, and 11 is left.

[0059] The frame start identifier is for identifying whether a data packet added to a bit stream of a multi-track stream is a frame start data packet, and for example, the frame start identifier includes at least two identification values ​​for identifying whether it is a frame start or not, respectively. Exemplarily, 1 identifies it as a frame start data packet, and 0 identifies it as not a frame start data packet.

[0060] The end-of-frame identifier is for identifying whether a data packet added to a bit stream of a multi-track stream is a data packet of an end-of-frame, and for example, the end-of-frame identifier includes at least two identification values ​​for identifying whether the data packet is an end-of-frame data packet or not an end-of-frame data packet, respectively. Exemplarily, 1 identifies the data packet as an end-of-frame data packet, and 0 identifies the data packet as not an end-of-frame data packet.

[0061] The frame type identifier is for identifying a frame type corresponding to a data packet added to a bitstream of a multi-track stream, for example, a video frame may include, but is not limited to, an I frame, a P frame, or a B frame, etc., so that the frame type identifier may include at least four identification values ​​for respectively identifying an I frame, a P frame, or a B frame when the data packet type is a video. Exemplarily, 00 identifies an I frame, 01 identifies a P frame, 10 identifies a B frame, and 11 remains.

[0062] The composite frame number is used to identify the track (one target multimedia data collection device corresponds to one track) in which the data packet added to the bitstream of the multitrack stream exists.

[0063] The total number of tracks in the composite frame is for identifying how many tracks of data (ie, multimedia data of several target multimedia data collection devices) are added to the bit stream of the multi-track stream.

[0064] A sub-video screen corresponding to a video bitstream of each track in a video screen corresponding to a bitstream of a multi-track stream may be called a respective track screen. Correspondingly, a sub-video screen corresponding to a video bitstream of an Nth track in a video screen corresponding to a bitstream of a multi-track stream may be called an Nth track screen.

[0065] In addition, for a video screen corresponding to a multi-track stream bitstream, the resolution of the video screen is the sum of the resolutions of the video screens corresponding to the multi-track video bitstreams constituting the video screen. Based on this, if a video screen with a high resolution needs to be used in practical applications, it can be realized by the multi-track stream bitstream. And, as the number of tracks of the video bitstream corresponding to the multi-track stream bitstream increases, the resolution of the video screen corresponding to the multi-track stream channel can be infinitely increased.

[0066] For a video screen corresponding to a bitstream of a multi-track stream, the sizes of the video screens corresponding to the video bitstreams of the individual tracks in the video screen may be the same or different.

[0067] As shown in Fig. 2, when splicing together a video screen corresponding to a bitstream of a multi-track stream, first obtain a bitstream of a video screen of the latest one frame of the bitstream of the multi-track stream, and the bitstream of the video screen of the latest one frame is a continuous bitstream of multiple tracks including an MFI information structure. Here, TI in the MFI information structure represents the total number of tracks included in the bitstream of the multi-track stream, and N in the MFI information structure represents that the current bitstream is the bitstream of the Nth track in the bitstream of the multi-track stream. Thus, the process of decoding and splicing together the bitstream of a video screen of the latest one frame of the bitstream of the multi-track stream may include the following steps:

[0068] Step 1: Obtain the width and height of the video screen corresponding to each track bitstream from the frame information of the video screen of this frame.

[0069] Step 2: For each track bitstream included in the bitstream of the multi-track stream, a frame buffer area Pool is allocated to store data obtained by decoding each track bitstream. For example, if the resolution of a video screen corresponding to the bitstream of the multi-track stream is width W and height H, the allocated frame buffer area Pool has width W and height H.

[0070] Step 3: The frame buffer area Pool is equally divided into TI sub-buffer areas pool[1] to pool[TI], and each sub-buffer area has a width of W / TI and a height of H. The base addresses of the TI sub-buffer areas, pool[0] to pool[TI-1], are recorded.

[0071] Step 4: Each track bitstream included in the bitstream of the multi-track stream is decoded in sequence. If the current bitstream is the first track bitstream in the bitstream of the multi-track stream, i.e., N=1, starting from the base address addr[0] of the first sub-buffer area pool[1], the YUV data obtained by decoded the first track bitstream is stored in the frame buffer area Pool. Furthermore, the YUV data obtained by decoded each track bitstream included in the bitstream of the multi-track stream is stored in sequence in the frame buffer area Pool at the base addresses addr[0] to addr[TI-1] of TI sub-buffer areas pool[1] to pool[T1], respectively. Here, the YUV data obtained by decoded each track bitstream is YUV data with a width of W / TI and a height of H.

[0072] In YUV data, Y represents brightness (Luminance, Luma), and U and V represent chromaticity and density (Chrominance, Chroma), respectively.

[0073] Each sub-buffer area may be called a sub-display surface. That is, in the bitstream of a multi-track stream, the video screen obtained by decoding each track bitstream is cached on the sub-display surface assigned to the track bitstream, and the resolution of the sub-display surface is the same as the resolution of the video screen obtained by decoding the track bitstream.

[0074] Step 5: The bitstream of the TI-th track included in the bitstream of the multi-track stream is obtained by decoding, that is, when N=TI, the YUV data obtained by decoded all the track bitstreams included in the bitstream of the multi-track stream to obtain the latest one frame of video screen by splicing them is stored in the frame buffer area Pool. At this time, the decoding and splicing of the bitstream of the multi-track stream is completed.

[0075] Up to now, the most recent video image of a frame that has been decoded and stitched together can be displayed on the same overall display surface, and can then be used for subsequent video image processing, such as display, transmission, and storage.

[0076] That is, the video images cached on each of the sub-display surfaces are cached on the same total display surface, and the resolution of the total display surface is the sum of the resolutions of all the sub-display surfaces, i.e., the resolution of the total display surface is the sum of the resolutions of the video screens corresponding to each track bitstream included in the bitstream of the multi-track stream.

[0077] When displayed on the total display surface, the video screen on one display surface displayed for a display window corresponds to the display window displaying one video screen, but the display process is not performed according to the method of displaying multiple video screens, so there is no splicing slit. As shown in Figure 2, the two vertical lines are specially added to illustrate the video screen corresponding to the multi-track stream, but the two lines do not exist when displayed in actual application.

[0078] 2, the arrangement method of the video screens corresponding to each track bitstream is merely an example of a splicing method of the video screens corresponding to each track bitstream included in the bitstream of the multi-track stream, and is not limited thereto. In each embodiment, the video screens corresponding to each track bitstream included in the bitstream of the multi-track stream may be spliced ​​using various other methods.

[0079] The position of each sub-display surface in the total display surface is determined based on the positional relationship of the video screen corresponding to each track bit stream contained in the bit stream of the multi-track stream acquired in advance, and for each sub-display surface, the video image of that sub-display surface is cached at the position of that sub-display surface in the total display surface that it corresponds to.

[0080] For example, the positional relationship of the video screen corresponding to each track bitstream included in the bitstream of the multi-track stream may be consistent with the positional relationship of the multimedia data collection device that collects each track bitstream. For example, when the collection device 1 is located at the leftmost position, the position of the sub-display surface on which the video screen corresponding to the first track bitstream collected by the multimedia data collection device 1 is located may be the leftmost position on the total display surface.

[0081] For example, a user may receive a position setting command set according to the needs of an actual application, and read the position of the video screen corresponding to each track bitstream included in the bitstream of the multi-track stream in the position setting command on the total display surface. Exemplarily, the position setting command may include the following information: According to the number of each track bitstream, perform vertical splicing for the video screen corresponding to each track bitstream; According to the number of each track bitstream, perform horizontal splicing for the video screen corresponding to each track bitstream.

[0082] In addition, since there may be an overlapping range between the collection ranges of the multimedia data collection devices that collect each track bitstream, there may be an overlapping area between the video screens obtained by decoding each track bitstream. Therefore, the position information of the overlapping range between the collection ranges of each multimedia data collection device is acquired in advance, and each track bitstream is decoded to acquire a video screen, and then the overlapping area in the acquired video screen is first cut out according to the position information, and the cut-out video screen is cached on each sub-display surface. In other words, the video screens cached in each sub-buffer area are screens that do not have an overlapping area therebetween. That is, in the above steps 1 to 5, the video screens corresponding to each track bitstream are screens that do not have an overlapping area therebetween.

[0083] S102: Determine an initial resolution for each initial sub-image to be transcoded.

[0084] Here, each initial resolution is equal to or less than the maximum resolution of input data that the preset encoder can support, the target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than the maximum resolution of output data that the preset encoder can support, and the sum of each target resolution is the preset resolution of a second image obtained by transcoding a first image.

[0085] When transcoding the first image, a preset encoder for encoding the first image can be determined in advance, and the maximum resolution of input data that the preset encoder can support and the maximum resolution of output data that the preset encoder can support can be obtained.

[0086] When transcoding the first image, the resulting transcoded bitstream consists of multiple bitstreams, each of which is obtained by encoding one initial sub-image to be transcoded by the preset encoder, and each initial sub-image to be transcoded is one sub-image of the first image.

[0087] Therefore, after obtaining the first image, an initial resolution of each initial sub-image to be transcoded can be further determined, such as dividing the first image to obtain each initial sub-image to be transcoded.

[0088] Taking into account the limitations of the preset encoder on the resolution of the input data, each determined initial resolution is equal to or less than the maximum resolution of the input data that the preset encoder can support, and the image stitched together from each initial sub-image includes all image areas of the first image.

[0089] Optionally, the initial resolution of each initial sub-image may be preset.

[0090] Optionally, the initial resolution of each initial sub-image may be determined based on the number of preset initial sub-images and the designated resolution of the first image, for example by assigning the designated resolution of the first image to each initial sub-image on average, so that each initial sub-image has the same initial resolution, and the target resolution of each target sub-image is also the same.

[0091] Optionally, an initial resolution of each initial sub-image may be determined based on a target resolution of a target sub-image obtained by transcoding each preset image and a preset resolution of a second image obtained by transcoding the first image.

[0092] The second image is obtained by transcoding the first image, and the second image is obtained by splicing together the target sub-images obtained by transcoding each initial sub-image, that is, for each initial sub-image, the encoder encodes the initial sub-image to obtain a bitstream, and then decodes the bitstream to transcode the initial sub-image to obtain a target sub-image, and the resolution of the target sub-image must satisfy the preset encoder's limit on the resolution of the output data.

[0093] Based on this, considering the limitation of the preset encoder on the resolution of the output data, the target resolution of the target sub-image obtained by transcoding each initial sub-image is equal to or less than the maximum resolution of the output data that the preset encoder can support, and the second image obtained by transcoding the first image is obtained by splicing together the target sub-images, so the resolution of the image obtained by splicing together the target sub-images is the preset resolution of the second image obtained by transcoding the first image, and the sum of the resolutions is the preset resolution of the second image obtained by transcoding the first image.

[0094] Here, the preset resolution of the second image is the resolution of the second image desired by the user when transcoding the first image to obtain a bitstream, and then decoding the bitstream to obtain the transcoded second image.

[0095] For example, if the resolution of the first image is DW in width and DH in height, and the first image is transcoded to obtain a bitstream, and then the bitstream is decoded to obtain a transcoded second image, the resolution of the second image desired by the user is W0 in width and H0 in height, then the preset resolution of the second image is W0 in width and H0 in height.

[0096] Optionally, the preset resolution of the second image may be greater than, less than, or equal to the designated resolution of the first image, i.e., the scale of the second image after transcoding with respect to the first image to be transcoded can be achieved depending on the magnitude of the preset resolution of the second image and the designated resolution of the first image.

[0097] When the preset resolution of the second image is greater than the specified resolution of the first image, an image enlargement of the second image after transcoding is achieved with respect to the first image to be transcoded, and when the preset resolution of the second image is smaller than the specified resolution of the first image, an image reduction of the second image after transcoding is achieved with respect to the first image to be transcoded.

[0098] The preset resolution of the second image and the number of the initial sub-images may be set by the user according to the needs of actual application, but are not specifically limited in the embodiment of the present application. For example, the specified number may be 2, 3, etc.

[0099] Optionally, in one specific embodiment, the above step S102 may include the following steps 11-12.

[0100] Step 11: Determine the target resolution of each target sub-image after the preset transcoding.

[0101] Step 12: For each target resolution, determine an initial resolution corresponding to the target resolution based on a first proportion of the target resolution to the preset resolution and the specified resolution of the first image, and set it as the initial resolution of the initial sub-image corresponding to the target resolution.

[0102] The second proportion of the specified resolution that each initial resolution occupies is the same as the first proportion of the preset resolution that the target resolution that corresponds to that initial resolution occupies.

[0103] In this particular embodiment, each destination sub-image is scaled in the same proportion with respect to the corresponding initial sub-image to achieve the scaling of the second transcoded image with respect to the first image to be transcoded.

[0104] That is, the ratio of the initial resolution of each initial sub-image to the target resolution obtained by transcoding the initial sub-image is the same. Thus, when the sum of the initial resolutions of each initial sub-image is the specified resolution of the first image, the proportion of the initial resolution of each initial sub-image in the specified resolution is the same as the proportion of the target resolution obtained by transcoding the initial sub-image in the preset resolution of the second image.

[0105] When transcoding the first image, the user may set a target resolution for each target sub-image of the second image obtained by transcoding the first images obtained by splicing the first images together, i.e., determine the resolution of each target sub-image desired by the user.

[0106] In this manner, when determining the initial resolution of each initial sub-image, the target resolution of each destination sub-image after preset transcoding may be determined first.

[0107] Furthermore, for each determined target resolution, an initial resolution corresponding to the target resolution is determined based on a first proportion that the target resolution occupies in the preset resolution and the specified resolution of the first image, and the initial resolution of each initial sub-image to be transcoded is obtained as the initial resolution of the initial sub-image corresponding to the target resolution.

[0108] A second percentage of the initial resolution of the first image is equal to a first percentage of the target resolution of the second image, the target resolution of each initial resolution being a target resolution of a target sub-image obtained by transcoding the initial sub-image.

[0109] That is, the second proportion of the initial resolution in the specified resolution of the first image is the same as the first proportion of the target resolution of the target sub-image obtained by transcoding the initial resolution in the preset resolution of the second image.

[0110] Optionally, for each determined target resolution, a first proportion of the preset resolution that the target resolution occupies is calculated, and the product of the first proportion and the specified resolution of the first image is calculated, and the product is used as the initial resolution of the initial sub-image corresponding to the target resolution.

[0111] For example, the specified resolution of the first image is width DW and height DH, the preset resolution of the second image is width (W6+W7) and height H6, there are two target sub-images, and the target resolutions of the two target sub-images are width W6 and height H6, and width W7 and height H6, respectively. Then, the initial resolutions of the two initial sub-images can be determined to be width W6 / (W6+W7)*DW and height DH, and width W7 / (W6+W7)*DW and height DH, respectively.

[0112] Of course, the above step S102 may be performed in other ways, but the embodiment of the present application is not specifically limited thereto.

[0113] For example, each initial resolution is equal to or less than the maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than the maximum resolution of output data that the preset encoder can support, and the sum of the target resolutions is equal to or less than the preset resolution of the second image obtained by transcoding the first image, and the initial resolution of each initial sub-image is randomly determined. At this time, the initial resolutions of each determined initial sub-image do not need to be completely the same, thereby realizing irregular division of the first image.

[0114] For example, as shown in FIG. 3, if the specified resolution of the first image is width DW and height DH, and the number of each initial sub-image is 5, the initial resolution of the determined initial sub-image 1 is width W1 and height H1, the initial resolution of the initial sub-image 2 is width W2 and height H1, the initial resolution of the initial sub-image 3 is width W3 and height H1, the initial resolution of the initial sub-image 4 is width W4 and height H4, and the initial resolution of the initial sub-image 5 is width W5 and height H4.

[0115] S103: Divide the first image into initial sub-images to be transcoded based on the initial resolutions.

[0116] After obtaining the initial resolution of each of the initial sub-images, divide the initial image into a specified number of initial sub-images based on each of the initial resolutions.

[0117] Optionally, in one specific embodiment, the above step S103 may include the following step S21.

[0118] Step 21: Divide the image to be divided into initial sub-images to be transcoded according to the determined initial resolutions, each of which has no overlapping area.

[0119] In this specific embodiment, after obtaining the initial resolution of each of the initial sub-images, the image to be divided is divided into initial sub-images to be transcoded according to the determined initial resolutions, each of which has no overlapping area.

[0120] Since there is no overlapping area between each initial sub-image, and each initial sub-image may include all image areas of the first image, the sum of the initial resolutions of each initial sub-image is the specified resolution of the first image.

[0121] For example, as shown in FIG. 3, the first image is divided into five initial sub-images according to the determined initial resolutions of initial sub-images 1 to 5.

[0122] S104: Encode each initial sub-image according to a target resolution of a target sub-image corresponding to each initial sub-image by a preset encoder to obtain each target bitstream.

[0123] After each initial sub-image is obtained, for each initial sub-image, a preset encoder encodes the initial sub-image according to a target resolution of a target sub-image corresponding to the initial sub-image to obtain a target bitstream for the initial sub-image.

[0124] For each initial subpicture, after decoding the resulting target bitstream for that initial subpicture, the resolution of the resulting target subpicture is the target resolution of the target subpicture obtained by transcoding that initial subpicture.

[0125] In this way, after encoding each of the initial sub-images, each target bitstream is obtained, that is, the number of the obtained target bitstreams is the same as the number of the initial sub-images.

[0126] For example, the specified resolution of the first image is width DW and height DH, and the first image is divided to obtain an initial sub-image a having an initial resolution of width W6 / (W6+W7)*DW and height DH, and an initial sub-image b having an initial resolution of width W7 / (W6+W7)*DW and height DH. The preset resolution of the second image is width (W6+W7) and height H6, and the target resolution of the target sub-image obtained by transcoding the initial sub-image a is width W6 and height DH, and the target resolution of the target sub-image obtained by transcoding the initial sub-image b is width W7 and height DH.

[0127] In this way, the initial sub-image a having a resolution of width W6 / (W6+W7)*DW and height DH is encoded by the preset encoder according to a target resolution of width W6 and height DH to obtain a target bitstream, and the initial sub-image b having a resolution of width W7 / (W6+W7)*DW and height DH is encoded by the preset encoder according to a target resolution of width W7 and height DH to obtain a target bitstream.

[0128] After obtaining each of the target bitstreams, the subsequent processes of decoding, displaying, transmitting, storing, etc. are performed on each of the target bitstreams.

[0129] Optionally, in one specific embodiment, as shown in FIG. 4, the video transcoding method according to the embodiment of the present application may further include the following steps S105 to S106.

[0130] S105: Add a specific information structure to the bitstream information of each target bitstream to obtain each bitstream to be encapsulated.

[0131] S106: Encapsulate each bitstream to be encapsulated, and add a designated information structure to the encapsulation information to obtain a bitstream of a multi-track stream related to the first image.

[0132] In this specific embodiment, after obtaining each of the target bitstreams, each of the target bitstreams may be converted into a bitstream of a multi-track stream, and the number of tracks included in the bitstream of the multi-track stream is the number of each of the target bitstreams.

[0133] In this way, after obtaining each of the target bitstreams, a designated information structure is added to the bitstream information of each of the target bitstreams to obtain a plurality of bitstreams to be encapsulated. Each target bitstream is regarded as a source bitstream of each track in the bitstream of the multi-track stream, and a designated information structure is added to the bitstream information of each of the target bitstreams to obtain a plurality of bitstreams to be encapsulated, i.e., a designated information structure is added to the source bitstream information of the bitstream of each track to obtain the source bitstream of each encapsulation. Furthermore, each of the bitstreams to be encapsulated is encapsulated, and a designated information structure is added to the generated encapsulation information to obtain the bitstream of the multi-track stream related to the first image. The designated information structure is an MFI information structure.

[0134] Optionally, in one specific embodiment, as shown in FIG. 5, the video transcoding method according to the embodiment of the present application may further include the following step S107.

[0135] S107: Copy the bitstream of the multi-track stream, and transmit the resulting bitstream of the multiple multi-track streams to a designated device.

[0136] In this specific embodiment, after obtaining the bitstream of the multi-track stream related to the first image, since multiple users may want to obtain the bitstream of the multi-track stream, the bitstream of the multi-track stream is copied, and the bitstreams of the multiple multi-track streams obtained by copying are transmitted to a designated device. The bitstreams of the multiple multi-track streams obtained by copying may be transmitted to the same designated device, or the bitstreams of the multiple multi-track streams may be transmitted to different designated devices. This is reasonable.

[0137] As can be seen from the above, when applying the technical solution provided in the embodiment of the present application, when transcoding a video screen obtained by splicing together a plurality of video images, for each initial sub-image, the initial sub-image is encoded according to the target resolution of the target sub-image obtained by transcoding the initial sub-image, so that after the target bitstream obtained after encoding is decoded, the resolution of the target sub-image obtained is the target resolution. Furthermore, the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, so that after the target bitstream is decoded, the sum of the resolutions of the target sub-images obtained is also the preset resolution. In this way, the transcoding of the first image is realized, and the resolution of the second image displayed after decoding meets the needs of users.

[0138] In addition, when applying the technical solution according to the embodiment of the present application, the transcoding of the first image is achieved by encoding a plurality of initial sub-images, so that the encoding of the entire first image can be avoided by the maximum resolution of the input data and the maximum resolution of the output data that the preset encoder can support. And the number of the plurality of target sub-images does not need to be equal to the number of the plurality of video images in the initial image obtained by splicing, so that the restriction that the preset resolution of the target image after transcoding must be an integer multiple of the number of the plurality of video images can be avoided when encoding each of the plurality of video images for obtaining the first image by splicing them. In this way, the first image can be transcoded more flexibly.

[0139] Typically, the encoder requires that the resolution of the input data is byte-aligned, i.e. the encoder can only encode initial sub-images whose initial resolution meets the byte-alignment requirement.

[0140] For example, if an encoder requires n-byte alignment, then the encoder can only encode initial sub-images whose initial resolution is a multiple of n.

[0141] Based on this, optionally, in one specific embodiment, as shown in FIG. 6, the video transcoding method according to the embodiment of the present application may further include the following step S108.

[0142] S108: Each initial resolution that does not satisfy the byte alignment requirement of the preset encoder is increased to a resolution that satisfies the byte alignment requirement to obtain each divided resolution.

[0143] In this specific embodiment, after obtaining the initial resolution of each initial sub-image, for each initial resolution, it may be determined whether the initial resolution satisfies the byte alignment requirement of the preset encoder.

[0144] If it is determined that the initial resolution does not satisfy the byte alignment requirement, the initial resolution may be subjected to byte filling, i.e., the initial resolution is increased to a resolution that satisfies the byte alignment requirement, and the resolution obtained by the byte filling is set as the division resolution of the initial sub-image.

[0145] Optionally, if it is determined that the initial resolution does not satisfy the byte alignment requirement, the initial resolution may be increased to a resolution that is minimally different from the initial resolution and that satisfies the byte alignment requirement.

[0146] For example, if a preset encoder requires 8-byte alignment and an initial resolution has a width of 15 and a height of 16, the initial resolution is increased to a width of 16 and a height of 16 to obtain a split resolution.

[0147] In this way, after obtaining the initial resolution of each initial sub-image, each initial resolution that does not satisfy the byte alignment requirement of the preset encoder is increased to a resolution that satisfies the byte alignment requirement to obtain each division resolution.

[0148] Correspondingly, in this specific embodiment, in the above step S103, the first image is divided into initial sub-images to be transcoded according to the respective initial resolutions, and the above step S103 may include the following step S1031:

[0149] S1031: Divide a first image into initial sub-images to be transcoded based on each available resolution and each division resolution.

[0150] Here, the available resolutions are initial resolutions that satisfy byte alignment requirements, and each initial sub-image includes initial sub-images where overlapping regions exist.

[0151] The initial resolution that satisfies the byte alignment requirement of the preset encoder at the initial resolution of each initial sub-image may be set as an available resolution. After obtaining each of the division resolutions, the first image is divided into each of the initial sub-images to be transcoded based on each of the available resolutions and each of the division resolutions.

[0152] The sum of the initial resolutions of the initial sub-images is the designated resolution of the first image, and each division resolution is obtained by increasing the initial resolution, so that the sum of the available resolutions and the division resolutions is greater than the designated resolution of the first image. Furthermore, when dividing the first image into initial sub-images to be transcoded according to the available resolutions and the division resolutions, each of the obtained initial sub-images includes all image areas of the first image, and the resolution of the image obtained by stitching the obtained initial sub-images is greater than the resolution of the first image. That is, when the size of the image obtained by stitching the obtained initial sub-images is greater than the size of the first image, each of the obtained initial sub-images includes initial sub-images with overlapping areas.

[0153] Correspondingly, in this specific embodiment, in the above step S104, the preset encoder encodes each initial sub-image according to the target resolution of the target sub-image corresponding to each initial sub-image to obtain each target bitstream, and the above step S104 may include the following steps S1041 to S1042.

[0154] S1041: For each initial sub-image whose resolution is an available resolution, encode the initial sub-image by a preset encoder according to a target resolution of a target sub-image corresponding to the initial sub-image to obtain a target bitstream.

[0155] S1042: For each initial sub-image whose resolution is the sub-resolution, the initial sub-image is encoded by a preset encoder according to the encoding resolution of the initial sub-image, and a mark related to a designated pixel is added to the bitstream information of the obtained bitstream to obtain a target bitstream.

[0156] The encoding resolution is the product of the target resolution of the target subimage obtained by transcoding the initial subimage and a specified multiple, where the specified multiple is the ratio of the division resolution of the initial subimage to the initial resolution of the initial subimage, and the specified pixels are the pixels added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution.

[0157] In this particular embodiment, for each initial sub-image, it may first be determined whether the resolution of the initial sub-image is an available resolution that satisfies the byte alignment requirement, or a sub-resolution that can be obtained by increasing the initial resolution.

[0158] Thus, for each initial sub-image whose resolution is an available resolution, the preset encoder encodes the initial sub-image according to the target resolution of the target sub-image corresponding to the initial sub-image to obtain a target bitstream.

[0159] For each initial sub-image whose resolution is a divided resolution, the image area consisting of partial pixels in the initial sub-image is obtained by increasing the initial resolution of the initial sub-image, so that when the initial sub-image is encoded by the preset encoder, the encoding resolution to be used as the basis is obtained by increasing the target resolution of the target sub-image obtained by transcoding the initial sub-image.

[0160] For the sake of convenience, a bitstream obtained by encoding each initial sub-image, whose resolution is the division resolution, according to the target resolution of a target sub-image obtained by transcoding the initial sub-image is called a reference bitstream, and an image obtained by decoding the reference bitstream is called a reference image. The initial sub-image is encoded according to the encoding resolution to obtain a target bitstream, and an image obtained by decoding the target bitstream is a target sub-image obtained by transcoding the initial sub-image. Since the encoding resolution is obtained by increasing the target resolution, an image area obtained by increasing the reference image exists in the target sub-image. When the target sub-images are joined together to obtain the second image, it is necessary to overlap the image area obtained by increasing the image area in the target sub-image with another target sub-image including the image area, or to cut out the image area.

[0161] Based on this, for each initial sub-image whose resolution is the division resolution, the preset encoder determines an encoding resolution to be used when encoding the initial sub-image, i.e., determines the encoding resolution of the initial sub-image.

[0162] The encoding resolution is the product of a target resolution of a target sub-image obtained by transcoding the initial sub-image and a designated multiple, and the designated multiple is the ratio between the division resolution of the initial sub-image and the division resolution of the initial sub-image.

[0163] Optionally, for each initial sub-image whose resolution is a division resolution, first calculate a ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and then calculate the product of the ratio and a target resolution of a target sub-image obtained by transcoding the initial sub-image to obtain an encoding resolution.

[0164] For each initial sub-image whose resolution is the division resolution, after determining the encoding resolution of the initial sub-image, the initial sub-image may be encoded by the preset encoder according to the encoding resolution, and then a mark related to a designated pixel may be added to the bitstream information of the bitstream obtained after encoding to obtain a target bitstream, so as to make it easier to overlap or cut out the image area of ​​the enlarged target sub-image obtained by enlarging the subsequent initial sub-image.

[0165] The designated pixels are pixels that are added to a destination subimage obtained by transcoding the initial subimage when the target resolution of the destination subimage obtained by transcoding the initial subimage is increased to the encoding resolution.

[0166] That is, the designated pixel is understood to be a pixel that corresponds to the difference between the encoding resolution of the initial sub-image and the target resolution of the target sub-image obtained by transcoding the initial sub-image.

[0167] Optionally, the mark for the designated pixel may be the difference between the encoding resolution of the initial sub-image and the target resolution of the target sub-image resulting from transcoding the initial sub-image.

[0168] For example, if the preset encoder requires 8-byte alignment, and the initial resolution of an initial sub-image is 15 in width and 16 in height, and the target resolution of the target sub-image obtained by transcoding the initial sub-image is W8 in width and H8 in height, the initial resolution is increased to 16 in width and 16 in height to obtain a division resolution, and then divided according to the divider resolution to obtain an initial sub-image. Based on this, when transcoding the initial sub-image, the encoding resolution of the initial sub-image is first determined to be W8*16 / 15 in width and H8 in height. The preset encoder encodes the initial sub-image according to the encoding resolution of W8*16 / 15 in width and H8 in height, and adds a mark for a specified pixel to the obtained bitstream to obtain a target bitstream.

[0169] The specified pixel is a pixel added to the target sub-image when the width of the target resolution, which has width W8 and height H8, is increased to an encoding resolution, which has width W8*16 / 15 and height H8, so that if the resolution of the image region consisting of the specified pixel is width W8*16 / 15-W8 and height H8, then the mark for the added specified pixel may be W8*16 / 15-W8.

[0170] For each initial sub-image whose resolution is the split resolution, the split resolution used when obtaining the initial sub-image by splitting is greater than the determined initial resolution of the initial sub-image, and the encoding resolution used when encoding the initial sub-image is greater than the target resolution of the target sub-image obtained by transcoding the initial sub-image. Therefore, before encoding the initial sub-image, it is first necessary to determine whether the split resolution of the initial sub-image meets the resolution limit of the preset encoder for the input data, and whether the encoding resolution of the initial sub-image meets the resolution limit of the preset encoder for the output data.

[0171] Based on this, optionally, in one specific embodiment, as shown in FIG. 7, the video transcoding method according to the embodiment of the present application may further include the following step S109.

[0172] S109: Determine whether the division resolution of the initial sub-image is equal to or less than the maximum resolution of input data that the preset encoder can support, and whether the encoding resolution of the initial sub-image is equal to or less than the maximum resolution of output data that the preset encoder can support. If the result of the determination is YES, execute the above step S1042. If the result of the determination is NO, return to the above step S102.

[0173] In this specific embodiment, for each initial sub-image whose resolution is the division resolution, after obtaining the initial sub-image whose resolution is the division resolution by division and determining the encoding resolution of the initial sub-image, it may first be determined whether the division resolution of the initial sub-image is less than or equal to the maximum resolution of input data that the preset encoder can support, and whether the encoding resolution of the initial sub-image is less than or equal to the maximum resolution of output data that the preset encoder can support.

[0174] When it is determined that the division resolution of the initial sub-image is equal to or less than the maximum resolution of input data that the preset encoder can support, and the encoding resolution of the initial sub-image is equal to or less than the maximum resolution of output data that the preset encoder can support, the preset encoder then encodes the initial sub-image according to the encoding resolution of the initial sub-image, and adds a mark related to a specified pixel to the bitstream information of the obtained bitstream to obtain a target bitstream.

[0175] Correspondingly, when it is determined that the division resolution of the initial sub-image is not equal to or less than the maximum resolution of input data that the preset encoder can support, and / or the encoding resolution of the initial sub-image is not equal to or less than the maximum resolution of output data that the preset encoder can support, the division resolution of the initial sub-image does not satisfy the resolution limit of the preset encoder for the input data, and / or the encoding resolution of the initial sub-image does not satisfy the resolution limit of the preset encoder for the input data, so that the preset encoder cannot encode the initial sub-image. Thus, by newly determining the initial resolution of each initial sub-image, the subsequent video transcoding method can be performed according to the newly determined initial resolution of each initial sub-image.

[0176] Corresponding to the above-mentioned video transcoding method according to the embodiment of the present application, the embodiment of the present application further provides a video display method.

[0177] The method is applicable to any application scenario of a stitched video image obtained by stitching together multiple video frames, such as a factory scenario, a road traffic scenario, etc. The method may be applied to an electronic device that stitches together and displays multiple video frames, such as a collection device with an image processing function, a server communicatively connected to the collection device, a display device communicatively connected to the collection device, etc. Based on this, the embodiments of the present application do not specifically limit the application scenario and execution subject of the method.

[0178] The execution entity of the video transcoding method according to the embodiment of the present application and the execution entity of the video display method according to the embodiment of the present application may be the same or different.

[0179] FIG. 8 is a flow diagram of a video display method according to an embodiment of the present application. As shown in FIG. 8, the method may include the following steps:

[0180] S901: Obtain each target bitstream for a target image.

[0181] Each target bitstream is obtained based on any of the video transcoding methods according to the embodiments of the present application described above.

[0182] S902: Decode each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream.

[0183] Optionally, in one specific embodiment, the above step S902 may include the following steps 31 to 33.

[0184] Step 31: For each target bitstream, detect whether the target bitstream has a mark for the designated pixel; if the mark exists, execute step 32; if the mark does not exist, execute step 33.

[0185] Step 32: Decode the target bitstream, and crop an image area corresponding to the designated pixel in the image obtained after decoding to obtain a transcoded target sub-image corresponding to the target bitstream.

[0186] Step 33: Decode the target bitstream to obtain a transcoded target sub-picture corresponding to the target bitstream.

[0187] In this specific embodiment, for a target bitstream, which may be obtained by encoding according to the specified resolution, an image obtained by decoding the target bitstream has an image area that needs to be overlapped or clipped to another target sub-image containing the image area, and marks are added to the target bitstream for designated pixels that will be increased in the target sub-image corresponding to the initial sub-image when the target resolution of the target sub-image corresponding to the initial sub-image is increased to the specified resolution, i.e., the image area that needs to be overlapped or clipped is marked in the target bitstream.

[0188] Thus, for each target bitstream, it may first be detected whether the target bitstream has a mark for the specified pixel.

[0189] If it is detected that a mark relating to a specified pixel is present in the target bitstream, the target bitstream is decoded, and an image area corresponding to the specified pixel is cropped from the image obtained after decoding, thereby obtaining a transcoded target sub-image corresponding to the target bitstream.

[0190] If it is detected that there is no mark for the specified pixel in the target bitstream, the target bitstream can be directly decoded to obtain the transcoded target sub-picture corresponding to the target bitstream.

[0191] S903: The obtained target sub-images are stitched together and displayed to obtain a target image.

[0192] When a plurality of video images are spliced ​​together to obtain a spliced ​​and displayed video screen, each target bitstream obtained according to any one of the video transcoding methods according to the above embodiments of the present application can be first obtained, and each target bitstream can be decoded to obtain a target sub-image corresponding to each target bitstream. In this way, each obtained target sub-image can be spliced ​​together and displayed to obtain a target image.

[0193] Optionally, when each of the obtained target bitstreams is a bitstream of a multi-track stream, according to a video image splicing method corresponding to the bitstream of the multi-track stream, decode each of the obtained target bitstreams to obtain a target sub-image corresponding to each of the target bitstreams, splice and display each of the obtained target sub-images to obtain a target image.

[0194] As can be seen from the above, when applying the technical solution of the embodiments of the present application, in order to realize transcoding of a video screen obtained by stitching together multiple video screens so that the resolution of the video screen displayed after decoding meets the needs of a user, each obtained target bitstream is decoded and stitched together to obtain a video screen whose resolution meets the needs of a user.

[0195] Corresponding to the above-mentioned video transcoding method according to the embodiment of the present application, the embodiment of the present application further provides a video transcoding device.

[0196] FIG. 9 is a schematic diagram of the structure of a video transcoding device according to an embodiment of the present application. As shown in FIG. 9, the device includes: an image capture module 1001 for capturing a first image in an initial image stitched together from a plurality of video images; a resolution determination module 1002 for determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that a preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image; an image splitting module 1003 for splitting the image to be split into initial sub-images to be transcoded based on respective initial resolutions; and an image encoding module 1004 for encoding each initial sub-image according to a target resolution of a target sub-image obtained by transcoding each initial sub-image by the preset encoder to obtain each target bitstream.

[0197] As can be seen from the above, when applying the technical solution of the embodiments of the present application, when transcoding a video screen obtained by stitching together multiple video images, an encoder for transcoding can be preset according to user needs, and the maximum resolution of input data and the maximum resolution of output data that can be supported by the preset encoder can be determined.

[0198] In this way, after obtaining an initial image to be transcoded obtained by splicing together a plurality of video images, a first image to be transcoded can be obtained from the initial image. Then, an initial resolution of each initial sub-image to be transcoded obtained by dividing the first image can be determined, where each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by encoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image. Then, the first image is divided into each initial sub-image to be transcoded according to each initial resolution, and the initial sub-image is encoded by the preset encoder according to the target resolution of the target sub-image obtained by transcoding each initial sub-image to obtain each target bitstream.

[0199] For each initial sub-image, the initial sub-image is encoded according to the target resolution of the target sub-image obtained by transcoding the initial sub-image, so that the resolution of the target sub-image obtained by decoding the target bitstream obtained after encoding is the target resolution. Furthermore, the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, so that the sum of the resolutions of the target sub-images obtained by decoding the target bitstreams is also the preset resolution. In this way, the transcoding of the first image can be realized so that the resolution of the second image displayed after decoding meets the needs of the user.

[0200] In addition, when applying the technical solution according to the embodiment of the present application, the transcoding of the first image is achieved by encoding a plurality of initial sub-images, so that the encoding of the entire first image can be avoided from being limited by the maximum resolution of input data and the maximum resolution of output data that the preset encoder can support. And the number of the plurality of target sub-images does not need to be equal to the number of the plurality of video images for obtaining the initial image by splicing. This avoids the restriction that the preset resolution of the target image after transcoding must be an integer multiple of the number of the plurality of video images when encoding each of the plurality of video images for obtaining the first image by splicing. In this way, the first image can be transcoded more flexibly.

[0201] Optionally, in one specific embodiment, the apparatus further includes a bitstream encapsulation module for adding a specific information structure to bitstream information of each target bitstream, obtaining a bitstream of each encapsulation target, encapsulating the bitstream of each encapsulation target, and adding the specific information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image.

[0202] Optionally, in one specific embodiment, the apparatus further includes a bitstream copy module for copying a bitstream of the multi-track stream and transmitting the resulting bitstreams of the multiple multi-track streams to a designated device.

[0203] Optionally, in one specific embodiment, the resolution determination module 1002 is specifically used for determining a target resolution of each target sub-image after preset transcoding; and for each target resolution, determining an initial resolution corresponding to the target resolution based on a first proportion of the target resolution to the preset resolution and the specified resolution of the first image, as the initial resolution of the initial sub-image corresponding to the target resolution, wherein a second proportion of the specified resolution of each initial resolution is the same as the first proportion of the target resolution corresponding to the initial resolution to the preset resolution.

[0204] Optionally, in one specific embodiment, the image division module 1003 is specifically used for dividing the image to be divided into initial sub-images to be transcoded, each of which has no overlapping area, according to the determined initial resolution.

[0205] Optionally, in one specific embodiment, before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, the device further includes a resolution change module for increasing each initial resolution that does not satisfy a byte alignment requirement of the preset encoder to a resolution that satisfies the byte alignment requirement to obtain each division resolution; The image division module 1003 is specifically used for dividing the first image into initial sub-images to be transcoded according to available resolutions and division resolutions, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image includes an initial sub-image with an overlapping area; The image encoding module 1004 is specifically used for: for each initial sub-image whose resolution is an available resolution, encoding the initial sub-image by the preset encoder according to the target resolution of the target sub-image obtained by transcoding the initial sub-image to obtain a target bitstream; for each initial sub-image whose resolution is a division resolution, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and adding a mark related to a designated pixel to the bitstream information of the obtained bitstream to obtain a target bitstream; The encoding resolution is the product of a target resolution of a target subimage obtained by transcoding the initial subimage and a specified multiple, the specified multiple being the ratio of the division resolution of the initial subimage to the initial resolution of the initial subimage, and the specified pixels are pixels that are added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution.

[0206] Optionally, in one specific embodiment, the device further includes a resolution determination module 1002 for determining whether the division resolution of the initial sub-image is equal to or lower than the maximum resolution of input data that the preset encoder can support and whether the encoding resolution of the initial sub-image is equal to or lower than the maximum resolution of output data that the preset encoder can support before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and triggering the image encoding module if the judgment result is YES, and triggering the resolution determination module 1004 if the judgment result is NO.

[0207] Corresponding to the above-mentioned video display method according to the embodiment of the present application, the embodiment of the present application further provides a video display device.

[0208] FIG. 10 is a schematic diagram of the structure of a video display device according to an embodiment of the present application. As shown in FIG. 10, the device includes: A bitstream acquisition module 1101 for acquiring each target bitstream related to a target image, the specified number of target bitstreams being acquired according to any of the video transcoding methods according to the embodiments of the present application; a bitstream decoding module 1102 for decoding each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream; and an image stitching module 1103 for stitching and displaying the obtained target sub-images to obtain a target image.

[0209] As can be seen from the above, when applying the technical solution of the embodiments of the present application, in order to realize transcoding of a video screen obtained by stitching together multiple video screens, so that the resolution of the video screen displayed after decoding meets the needs of the user, each obtained target bitstream is decoded and stitched together to obtain a video screen whose resolution meets the needs of the user.

[0210] Optionally, in one specific embodiment, the bitstream decoding module 1102 is specifically used for: detecting, for each target bitstream, whether a mark related to a designated pixel exists in the target bitstream; if the mark exists, decoding the target bitstream, cropping out an image area corresponding to the designated pixel in the image obtained after decoding, to obtain a transcoded target sub-image corresponding to the target bitstream; and if the mark does not exist, decoding the target bitstream, to obtain a transcoded target sub-image corresponding to the target bitstream.

[0211] Corresponding to the video transcoding method and the video display method according to the embodiments of the present application, the embodiments of the present application further provide an electronic device, as shown in Fig. 11, the electronic device includes a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other via the communication bus 1204, the memory 1203 is for storing a computer program, and when the processor 1201 executes the computer program stored in the memory 1203, the steps of the video transcoding method according to the embodiments of the present application and / or the steps of the video display method according to the embodiments of the present application are realized.

[0212] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus is 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 this does not mean that there is only one bus or one type of bus.

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

[0214] The memory may include Random Access Memory (RAM) and / or Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may be at least one storage device remote from the processor.

[0215] The above-mentioned processor may be a general-purpose processor including a Central Processing Unit (CPU), a Network Processor (NP), etc., or may be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.

[0216] In another embodiment of the present application, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program being configured to, when executed by a processor, realize steps of the video transcoding method of the embodiment of the present application and / or steps of the video display method of the embodiment of the present application.

[0217] In another embodiment of the present application, a computer program product is further provided, the computer program product including commands, which, when executed by a computer, cause the computer to perform steps of the video transcoding method of the embodiment of the present application and / or steps of the video display method of the embodiment of the present application.

[0218] The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, the embodiment may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer commands. When the computer program commands are loaded into a computer and executed, the process or function described in the embodiments of the present application may be implemented in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer commands may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer commands may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium accessible by a computer, or may be a data storage device including a server, data center, etc., incorporating one or more available media. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state drive, a Solid State Disk (SSD)).

[0219] In this document, the use of relational terms such as "first" and "second" is merely intended to distinguish one entity or operation from another entity or operation, and does not necessarily require or imply any actual relationship or sequence between these entities or operations. Additionally, the terms "comprise," "include," and other variations are intended to cover a non-exclusive inclusion, such that a process, method, product, or device that includes a set of elements includes not only those elements, but also other elements not expressly listed or that are inherent in such process, method, product, or device. In the absence of further limitations, an element defined by the phrase "including a ..." does not exclude the presence of other identical elements in the process, method, product, or device that includes the element.

[0220] Each embodiment in this specification is described in relation to each other, and the same or similar parts between each embodiment may be mutually referred to, and the emphasis in each embodiment is on the differences from other embodiments. In particular, the embodiments of the apparatus, the embodiments of the electronic device, the embodiments of the computer-readable storage medium, and the embodiments of the computer program product are basically similar to the embodiments of the method, and therefore, the embodiments are briefly described. For the relevant parts, the description of the embodiments of the method may be referred to.

[0221] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application should be included within the protection scope of the present application.

Claims

1. 1. A video transcoding method, comprising: acquiring a first image in an initial image sequence of a plurality of video images; determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that the preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is equal to a preset resolution of a second image obtained by transcoding the first image; Dividing the image to be divided into initial sub-images to be transcoded based on initial resolutions; encoding the initial sub-images by the preset encoder according to a target resolution of the target sub-images obtained by transcoding each initial sub-image to obtain each target bitstream; 13. A video transcoding method comprising:

2. 2. A video transcoding method according to claim 1, comprising: adding a specific information structure to the bitstream information of each target bitstream to obtain each bitstream to be encapsulated; encapsulating each of the bitstreams to be encapsulated and adding the specified information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image; The video transcoding method further comprises:

3. 3. A video transcoding method according to claim 2, comprising: copying the bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device.

13. A video transcoding method comprising:

4. A video transcoding method according to any one of claims 1 to 3, comprising: Determining an initial resolution for each initial sub-image to be transcoded includes: determining a target resolution for each target sub-image after the preset transcoding; For each target resolution, determining an initial resolution corresponding to the target resolution based on a first ratio of the target resolution to the preset resolution and a designated resolution of the first image, and setting the initial resolution corresponding to the target resolution as an initial resolution of an initial sub-image; a second ratio of the initial resolution to the specified resolution is equal to a first ratio of the target resolution to the preset resolution corresponding to the initial resolution; 13. A video transcoding method comprising:

5. A video transcoding method according to any one of claims 1 to 3, comprising: Dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions includes: dividing the image to be divided into initial sub-images to be transcoded according to the determined initial resolutions, the sub-images having no overlapping regions; 13. A video transcoding method comprising:

6. A video transcoding method according to any one of claims 1 to 3, comprising: before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, further increasing each initial resolution that does not satisfy a byte alignment requirement of the preset encoder to a resolution that satisfies the byte alignment requirement to obtain each division resolution; Dividing the first image into initial sub-images to be transcoded based on the initial resolutions includes: Dividing the first image into initial sub-images to be transcoded based on available resolutions and division resolutions, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including an initial sub-image with an overlapping region; encoding the initial sub-images according to a target resolution of the target sub-images obtained by transcoding each initial sub-image with the preset encoder to obtain each target bitstream; for each initial sub-image whose resolution is an available resolution, encoding the initial sub-image by the preset encoder according to a target resolution of a target sub-image obtained by transcoding the initial sub-image to obtain a target bitstream; For each initial sub-image whose resolution is the sub-resolution, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and adding marks related to designated pixels to bitstream information of the resulting bitstream to obtain a target bitstream; the encoding resolution is a product of a target resolution of a target subimage obtained by transcoding the initial subimage and a designated multiple, the designated multiple being a ratio of a division resolution of the initial subimage to an initial resolution of the initial subimage, and the designated pixels are pixels that are added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution; 13. A video transcoding method comprising:

7. 7. A video transcoding method according to claim 6, comprising: before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, further determining whether a division resolution of the initial sub-image is equal to or less than a maximum resolution of input data that the preset encoder can support, and whether an encoding resolution of the initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support; if the determination result is YES, encoding the initial sub-image by the preset encoder according to an encoding resolution of the initial sub-image; if the determination result is NO, returning to determining an initial resolution for each initial sub-image to be transcoded; 13. A video transcoding method comprising:

8. 1. A method for displaying video, comprising: obtaining a respective target bitstream for a target image, said target bitstream being obtained according to a video transcoding method according to any one of claims 1 to 7; decoding each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream; and stitching and displaying each of the obtained target sub-images to obtain a target image.

13. A method for displaying video comprising:

9. 9. A video display method as claimed in claim 8, comprising the steps of: Decoding each of the target bitstreams to obtain a transcoded target sub-picture corresponding to each of the target bitstreams includes: for each target bitstream, detecting whether a mark for a specified pixel is present in the target bitstream; if the mark exists, decoding the target bitstream, and cropping an image area corresponding to the designated pixel in the image obtained after decoding to obtain a transcoded target sub-image corresponding to the target bitstream; if the mark is not present, decoding the destination bitstream to obtain a transcoded destination sub-picture corresponding to the destination bitstream.

16. A method for displaying video comprising:

10. A video transcoding device, comprising: an image capture module for capturing a first image in an initial image stitched together from a plurality of video images; a resolution determination module for determining an initial resolution of each initial sub-image to be transcoded, where each initial resolution is equal to or less than a maximum resolution of input data that a preset encoder can support, a target resolution of a target sub-image obtained by transcoding each initial sub-image is equal to or less than a maximum resolution of output data that the preset encoder can support, and a sum of the target resolutions is a preset resolution of a second image obtained by transcoding the first image; an image splitting module for splitting the image to be split into initial sub-images to be transcoded based on respective initial resolutions; an image encoding module for encoding each initial sub-image according to a target resolution of a target sub-image obtained by transcoding each initial sub-image by the preset encoder to obtain each target bitstream; 1. A video transcoding device comprising:

11. 11. A video transcoding device according to claim 10, a bitstream encapsulation module for adding a specific information structure to bitstream information of each target bitstream, obtaining each encapsulation target bitstream, encapsulating each encapsulation target bitstream, and adding the specific information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image; 1. A video transcoding device comprising:

12. 12. A video transcoding device according to claim 11, comprising: and a bitstream copy module for copying a bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device.

1. A video transcoding device comprising:

13. A video transcoding device according to any one of claims 10 to 12, The resolution determination module specifically includes: determining a target resolution for each target sub-image after the preset transcoding; For each target resolution, determine an initial resolution corresponding to the target resolution based on a first ratio of the target resolution to the preset resolution and a designated resolution of the first image, and set the initial resolution of the initial sub-image corresponding to the target resolution; a second ratio of the initial resolution to the specified resolution is equal to a first ratio of the target resolution to the preset resolution corresponding to the initial resolution; 1. A video transcoding device comprising:

14. A video transcoding device according to any one of claims 10 to 12, The image segmentation module specifically includes: used for dividing the image to be divided into initial sub-images to be transcoded, each of which has no overlapping area, according to the determined initial resolution; 1. A video transcoding device comprising:

15. A video transcoding device according to any one of claims 10 to 12, Further comprising a resolution change module for increasing each initial resolution that does not satisfy a byte alignment requirement of the preset encoder to a resolution that satisfies the byte alignment requirement to obtain each division resolution before dividing the image to be divided into each initial sub-image to be transcoded based on each initial resolution; The image division module is specifically used for dividing the first image into initial sub-images to be transcoded according to available resolutions and division resolutions, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image includes an initial sub-image with an overlapping area; Specifically, the image encoding module: for each initial sub-image whose resolution is an available resolution, encoding the initial sub-image by the preset encoder according to a target resolution of a target sub-image obtained by transcoding the initial sub-image to obtain a target bitstream; For each initial sub-image whose resolution is the sub-resolution, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, and adding marks related to designated pixels to bitstream information of the resulting bitstream to obtain a target bitstream; the encoding resolution is a product of a target resolution of a target subimage obtained by transcoding the initial subimage and a designated multiple, the designated multiple being a ratio of a division resolution of the initial subimage to an initial resolution of the initial subimage, and the designated pixels are pixels that are added in the target subimage obtained by transcoding the initial subimage when the target resolution of the target subimage obtained by transcoding the initial subimage is increased to the encoding resolution; 1. A video transcoding device comprising:

16. 16. A video transcoding device according to claim 15, comprising: and a resolution determination module for determining whether the division resolution of the initial sub-image is equal to or lower than a maximum resolution of input data that the preset encoder can support and whether the encoding resolution of the initial sub-image is equal to or lower than a maximum resolution of output data that the preset encoder can support before the preset encoder encodes the initial sub-image according to the encoding resolution of the initial sub-image, and triggering the image encoding module if the determination result is YES, and triggering the resolution determination module if the determination result is NO.

1. A video transcoding device comprising:

17. 1. A video display device comprising: - a bitstream retrieval module for retrieving a respective target bitstream relating to a target image, said target bitstream being obtained according to a video transcoding method according to any one of claims 1 to 7; a bitstream decoding module for decoding each target bitstream to obtain a transcoded target sub-picture corresponding to each target bitstream; an image stitching module for stitching and displaying each of the obtained target sub-images to obtain a target image; 1. A video display device comprising:

18. 20. A video display device as claimed in claim 17, comprising: The bitstream decoding module specifically includes: for each target bitstream, detecting whether a mark for a specified pixel is present in the target bitstream; if the mark exists, decoding the target bitstream, and cropping an image area corresponding to the designated pixel in the image obtained after decoding to obtain a transcoded target sub-image corresponding to the target bitstream; if the mark is not present, decoding the destination bitstream to obtain a transcoded destination sub-picture corresponding to the destination bitstream.

1. A video display device comprising:

19. An electronic device including a processor, a communication interface, a memory, and a communication bus, The processor, the communication interface, and the memory communicate with each other via a communication bus; Memory is for storing computer programs. The processor, when executing a computer program stored in the memory, is adapted to implement the steps of the video transcoding method according to any one of claims 1 to 7 and / or the steps of the video display method according to any one of claims 8 to 9.

1. An electronic device comprising:

20. A computer-readable storage medium having a computer program stored thereon, The computer program, when executed by a processor, implements the steps of the video transcoding method according to any one of claims 1 to 7 and / or the steps of the video display method according to any one of claims 8 to 9. A computer-readable storage medium comprising:

21. A computer program product including commands, said commands, when executed by a computer, causing said computer to perform the steps of the video transcoding method of any one of claims 1 to 7 and / or the steps of the video display method of any one of claims 8 to 9; A computer program product comprising:

Citation Information

Patent Citations

  • Real-time transcoding method and apparatus, and real-time decoding method and apparatus

    CN104159063A

  • Methods and systems for image processing

    JP2013507084A

Cited By

  • Image mark data transmission method and device, computer equipment and storage medium

    CN119364043A