Video transcoding and video display method, apparatus and electronic device
The video transcoding method allows for flexible resolution adjustment of stitched video frames by dividing and encoding sub-images within user-defined constraints, addressing the limitations of existing methods and improving user resolution control.
Patent Information
- Application Number
- JP2024539377
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-12-30
- Filing Date
- 2022-12-16
- Publication Date
- 2025-10-07
- Estimated Expiration
- 2042-12-16
AI Technical Summary
Existing video transcoding methods struggle to adjust the resolution of stitched video frames to meet user-specific needs, as the resolution of the stitched video image is the sum of individual video frames, limiting flexibility in displaying or transcoding to different resolutions.
A method and apparatus for video transcoding that involves dividing an initial image into sub-images based on initial resolutions, encoding these sub-images with a preset encoder to achieve target resolutions, and stitching the transcoded sub-images to meet user-defined output resolutions, while avoiding limitations on input and output data resolution constraints.
Enables flexible transcoding of stitched video frames to achieve desired user resolutions, allowing for more precise control over the displayed resolution without requiring the target resolution to be an integer multiple of the number of input frames, thus enhancing user satisfaction.
Smart Images

Figure 0007751113000001 
Figure 0007751113000002 
Figure 0007751113000003
Abstract
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 incorporated herein by reference.
[0002] The present application relates to the field of video processing technology, and in particular to video transcoding and video display methods, apparatuses and electronic devices. [Background technology]
[0003] Currently, in order to display a scenario image of a certain area more comprehensively from various angles, it is desirable to install multiple video acquisition devices in the area, completely covering the entire space of the area, and in order to display all the video images of the area simultaneously, the multiple video images acquired by the multiple video acquisition devices are usually stitched together and the stitched video image 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 frame within the stitched video frame at a different resolution. For example, the user may want to display the entire stitched video frame at a different resolution. Also, for example, the user may want to display only a portion of the stitched video frame at a different resolution.
[0005] Based on this, how to transcode a video screen that combines multiple videos so that the resolution of the video screen displayed after decoding meets the user's needs is currently an issue that needs to be resolved urgently. Summary of the Invention
[0006] The embodiments of the present application aim to provide a video transcoding and video display method, apparatus, and electronic device for transcoding a video screen that combines 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 video transcoding method, the method comprising: 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 the maximum resolution of input data that can be supported by a preset encoder, 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 can be supported by the preset encoder, and the sum of the target resolutions is the 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 the 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 designation 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 the bitstream of the multi-track stream and transmitting the resulting bitstream of the multi-track stream to a designated device.
[0010] Optionally, in one specific embodiment, determining the initial resolution of each initial sub-image to be transcoded includes: determining a target resolution for each target sub-image after preset transcoding; 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 designated resolution of the first image, and set the initial resolution as an initial resolution of the initial sub-image corresponding to the target resolution; Including, 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 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: Dividing the image to be divided into initial sub-images to be transcoded according to the determined initial resolutions, each sub-image having no overlapping areas.
[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 the 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 each available resolution and each division resolution, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including initial sub-images with overlapping regions; encoding the initial sub-images by the preset encoder according to the target resolution of the target sub-images obtained by transcoding each initial sub-image 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 obtained bitstream to obtain a target bitstream; The encoding resolution is the product of the target resolution of the target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being the ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image 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 determination result is YES, encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image; If the answer is NO, the process 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 target bitstream for a target image, the target bitstream being obtained according to any one 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 the obtained target sub-images to obtain the 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 exists 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 does not exist, decoding the target bitstream to obtain a transcoded target sub-picture corresponding to the target bitstream; Includes.
[0016] In a third aspect, an embodiment of the present application provides a video transcoding device. The device 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, wherein 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 equal to 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 using the preset encoder to obtain each target bitstream; Includes.
[0017] Optionally, in one specific embodiment, the device comprises: The device further includes a bitstream encapsulation module for adding a designated information structure to bitstream information of each target bitstream, obtaining each encapsulation target bitstream, encapsulating each encapsulation target bitstream, and adding the designated 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 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 preset transcoding; 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 designated resolution of the first image, and set the initial resolution as an initial resolution of the initial sub-image corresponding to the target resolution; 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 corresponding to that initial resolution occupies.
[0020] Optionally, in one specific embodiment, the image division module is specifically used to divide 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, based on the initial resolutions, 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 initial sub-images to be transcoded, 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, where the available resolutions are 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, the preset encoder encodes the initial sub-image according to the encoding resolution of the initial sub-image, and adds marks related to designated pixels to bitstream information of the obtained bitstream to obtain a target bitstream; The encoding resolution is the product of the target resolution of the target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being the ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image 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 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 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.
[0023] In a fourth aspect, embodiments of the present application provide a video display device comprising: a bitstream acquisition module for acquiring a target bitstream relating to a target image, the target bitstream being obtained according to any one 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 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 exists 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 does not exist, the target bitstream is decoded to obtain the 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, wherein the processor, communication interface, and memory communicate with each other via the communication bus, the memory is for storing a computer program, and the processor, when executing the computer program stored in the memory, is 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, implement 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 including commands that, when executed by 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, a transcoding encoder can be preset according to user needs, and the maximum resolution of input data and the maximum resolution of output data that the preset encoder can support can be determined.
[0029] After obtaining an initial image to be transcoded by splicing together multiple video images, a first image to be transcoded is first 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 the maximum resolution of input data that the preset encoder can support, and the target resolution of a target sub-image obtained by encoding 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 the preset resolution of a second image obtained by transcoding the first image. Then, the first image is divided into initial sub-images to be transcoded based on the initial resolutions. The initial sub-images are then encoded by the preset encoder according to the target resolutions of the target sub-images obtained by transcoding each initial sub-image to obtain target bitstreams.
[0030] 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, and 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, and 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 first image can be transcoded so that the resolution of the second image displayed after decoding meets the user's needs.
[0031] Furthermore, when applying the technical solutions according to the embodiments of the present application, transcoding of the first image is achieved by encoding multiple initial sub-images, thereby avoiding limitations on the maximum resolution of input data and the maximum resolution of output data that a preset encoder can support when encoding the entire first image. Furthermore, the number of target sub-images does not need to be equal to the number of video images that are spliced together to obtain the initial image. This avoids the requirement that the preset resolution of the transcoded target image must be an integer multiple of the number of video images that are spliced together to obtain the first image. This allows for more flexible transcoding of the first image.
[0032] Of course, any product or method embodying the present invention need not necessarily achieve all of the above advantages simultaneously. [Brief explanation of the drawings]
[0033] In order to more clearly explain the technical solutions of the embodiments of the present application and the prior art, the drawings necessary for the embodiments and the prior art will be briefly described below. The drawings described below are merely according to some of the embodiments of the present application, and it is obvious that those skilled in the art can obtain other drawings based on these drawings without creative efforts. [Figure 1]FIG. 1 is a flow diagram of a video transcoding method according to an embodiment of the present application. [Figure 2] FIG. 2 is a schematic diagram illustrating an example of splicing together multi-track bitstreams contained in a bitstream of a multi-track stream. [Figure 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. [Figure 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 INVENTION
[0034] In order to clarify the objectives, technical solutions and advantages of the embodiments of the present application, the present application will be further described in detail by giving examples with reference to the drawings. It is clear that the described embodiments are only a part 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 can be obtained by a person skilled in the art without requiring creative work 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 the multiple video images. However, in some cases, a user may want to display a scene within the spliced video image at a different resolution. For example, the user may want to display the spliced video image at a different resolution, or may want to display a part of the spliced video image at a different resolution. Based on this, how to transcode a video image spliced from multiple videos so that the resolution of the video image displayed after decoding meets the user's needs has become an urgent issue.
[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 within a 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 transcodes video frames to obtain a video bitstream, such as a collection device with image processing capabilities, a server communicatively connected to the collection device, or 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 the executing entity 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 can be supported by a preset encoder, 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 can be supported by the preset encoder, and the 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; 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 image obtained by stitching together multiple video images, a transcoding encoder 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] After obtaining an initial image to be transcoded by splicing together multiple video images, a first image to be transcoded is first 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. 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 encoding 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 the preset resolution of a second image obtained by transcoding the first image. Then, the first image is divided into initial sub-images to be transcoded based on the initial resolutions. The preset encoder then encodes each initial sub-image according to the 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 the target resolution of the target sub-image obtained by transcoding the initial sub-image, and 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, and 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 first image can be transcoded so that the resolution of the second image displayed after decoding meets the user's needs.
[0043] Furthermore, when applying the technical solutions according to the embodiments of the present application, transcoding of the first image is achieved by encoding multiple initial sub-images, thereby avoiding limitations on the maximum resolution of input data and the maximum resolution of output data that a preset encoder can support when encoding the entire first image. Furthermore, the number of target sub-images does not need to be equal to the number of video images used to stitch together the initial image, thereby avoiding the requirement that the preset resolution of the transcoded target image must be an integer multiple of the number of video images used to stitch together the first image. This allows for more flexible transcoding of the first image.
[0044] Hereinafter, a video transcoding method according to an embodiment of the present invention 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 configured, and each video acquisition device may perform video acquisition in its corresponding acquisition area, thereby obtaining a plurality of video bitstreams. 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 spliced 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] A multi-track stream bitstream refers to a video bitstream consisting of multiple video bitstreams. Specifically, the multi-track video bitstream is obtained through one physical channel, and the obtained multi-track video bitstream is subjected to video image processing in the physical channel to obtain the multi-track stream bitstream. In this case, the physical channel may be called a multi-track stream channel.
[0052] That is, multimedia data collected from multiple multimedia data collection devices may be encapsulated into a multi-track stream, and the bitstream of the multi-track stream may include multimedia data collected by multiple multimedia data collection devices at the same time, 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, but may allow for 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 bitstream of the multi-track stream is a screen displayed on the same total display surface obtained by seamlessly joining together video screens corresponding to each of the multi-track video bitstreams that make up the bitstream of the multi-track stream. In other words, the initial image is a screen displayed on the same total display surface obtained by seamlessly joining together video screens corresponding to each of the multi-track video bitstreams that make up the bitstream of the multi-track stream.
[0056] Compared with a normal bitstream that corresponds to only one track of video bitstream, an MFI (Multiple 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. The MFI information structure is used to indicate 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 frames corresponding to the video bitstream of each track.
[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 the total number of tracks in the composite frame. For example, the bitstream of a multi-track stream with 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. For example, the data packet type identifier may include at least four identification values for respectively identifying video, audio, private frames, etc. Illustratively, 00 identifies video, 01 identifies audio, 10 identifies private frames, and 11 is left unidentified.
[0059] The start-of-frame identifier is for identifying whether a data packet added to a bitstream of a multi-track stream is a start-of-frame data packet, and for example, the start-of-frame identifier includes at least two identification values for identifying whether the data packet is a start-of-frame data packet or not, respectively. Illustratively, 1 identifies the data packet as a start-of-frame data packet, and 0 identifies the data packet as not a start-of-frame data packet.
[0060] The end-of-frame identifier is for identifying whether a data packet added to a bitstream of a multi-track stream is an end-of-frame data packet, and for example, the end-of-frame identifier includes at least two identification values for identifying whether it is an end-of-frame data packet or not, respectively. Illustratively, 1 identifies it as an end-of-frame data packet, and 0 identifies it 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. Therefore, if the data packet type is video, the frame type identifier may include at least four identification values for respectively identifying an I-frame, a P-frame, or a B-frame. 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 multi-track stream exists.
[0063] The total number of tracks in the composite frame is used to identify how many tracks of data (ie, multimedia data of several target multimedia data collection devices) are added to the bitstream of the multi-track stream.
[0064] A sub-video screen corresponding to the video bitstream of each track in a video screen corresponding to the bitstream of a multi-track stream may be called a "track screen." Correspondingly, a sub-video screen corresponding to the video bitstream of the Nth track in a video screen corresponding to the bitstream of a multi-track stream may be called an "Nth track screen."
[0065] Furthermore, 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 that make up the video screen. Based on this, if a video screen with a high resolution needs to be used in actual applications, it can be realized by the multi-track stream bitstream. Furthermore, 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 increased infinitely.
[0066] The size of the video screen corresponding to the bitstream of the multi-track stream may be the same or different for the video screen corresponding to the video bitstream of each track on the video screen.
[0067] 2, when splicing together a video scene corresponding to a multi-track stream bitstream, first obtain the bitstream of the latest one frame of video scene from the multi-track stream bitstream, where the bitstream of the latest one frame of video scene 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 multi-track stream bitstream, and N in the MFI information structure represents that the current bitstream is the bitstream of the Nth track in the multi-track stream bitstream. Thus, the process of decoding and splicing together the bitstream of the latest one frame of video scene from the multi-track stream bitstream 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 multi-track stream bitstream, a frame buffer area Pool is allocated to store the data obtained by decoding each track bitstream. For example, if the resolution of the video screen corresponding to the multi-track stream bitstream is W in width and H in height, the allocated frame buffer area Pool will have W in width and H in height.
[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: Sequentially decode each track bitstream included in the multi-track stream bitstream. If the current bitstream is the first track bitstream in the multi-track stream bitstream, i.e., N=1, start from the base address addr[0] of the first sub-buffer area pool[1] and store the decoded YUV data of the first track bitstream in the frame buffer area Pool. Furthermore, sequentially store the decoded YUV data of each track bitstream included in the multi-track stream bitstream in the frame buffer area Pool using the base addresses addr[0] to addr[TI-1] of TI sub-buffer areas pool[1] to pool[T1], respectively. Here, the decoded YUV data of each track bitstream is YUV data with a width of W / TI and a height of H.
[0072] In YUV data, Y represents 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 a multi-track stream, the video screen obtained by decoding each track bitstream is cached on a 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 point, the decoding and splicing of the bitstream of the multi-track stream is completed.
[0075] Up to now, the most recent video frame that has been decoded and stitched together can be displayed on the same total display surface, and can then be used for subsequent video processing such as display, transmission, and storage.
[0076] That is, the video images cached on each sub-display screen are cached on the same total display screen, and the resolution of the total display screen is the sum of the resolutions of all the sub-display screens, i.e., the resolution of the total display screen 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 displayed on one display surface for a display window corresponds to a single video screen displayed in the display window, but since the display processing is not performed according to the method of displaying multiple video screens, there are no joining slits. As shown in Figure 2, the two vertical lines are specially added to illustrate the video screen corresponding to the multi-track stream, but these two lines do not exist when displayed in actual application.
[0078] 2, the arrangement of the video frames corresponding to the respective track bitstreams is merely an example of a method for joining the video frames corresponding to the respective track bitstreams included in the bitstream of the multi-track stream, and is not limiting. In each embodiment, the video frames corresponding to the respective track bitstreams included in the bitstream of the multi-track stream may be joined 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 included in the bit stream of the multi-track stream acquired in advance, and the video image of each sub-display surface is cached at the position of the sub-display surface in the total display surface corresponding to the sub-display surface.
[0080] For example, the positional relationship of the video screens corresponding to each track bitstream included in the bitstream of the multi-track stream may be the same as 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 on the total display surface corresponding to 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 on the entire display surface of the video screen corresponding to each track bitstream included in the bitstream of the multi-track stream in the position setting command. For example, the position setting command may include the following information: According to the number of each track bitstream, vertical stitching is performed for the video screen corresponding to each track bitstream; According to the number of each track bitstream, horizontal stitching is performed for the video screen corresponding to each track bitstream.
[0082] Furthermore, since there may be overlapping areas between the collection ranges of the multimedia data collection devices that collect each track bitstream, there may be overlapping areas between the video screens obtained by decoding each track bitstream. Therefore, position information of the overlapping areas between the collection ranges of each multimedia data collection device is obtained in advance, and after each track bitstream is decoded and the video screen is obtained, the overlapping areas in the obtained video screen are first clipped using the position information, and the clipped video screens are then cached on each sub-display surface. In other words, the video screens cached in each sub-buffer area are screens with no overlapping areas between them. That is, in steps 1 to 5 above, the video screens corresponding to each track bitstream are screens with no overlapping areas.
[0083] S102: Determine the initial resolution of 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 the 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 the preset resolution of the second image obtained by transcoding the 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 using 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 that the first image is divided to obtain each initial sub-image to be transcoded.
[0088] Considering 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 formed by stitching together 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] Alternatively, the initial resolution of each initial sub-image may be determined based on the number of preset initial sub-images and the specified resolution of the first image. For example, the specified resolution of the first image may be assigned to each initial sub-image on average, resulting in the same initial resolution for each initial sub-image. Furthermore, the target resolution for each target sub-image may also be the same.
[0091] Optionally, the initial resolution of each initial sub-image may be determined based on the target resolution of the target sub-image obtained by transcoding each preset image and the preset resolution of the 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 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 limitations of the preset encoder on the resolution of 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 output data that the preset encoder can support, and since the second image obtained by transcoding the first image is obtained by splicing together the target sub-images, 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. Therefore, 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, and the resolution of the second image desired by the user is W0 in width and H0 in height, the preset resolution of the second image is W0 in width and H0 in height.
[0096] Alternatively, 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 difference between the preset resolution of the second image and the designated resolution of the first image allows scaling of the transcoded second image relative to the first image to be transcoded.
[0097] If the preset resolution of the second image is greater than the specified resolution of the first image, the second image after transcoding is enlarged relative to the first image to be transcoded, and if the preset resolution of the second image is less than the specified resolution of the first image, the second image after transcoding is reduced relative 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 the 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 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 corresponding to that initial resolution occupies.
[0103] In this particular embodiment, each target sub-image is scaled by the same ratio relative to the corresponding initial sub-image to achieve the scaling of the second transcoded image relative 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 that 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 that 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 spliced first image, i.e., determine the resolution of each target sub-image desired by the user.
[0106] In this way, when determining the initial resolution of each initial sub-image, the target resolution of each target 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 proportion of each initial resolution in the specified resolution of the first image is the same as a first proportion of the target resolution corresponding to the initial resolution in the preset resolution of the second image, and the target resolution corresponding to each initial sub-image is the target resolution of the target sub-image obtained by transcoding the initial sub-image.
[0109] That is, the second proportion of each 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, if the specified resolution of the first image is DW in width and DH in height, and the preset resolution of the second image is (W6+W7) in width and H6 in height, and there are two target sub-images, and the target resolutions of the two target sub-images are W6 in width and H6 in height, and W7 in width and H6 in height, respectively, then the initial resolutions of the two initial sub-images can be determined to be W6 / (W6+W7)*DW in width and DH in height, and W7 / (W6+W7)*DW in width and DH in height, 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, and 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 the target resolutions ensures the preset resolution of the second image obtained by transcoding the first image, so that the initial resolution of each initial sub-image is randomly determined. At this time, the determined initial resolutions of each initial sub-image do not need to be exactly 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, the initial image is divided into a specified number of initial sub-images based on each initial resolution.
[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, with no overlapping areas.
[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.
[0120] Since there are no overlapping areas between the initial sub-images and each initial sub-image may include all image areas of the first image, the sum of the initial resolutions of the initial sub-images 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 the initial sub-images 1 to 5.
[0122] S104: Using a preset encoder, encode each initial sub-image according to the target resolution of a target sub-image corresponding to the initial sub-image to obtain each target bitstream.
[0123] After obtaining each of the initial sub-images, the initial sub-image is encoded by a preset encoder according to the target resolution of the target sub-image corresponding to the initial sub-image to obtain a target bitstream for the initial sub-image.
[0124] For each initial sub-picture, after decoding the resulting target bitstream for that initial sub-picture, the resolution of the resulting target sub-picture is the target resolution of the target sub-picture obtained by transcoding that initial sub-picture.
[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 each of the initial sub-images.
[0126] For example, the specified resolution of the first image is DW in width and DH in height, and the first image is divided to obtain an initial sub-image a having an initial resolution of W6 / (W6+W7)*DW in width and DH in height, and an initial sub-image b having an initial resolution of W7 / (W6+W7)*DW in width and DH in height, and the preset resolution of the second image is (W6+W7) in width and H6 in height, and the target resolution of the target sub-image obtained by transcoding the initial sub-image a is W6 in width and DH in height, and the target resolution of the target sub-image obtained by transcoding the initial sub-image b is W7 in width and DH in height.
[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 each target bitstream is obtained, subsequent processes such as decoding, displaying, transmitting, and storing are performed on each target bitstream.
[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 designation information structure to the bitstream information of each target bitstream to obtain each bitstream to be encapsulated.
[0131] S106: Each bitstream to be encapsulated is encapsulated, and a designated information structure is added 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, the target bitstreams may be converted into a multi-track stream bitstream, and the number of tracks included in the multi-track stream bitstream is the number of each of the target bitstreams.
[0133] After obtaining each target bitstream in this way, a designation information structure is first added to the bitstream information of each target bitstream to obtain multiple 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 designation information structure is added to the bitstream information of each target bitstream to obtain multiple bitstreams to be encapsulated, i.e., a designation information structure is added to the source bitstream information of the bitstream of each track to obtain each source bitstream to be encapsulated. Furthermore, each bitstream to be encapsulated is encapsulated, and a designation information structure is added to the generated encapsulation information to obtain the bitstream of the multi-track stream related to the first image. The designation 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 multi-track stream bitstream related to the first image, since multiple users may want to obtain the multi-track stream bitstream, the multi-track stream bitstream is copied and the multiple copied multi-track stream bitstreams are transmitted to designated devices. The multiple copied multi-track stream bitstreams may be transmitted to the same designated device, or the multiple multi-track stream bitstreams may be transmitted to different designated devices. This is reasonable.
[0137] As can be seen from the above, when applying the technical solutions provided in the embodiments of the present application, when transcoding a video screen obtained by splicing multiple 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 decoding the target bitstream obtained after encoding, the resolution of the target sub-image obtained is the target resolution. Furthermore, since the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, after decoding the target bitstream, 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 user's needs.
[0138] Furthermore, when applying the technical solutions according to the embodiments of the present application, transcoding of the first image is achieved by encoding multiple initial sub-images, thereby avoiding limitations on the maximum resolution of input data and the maximum resolution of output data that a preset encoder can support when encoding the entire first image. Furthermore, the number of target sub-images does not need to be equal to the number of video images in the initial image obtained by splicing them together. This avoids the limitation that the preset resolution of the transcoded target image must be an integer multiple of the number of video images when encoding each of the video images to obtain the first image by splicing them together. This allows for more flexible transcoding of the first image.
[0139] Typically, the encoder requires that the resolution of the input data be 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, 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 division resolution.
[0143] In this specific embodiment, after obtaining the initial resolution of each initial sub-image, it may be determined for each initial resolution 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 may be increased to a resolution that satisfies the byte alignment requirement, and the resulting resolution after 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 satisfies the byte alignment requirement.
[0146] For example, if a preset encoder requires 8-byte alignment and an initial resolution is 15 in width and 16 in height, the initial resolution is increased to 16 in width and 16 in height 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 respective initial sub-images to be transcoded based on respective initial resolutions, and the above step S103 may include the following step S1031:
[0149] S1031: Divide the first image into initial sub-images to be transcoded based on each available resolution and each division resolution.
[0150] Here, the available resolution is an initial resolution that satisfies the byte alignment requirement, and each initial sub-image includes initial sub-images where there are overlapping regions.
[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 the available resolution. After obtaining the division resolutions, the first image is divided into initial sub-images to be transcoded based on the available resolutions and the division resolutions.
[0152] The sum of the initial resolutions of the initial sub-images is the specified resolution of the first image, and each sub-resolution is obtained by increasing the initial resolution, so the sum of each available resolution and each sub-resolution is greater than the specified resolution of the first image. Furthermore, when the first image is divided into initial sub-images to be transcoded according to each available resolution and each sub-resolution, each resulting initial sub-image includes all image regions of the first image, and the resolution of the image obtained by stitching together the resulting initial sub-images is greater than the resolution of the first image. That is, if the size of the image obtained by stitching together the resulting initial sub-images is larger than the size of the first image, each resulting initial sub-image will include initial sub-images with overlapping regions.
[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, a 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.
[0155] S1042: For each initial sub-image whose resolution is the divided resolution, the preset encoder encodes the initial sub-image according to the encoding resolution of the initial sub-image, and adds a mark related to the designated pixel to the bitstream information of the obtained bitstream to obtain the target bitstream.
[0156] The encoding resolution is the product of the target resolution of the target sub-image obtained by transcoding the initial sub-image and a specified multiple, where the specified multiple is the ratio of the division resolution of the initial sub-image to the initial resolution of the initial sub-image, and the specified pixels are the pixels added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image 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] In this way, 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 sub-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 when encoding the initial sub-image using a preset encoder, the encoding resolution used as the reference is obtained by increasing the target resolution of the target sub-image obtained by transcoding the initial sub-image.
[0160] For ease of explanation, the bitstream obtained by encoding each initial sub-image, whose resolution is the sub-resolution, according to the target resolution of the target sub-image obtained by transcoding the initial sub-image is referred to as the reference bitstream, and the image obtained by decoding the reference bitstream is referred to as the reference image. The initial sub-image is encoded according to the encoding resolution to obtain the target bitstream, and the image obtained by decoding the target bitstream is the target sub-image obtained by transcoding the initial sub-image. Because the encoding resolution is obtained by increasing the target resolution, there is an image region in the target sub-image that is obtained by increasing the reference image. When connecting the target sub-images to obtain the second image, it is necessary to overlap the image region obtained by increasing the target sub-image, with another target sub-image containing the image region, or to crop the image region.
[0161] Based on this, for each initial sub-image whose resolution is the division resolution, the preset encoder determines the 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 the target resolution of the target sub-image obtained by transcoding the initial sub-image and a specified multiple, and the specified 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 the 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 the target resolution of the target sub-image obtained by transcoding the initial sub-image to obtain the encoding resolution.
[0164] For each initial sub-image whose resolution is the division resolution, the encoding resolution of the initial sub-image may be determined, and then the initial sub-image may be encoded by a preset encoder according to the encoding resolution. Furthermore, a target bitstream may be obtained by adding a mark related to a designated pixel to the bitstream information of the bitstream obtained after encoding, so that the target bitstream can be more easily overlapped or cut out with the image area resulting from the enlargement of the subsequent initial sub-image.
[0165] The designated pixels are pixels that are added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image is increased to the encoding resolution.
[0166] That is, the designated pixel is understood to be a pixel corresponding 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 obtained by 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 wide and 16 high, and the target resolution of the target sub-image obtained by transcoding the initial sub-image is W8 wide and H8 high, the initial resolution is increased to 16 wide and 16 high to obtain a division resolution. The initial sub-image is then divided according to the division resolution to obtain an initial sub-image. Based on this, when transcoding the initial sub-image, the coding resolution of the initial sub-image is first determined to be W8*16 / 15 wide and H8 high. The preset encoder encodes the initial sub-image according to the coding resolution of W8*16 / 15 wide and H8 high, and adds marks for specified pixels to the resulting bitstream to obtain the target bitstream.
[0169] The specified pixel is a pixel added to the target sub-image when the width of the target resolution, which has a width of W8 and a height of H8, is increased to an encoding resolution, which has a width of W8*16 / 15 and a height of H8. Therefore, if the resolution of the image region consisting of the specified pixel is W8*16 / 15-W8 in width and H8 in height, the mark for the added specified pixel may be W8*16 / 15-W8.
[0170] For each initial sub-image whose resolution is the division resolution, when obtaining the initial sub-image by division, the division resolution used is greater than the determined initial resolution of the initial sub-image, and when encoding the initial sub-image, the encoding resolution used 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 division resolution of the initial sub-image satisfies the resolution limit of the preset encoder for the input data, and whether the encoding resolution of the initial sub-image satisfies 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 step S1042; if the result of the determination is NO, return to 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 that 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 the specified pixel to the bitstream information of the obtained bitstream, thereby obtaining the 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, and therefore the preset encoder cannot encode the initial sub-image. Therefore, by newly determining the initial resolution of each initial sub-image, subsequent video transcoding methods can be performed according to the newly determined initial resolution of each initial sub-image.
[0176] Corresponding to the video transcoding method according to the above embodiment of the present application, the embodiment of the present application further provides a video display method.
[0177] The method can be applied 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 can also be applied to an electronic device that stitches together and displays multiple video frames, such as a collection device with image processing capabilities, a server communicatively connected to the collection device, or a display device communicatively connected to the collection device. Based on this, the embodiments of the present application do not specifically limit the application scenario and execution entity 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 the target image.
[0181] Each target bitstream is obtained based on any of the video transcoding methods according to the embodiments of the present application.
[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 specified 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 certain target bitstream, the target bitstream may be obtained by encoding according to the specified resolution, so that an image obtained by decoding the target bitstream has an image region that needs to be overlapped or clipped with another target sub-image containing the image region, and marks are added to the target bitstream regarding specified 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 region that needs to be overlapped or clipped is marked in the target bitstream.
[0188] Thus, for each target bitstream, it may first be determined whether the target bitstream has a mark for the specified pixel.
[0189] If it is detected that a mark related to a specified pixel exists in the target bitstream, the target bitstream is decoded, and the image area corresponding to the specified pixel is cut out from the image obtained after decoding, thereby obtaining a transcoded target sub-image corresponding to the target bitstream.
[0190] If it is detected that the target bitstream does not have a mark for the specified pixel, it can directly decode the target bitstream 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 the target image.
[0192] When splicing multiple video images to obtain a spliced and displayed video screen, each target bitstream obtained based on any 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. The obtained target sub-images can then 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 solutions 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 of the obtained target bitstreams is decoded and stitched together to obtain a video screen whose resolution meets the needs of the user.
[0195] Corresponding to the 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, wherein each initial resolution is equal to or less than a maximum resolution of input data that can be supported by a preset encoder, 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 can be supported by the preset encoder, and a sum of the target resolutions is equal to a preset resolution of a second image obtained by transcoding the first image; an image division module 1003 for dividing the image to be divided 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 the target sub-image obtained by transcoding each initial sub-image using the preset encoder to obtain each target bitstream.
[0197] 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, a transcoding encoder can be preset according to user needs, and the maximum resolution of input data and the maximum resolution of output data that the preset encoder can support can be determined.
[0198] In this way, after obtaining an initial image to be transcoded, which is obtained by splicing multiple video images, a first image to be transcoded can be first 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. 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 encoding 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 the 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 the initial resolutions. The preset encoder transcodes each initial sub-image according to the target resolution of the target sub-image, thereby obtaining 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, and the resolution of the target sub-image obtained by decoding the target bitstream obtained after encoding is the target resolution. Furthermore, since the sum of the target resolutions is the preset resolution of the second image obtained by transcoding the first image, 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 user's needs.
[0200] Furthermore, when applying the technical solutions according to the embodiments of the present application, transcoding of the first image is achieved by encoding multiple initial sub-images, thereby avoiding limitations on the maximum resolution of input data and the maximum resolution of output data that a preset encoder can support when encoding the entire first image. Furthermore, the number of target sub-images does not need to be equal to the number of video images used to stitch together the initial image. This avoids the requirement that the preset resolution of the transcoded target image must be an integer multiple of the number of video images used to stitch together the first image when encoding each of the video images used to stitch together the first image. This allows for more flexible transcoding of the first image.
[0201] Optionally, in one specific embodiment, the device further includes a bitstream encapsulation module for adding a designated information structure to bitstream information of each target bitstream, obtaining each encapsulation target bitstream, encapsulating each encapsulation target bitstream, and adding the designated 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 the 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 that the target resolution accounts for in the preset resolution and the specified resolution of the first image, so as to set the initial resolution as the initial resolution of the initial sub-image corresponding to the target resolution, wherein a second proportion that each initial resolution accounts for in the specified resolution is the same as the first proportion that the target resolution corresponding to the initial resolution accounts for in the preset resolution.
[0204] Optionally, in one specific embodiment, the image division module 1003 is specifically used to divide 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 changing 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 to divide the first image into initial sub-images to be transcoded according to available resolutions and division resolutions, where the available resolutions are 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, thereby obtaining a target bitstream; and for each initial sub-image whose resolution is a divided 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 bitstream information of the obtained bitstream, thereby obtaining a target bitstream; The encoding resolution is the product of the target resolution of the target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being the ratio of the division resolution of the initial sub-image to the initial resolution of the initial sub-image, and the specified pixels are pixels added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image 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 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 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 determination result is YES, and triggering the resolution determination module 1004 if the determination result is NO.
[0207] Corresponding to the video display method according to the above 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 comprises: a bitstream acquisition module 1101 for acquiring target bitstreams for target images, the specified number of target bitstreams being obtained 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 the target image.
[0209] As can be seen from the above, when applying the technical solutions 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, the obtained target bitstreams are 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 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 above-mentioned embodiments of the present application, the embodiments of the present application further provide an electronic device, as shown in Fig. 11, which includes a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, wherein 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 computer programs, and the processor 1201 executes the computer programs stored in the memory 1203 to realize the steps of the video transcoding method according to the above-mentioned embodiments of the present application and / or the steps of the video display method according to the above-mentioned embodiments of the present application.
[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), non-volatile memory (NVM), such as at least one disk memory, or alternatively, at least one storage device remote from the processor.
[0215] The processors mentioned above may be general-purpose processors including central processing units (CPUs) and network processors (NPs), digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0216] In another embodiment of the present application, there is further provided a computer-readable storage medium having a computer program stored thereon, the computer program being for, when executed by a processor, realizing 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 including commands is further provided, which, when executed by a computer, causes the computer to perform steps of the video transcoding method according to the embodiment of the present application and / or steps of the video display method according to 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 implementation may be, 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 and executed on a computer, the processes or functions described in the embodiments of the present application are 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 on 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 via wire (e.g., coaxial cable, fiber optics, 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 (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive, a solid state disk (SSD)).
[0219] It should be noted that, in this context, relational terms such as "first," "second," etc., are merely used to distinguish one entity or operation from another and do not necessarily require or imply any actual relationship or order between those entities or operations. Furthermore, the terms "comprise," "include," and other variations thereof are intended to cover non-exclusive inclusions, such that a process, method, product, or device comprising a set of elements includes not only those elements but also other elements not expressly listed or inherent in such process, method, product, or device. Absent further limitations, an element defined by the phrase "comprises ..." does not exclude the presence of other identical elements in a process, method, product, or device that includes that element.
[0220] The embodiments in this specification are described in relation to each other, and identical or similar parts between the embodiments may be mutually referenced. The description of each embodiment focuses on the differences from other embodiments. In particular, the apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, and therefore will be briefly described. For relevant parts, please refer to the description of the method embodiments.
[0221] The above description is only a 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 obtained by splicing together a plurality of video images as an image to be divided; 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 can be supported by a preset encoder, 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 can be supported by the preset encoder, 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 the target resolution of the target sub-images obtained by transcoding each initial sub-image to obtain each target bitstream; determining an initial resolution of each initial sub-image to be transcoded, determining a target resolution for each target sub-image after preset transcoding; 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 a designated resolution of the first image, and setting the initial resolution as an initial resolution of the initial sub-image corresponding to the target resolution; The second proportion of each initial resolution to the specified resolution is the target solution corresponding to the initial resolution. the image resolution is equal to a first proportion of the preset resolution; A video transcoding method comprising:
2. 2. The video transcoding method of claim 1, adding a designation 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. The video transcoding method of claim 2, further comprising: copying the bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device; A video transcoding method comprising:
4. 2. The video transcoding method of claim 1, 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 initial sub-images having no overlapping areas; A video transcoding method comprising:
5. 3. The video transcoding method of claim 2, further 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 initial sub-images having no overlapping areas; A video transcoding method comprising:
6. 4. The video transcoding method of claim 3, 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 initial sub-images having no overlapping areas; A video transcoding method comprising:
7. 2. The video transcoding method of claim 1, before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, increasing each initial resolution that does not satisfy the 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 each available resolution and each division resolution, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including initial sub-images with overlapping regions; encoding the initial sub-images by the preset encoder according to the target resolution of the target sub-images obtained by transcoding each initial sub-image 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 obtained bitstream to obtain a target bitstream; the encoding resolution is the product of a target resolution of a target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being a ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels that are added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image is increased to the encoding resolution; A video transcoding method comprising:
8. 3. The video transcoding method of claim 2, further comprising: before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, increasing each initial resolution that does not satisfy the 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 each available resolution and each division resolution, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including initial sub-images with overlapping regions; encoding the initial sub-images by the preset encoder according to the target resolution of the target sub-images obtained by transcoding each initial sub-image 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 obtained bitstream to obtain a target bitstream; the encoding resolution is the product of a target resolution of a target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being a ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels that are added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image is increased to the encoding resolution; A video transcoding method comprising:
9. 4. The video transcoding method of claim 3, before dividing the image to be divided into initial sub-images to be transcoded based on the initial resolutions, increasing each initial resolution that does not satisfy the 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 each available resolution and each division resolution, the available resolutions being initial resolutions that satisfy the byte alignment requirement, and each initial sub-image including initial sub-images with overlapping regions; encoding the initial sub-images by the preset encoder according to the target resolution of the target sub-images obtained by transcoding each initial sub-image 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 obtained bitstream to obtain a target bitstream; the encoding resolution is the product of a target resolution of a target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being a ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels that are added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image is increased to the encoding resolution; A video transcoding method comprising:
10. 8. A video transcoding method according to claim 7, comprising: before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, 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 the encoding resolution of the initial sub-image; If the determination result is NO, returning to determining the initial resolution of each initial sub-image to be transcoded; A video transcoding method comprising:
11. 9. A video transcoding method according to claim 8, comprising: before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, 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 the encoding resolution of the initial sub-image; If the determination result is NO, returning to determining the initial resolution of each initial sub-image to be transcoded; A video transcoding method comprising:
12. 10. The video transcoding method of claim 9, further comprising: before encoding the initial sub-image by the preset encoder according to the encoding resolution of the initial sub-image, 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 the encoding resolution of the initial sub-image; If the determination result is NO, returning to determining the initial resolution of each initial sub-image to be transcoded; A video transcoding method comprising:
13. 1. A video display method 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 12; 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.
10. A video display method comprising:
14. 14. A video display method as claimed in claim 13, comprising: decoding each of the target bitstreams to obtain a transcoded target sub-image corresponding to each of the target bitstreams; For each target bitstream, detecting whether a mark for a specified pixel exists 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 does not exist, decoding the target bitstream to obtain a transcoded target sub-image corresponding to the target bitstream.
10. A video display method comprising:
15. A video transcoding device, an image acquisition module for acquiring a first image of an initial image obtained by splicing together a plurality of video images as an image to be divided; a resolution determination module for determining an initial resolution of each initial sub-image to be transcoded, wherein 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 equal to 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 using the preset encoder to obtain each target bitstream; The resolution determination module specifically includes: determining a target resolution for each target sub-image after preset transcoding; 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 designated resolution of the first image, and set the initial resolution as an 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 corresponding to the initial resolution to the preset resolution; A video transcoding device comprising:
16. 16. A video transcoding device according to claim 15, a bitstream encapsulation module for adding a designation information structure to bitstream information of each target bitstream, obtaining each encapsulation target bitstream, encapsulating each encapsulation target bitstream, and adding the designation information structure to encapsulation information to obtain a bitstream of a multi-track stream related to the first image; A video transcoding device comprising:
17. 17. A video transcoding device according to claim 16, a bitstream copy module for copying the bitstream of the multi-track stream and transmitting the resulting bitstreams of the multi-track streams to a designated device; A video transcoding device comprising:
18. The video transcoding device according to any one of claims 15 to 17, The image segmentation module specifically includes: used to divide the image to be divided into initial sub-images to be transcoded without overlapping areas according to the determined initial resolutions; A video transcoding device comprising:
19. The video transcoding device according to any one of claims 15 to 17, 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, where the available resolutions are 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, the preset encoder encodes the initial sub-image according to the encoding resolution of the initial sub-image, and adds marks related to designated pixels to bitstream information of the obtained bitstream to obtain a target bitstream; the encoding resolution is the product of a target resolution of a target sub-image obtained by transcoding the initial sub-image and a specified multiple, the specified multiple being a ratio between the division resolution of the initial sub-image and the initial resolution of the initial sub-image, and the specified pixels are pixels that are added in the target sub-image obtained by transcoding the initial sub-image when the target resolution of the target sub-image obtained by transcoding the initial sub-image is increased to the encoding resolution; A video transcoding device comprising:
20. 20. A video transcoding device according to claim 19, and 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 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. A video transcoding device comprising:
21. 1. A video display device comprising: a bitstream acquisition module for acquiring 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 12; 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 the obtained target sub-images to obtain a target image; 1. A video display device comprising:
22. 22. A video display device according to claim 21, The bitstream decoding module specifically includes: For each target bitstream, detecting whether a mark for a specified pixel exists 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 does not exist, decoding the target bitstream to obtain a transcoded target sub-picture corresponding to the target bitstream.
1. A video display device comprising:
23. 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 stores computer programs The processor is adapted to execute a computer program stored in the memory to implement the steps of the video transcoding method according to any one of claims 1 to 12. An electronic device characterized by:
24. 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 stores computer programs The processor, when executing a computer program stored in the memory, is adapted to implement the steps of the video display method of claim 13. An electronic device characterized by:
25. 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 stores computer programs The processor, when executing a computer program stored in the memory, is adapted to implement the steps of the video display method of claim 14. An electronic device characterized by:
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