Video display method, device, medium, and electronic device
By acquiring and synthesizing video frames from both transparent and non-transparent video streams, the problem of poor display of transparent parts outside the canvas after multi-track video overlay was solved, thus improving the transparency effect of video display.
Patent Information
- Application Number
- CN202311199560.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-09-15
AI Technical Summary
In existing technologies, video clips generated after multi-track video overlay cannot maintain transparency in transparent areas outside the canvas, affecting the display effect.
By acquiring the transparent channel video stream and the non-transparent channel video stream, decoding and synthesizing video frames respectively, the transparent video frame is used as a mask for the non-transparent video, ensuring that the video has a transparent effect when displayed.
It effectively ensures the transparency of video clips during display, thus improving video display quality.
Smart Images

Figure CN119653129B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of image processing, and in particular, to a video display method and device, a medium and an electronic device. BACKGROUND
[0002] In the related art, there is an application scenario of superimposing multiple tracks of videos in a canvas to obtain a video segment containing multiple layers, and each layer is usually used to accommodate the video corresponding to one track.
[0003] The size of the canvas may be larger than the size of the video, and the generated video segment is based on the size of the entire canvas. Therefore, in order to improve the display effect of the video segment, the part other than the picture in the canvas can maintain a transparent effect during rendering. Therefore, if the video segment supports encoding, decoding and rendering with a transparent effect to ensure its display effect, it is a technical problem to be solved at present. SUMMARY
[0004] This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0005] In a first aspect, the present disclosure provides a video display method, comprising:
[0006] In response to a rendering operation on a target video stream, a transparent channel video stream and a non-transparent channel video stream encoded from the target video stream are obtained, the target video stream being obtained by superimposing at least the picture content of multiple layers in a preset canvas region, the transparent channel video stream being used to reflect the transparency information of the video frames in the target video stream, and the non-transparent channel video stream being used to reflect the color information of the video frames in the target video stream;
[0007] The transparent channel video stream and the non-transparent channel video stream are respectively decoded to obtain transparent video frames and non-transparent video frames belonging to the same time point;
[0008] The transparent video frames and the non-transparent video frames are synthesized to obtain the video frames in the reconstructed target video stream;
[0009] The reconstructed video frames are rendered, and the rendering result is displayed.
[0010] In a second aspect, the present disclosure provides a video display device, comprising:
[0011] The first obtaining module is configured to, in response to a rendering operation on a target video stream, obtain a transparent channel video stream and a non-transparent channel video stream obtained by encoding the target video stream, the target video stream being obtained by superimposing at least picture content of multiple layers in a preset canvas region, the transparent channel video stream being used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream being used to reflect color information of the video frame in the target video stream.
[0012] The decoding module is configured to decode the transparent channel video stream and the non-transparent channel video stream respectively to obtain a transparent video frame and a non-transparent video frame belonging to the same time point respectively.
[0013] The synthesizing module is configured to synthesize the transparent video frame and the non-transparent video frame to obtain a video frame in the reconstructed target video stream.
[0014] The first display module is configured to render the reconstructed video frame and display a rendering result.
[0015] In a third aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, the program being executed by a processing device to implement the steps of the method in the first aspect.
[0016] In a fourth aspect, the present disclosure provides an electronic device, comprising:
[0017] A storage device having a computer program stored thereon;
[0018] A processing device configured to execute the computer program in the storage device to implement the steps of the method in the first aspect.
[0019] According to the above technical solution, the target video stream is obtained by superimposing at least picture content of multiple layers in a preset canvas region, the transparent channel video stream and the non-transparent channel video stream are obtained by encoding the target video stream, the transparent channel video stream is used to reflect transparency information of a video frame in the target video stream, the non-transparent channel video stream is used to reflect color information of the video frame in the target video stream, and then, in response to a rendering operation on the target video stream, the transparent channel video stream and the non-transparent channel video stream are decoded respectively to obtain a transparent video frame and a non-transparent video frame belonging to the same time point, the transparent video frame and the non-transparent video frame are synthesized to implement consumption of the transparent video as a mask of the non-transparent video, so as to obtain a video frame in the reconstructed target video stream, and the transparent effect of the target video stream when displayed can be ensured.
[0020] Other features and advantages of the present disclosure will be described in detail in the following detailed description section. BRIEF DESCRIPTION OF DRAWINGS
[0021] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The same or similar components have the same or similar reference labels. It should be understood that the drawings are not necessarily to scale, with emphasis instead being placed upon illustrating the principles of the embodiments of the present disclosure. In the drawings:
[0022] Figure 1 is a schematic diagram of a video frame in a target video stream according to an exemplary embodiment of the present disclosure.
[0023] Figure 2 is a flowchart of a video display method according to an exemplary embodiment of the present disclosure.
[0024] Figure 3 is a block diagram of a video display apparatus according to an exemplary embodiment of the present disclosure.
[0025] Figure 4 is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While several embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art. It should be understood that the drawings and embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure.
[0027] It should be understood that each step recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to." The term "based on" is "based, at least in part, on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related definitions are given throughout the description below.
[0029] It should be noted that the terms "first", "second", and so on used in the present disclosure are merely used to distinguish different devices, modules, or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules, or units.
[0030] It should be noted that the modification of "one" and "multiple" mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.
[0031] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the messages or information.
[0032] It can be understood that, before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.
[0033] For example, in response to receiving the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can voluntarily choose whether to provide the personal information to the software or hardware such as electronic device, application program, server or storage medium, etc. that performs the operation of the technical solutions of the present disclosure according to the prompt information.
[0034] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user may, for example, be a pop-up window manner, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0035] It can be understood that the above notification and user authorization process is only illustrative, and does not limit the implementation manners of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0036] At the same time, it can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0037] Figure 1 is a schematic diagram of a video frame in a target video stream according to an example embodiment of the present disclosure. Referring to Figure 1 , content 1 and content 2 correspond to one track respectively, and the track can also be understood as a layer. In the canvas shown in Figure 1 , content 1 and content 2 are superimposed to obtain the video frame shown in Figure 1 , and in the video frame, the transparent area is an area that needs transparent effect when the video frame is displayed.
[0038] from Figure 1It can be known that the size of the canvas is greater than the size of the content 1 and the content 2, and the generated video clip is in the size of the entire canvas, therefore, it is necessary to ensure that the part other than the picture in the canvas can keep the transparent effect during rendering, therefore, if the video clip supports encoding, decoding and rendering with transparent effect to ensure the display effect is the technical problem to be solved at present.
[0039] Therefore, the embodiments of the present disclosure provide a video display method, device, medium and electronic equipment. The embodiments of the present disclosure are further explained and described below in combination with the drawings.
[0040] Figure 2 is a flowchart of a video display method according to an exemplary embodiment of the present disclosure, referring to Figure 2 The steps of the method can be executed by an electronic equipment, specifically, can be executed by a GPU (graphics processing unit) carried in the electronic equipment, and the GPU can realize the image rendering function under the control of a CPU (Central Processing Unit). Referring to Figure 2 The video display method can include the following steps:
[0041] Step 210, in response to a rendering operation for a target video stream, obtaining a transparent channel video stream and a non-transparent channel video stream obtained by encoding the target video stream, the target video stream being obtained by at least superimposing the picture content of a plurality of layers in a preset canvas region, the transparent channel video stream being used to reflect the transparency information of the video frames in the target video stream, and the non-transparent channel video stream being used to reflect the color information of the video frames in the target video stream;
[0042] Step 220, respectively decoding the transparent channel video stream and the non-transparent channel video stream to obtain transparent video frames and non-transparent video frames belonging to the same time respectively;
[0043] Step 230, synthesizing the transparent video frames and the non-transparent video frames to obtain the video frames in the reconstructed target video stream;
[0044] Step 240, rendering the reconstructed video frames and displaying the rendering result.
[0045] The target video stream can be a composite clip generated by at least superimposing the picture content of a plurality of layers in a preset canvas region in a video editing scene, and the composite clip can perform a unified editing operation on the picture content of the plurality of layers as a whole, for example, adding music and configuring video format, etc. The video frames in the composite clip can refer to the video frames shown in Figure 1 .
[0046] It is worth noting that the target video stream, the transparent channel video stream and the non-transparent channel video stream are all a kind of streaming data, which is a new data type, is an ordered data sequence item, and can be transmitted through the Internet. Streaming data can include multimedia content such as audio and video. Unlike the traditional download mode, streaming data can realize edge-to-edge broadcast, and users can start watching without waiting for the complete file to be downloaded. In this embodiment, the target video stream, the transparent channel video stream and the non-transparent channel video stream are an ordered image data sequence item.
[0047] In a possible manner, the user can trigger a rendering operation on the target video stream based on an application with a video editing function and / or a video playing function carried in the electronic device. The rendering operation can be understood as an operation of playing the target video stream.
[0048] In a possible manner, the picture content can be a sticker, a video, an image, and the like.
[0049] In the non-transparent channel video stream, the video frame can adopt an RGB format or a YUV format, and the non-transparent channel video stream includes color information for reflecting the video frame in the target video stream, which can be represented by RGB information. RGB information represents red, green and blue color information, and a variety of colors can be represented by adding them in different proportions. Color information can be represented by YUV information, in which the Y component represents brightness, and the U component and the V component represent chroma. The Y component can be separated and independent of the U component and the V component.
[0050] In the transparent channel video stream, the transparent channel video stream is used to reflect the transparency information of the video frame in the target video stream, and the transparency information is used to represent the transparency of the pixel. For example, the transparency can be 0 or 1. In an image, if the pixel value is P1 and the transparency is 0, the pixel point needs to be transparently displayed when the image is displayed. If the pixel value is P1 and the transparency is 1, the pixel point is displayed in the color corresponding to P1 when the image is displayed.
[0051] It is worth noting that the transparent video frame reflects the color information of each pixel of the corresponding video frame in the target video stream, and the non-transparent video frame reflects the transparency information of each pixel of the corresponding video frame in the target video stream. The transparent video frame and the non-transparent video frame are synthesized to obtain the video frame in the reconstructed target video stream.
[0052] In this embodiment, the rendering process of the image is not described herein.
[0053] By the technical solution, the target video is obtained by superimposing picture content of at least multiple layers in a preset canvas region, the target video stream is encoded to obtain a transparent channel video stream and a non-transparent channel video stream, the transparent channel video stream is used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream is used to reflect color information of the video frame in the target video stream. On this basis, in response to a rendering operation on the target video stream, the transparent channel video stream and the non-transparent channel video stream are decoded to obtain a transparent video frame and a non-transparent video frame belonging to the same time, respectively. The transparent video frame and the non-transparent video frame are synthesized to realize consumption of the transparent video as a mask of the non-transparent video, so that a video frame in a reconstructed target video stream is obtained, and the transparent effect required by the target video stream when displayed can be ensured.
[0054] In addition, this mode can also support mainstream media formats such as RGB format or YUV format, and most hardware supports the above encoding and decoding.
[0055] In a possible manner, the video display method can further include the following steps: in response to the encoding operation, obtaining the target video stream; and encoding the target video stream to obtain the transparent channel video stream and the non-transparent channel video stream.
[0056] For example, when a user uses an application program with a video editing function to make a target video stream, after making, the application program with the video editing function can trigger encoding of the target video stream, so that the transparent channel video stream and the non-transparent channel video stream of the target video stream can be obtained. In this way, the target video stream is convenient for rendering in other application programs or other electronic devices.
[0057] In a possible manner, the color information can be represented by first RGB information, and the step of synthesizing the transparent video frame and the non-transparent video frame to obtain a video frame in a reconstructed target video stream can be implemented by the following manner: performing pre-multiplication processing on the first RGB information of the non-transparent video frame and the transparency information of the transparent video frame, and obtaining the video frame in the reconstructed target video stream according to a result of the pre-multiplication processing.
[0058] In the embodiment, the expression of the pre-multiplication processing of the pixel can be represented by the following formula (1):
[0059] NewR1=OldR1*Alpha1 (1)
[0060] In the above formula (1), NewR1 represents an RGB value when the pixel is displayed, OldR1 represents an RGB value without the transparency information, and Alpha1 represents the transparency information, and Alpha1 takes a value of (0, 1).
[0061] Thus, the first RGB information of each pixel in the non-transparent video frame and the transparency information of the corresponding pixel in the transparent video frame are subjected to the premultiplication processing, so as to obtain the premultiplication processing result of each pixel, which is the NewR1 described above.
[0062] In a possible manner, the color information can be represented by YUV information, and the step of synthesizing the transparent video frame and the non-transparent video frame to obtain the video frame in the reconstructed target video stream can be implemented by the following manner: converting the YUV information of the non-transparent video frame into second RGB information; and performing the premultiplication processing on the second RGB information and the transparency information of the transparent video frame, and obtaining the video frame in the reconstructed target video stream according to the premultiplication processing result, wherein the transparency information of the transparent video frame is represented by the Y component of the transparent video frame.
[0063] The process of converting the YUV information into the RGB information can refer to related technologies, and will not be described herein.
[0064] The premultiplication processing in this embodiment is similar to the premultiplication processing in the above-described embodiments, and the expression of the premultiplication processing of the pixel in this embodiment can be represented by the following formula (2):
[0065] NewR2 = OldR2 * Alpha2 (2)
[0066] NewR2 represents the RGB value when the pixel is displayed, OldR2 represents the RGB value without the transparency information, and Alpha2 represents the transparency information, and Alpha2 takes a value of (0, 1).
[0067] It should be noted that the premultiplication processing result is rendered, and the corresponding rendering result is displayed.
[0068] In a possible manner, the preset video parameters of the transparent channel video stream and the non-transparent channel video stream are the same, and the preset video parameters can include a resolution, a display timestamp, and a GOP structure. The display timestamp and the GOP structure can ensure that the transparent video frame and the non-transparent video frame are aligned when being decoded and displayed, and the consistent resolution can improve the display effect of the video frame in the reconstructed target video stream when being displayed.
[0069] In a possible manner, the transparent video frame and the non-transparent video frame can be transmitted through the same pipeline. The pipeline is also referred to as a rendering pipeline, which is a parallel processing unit independent of each other in a display chip and is used for processing a graphic signal. The same pipeline is used to transmit the transparent video frame and the non-transparent video frame at the same time to a rendering unit for rendering, so as to display the rendering result.
[0070] In a possible implementation, the method further includes the following steps: rendering the non-transparent video frame and displaying the rendering result in the case that the non-transparent video frame does not have a corresponding transparent video frame.
[0071] It can be understood that, at some time, the picture content can fill the entire preset canvas region, at which time the display region without transparent effect is not needed, and therefore the corresponding transparency information does not need to be encoded.
[0072] Therefore, in the case that the non-transparent video frame does not have a corresponding transparent video frame, the non-transparent video frame is directly rendered without a synthesis operation, and the rendering result is displayed.
[0073] Based on the same inventive concept, the embodiment of the disclosure provides a video display device, Figure 3 is a block diagram of a video display device according to an example embodiment of the disclosure, referring to Figure 3 The device 300 includes:
[0074] The first obtaining module 301 is configured to obtain a transparent channel video stream and a non-transparent channel video stream encoded from a target video stream in response to a rendering operation on the target video stream, the target video stream being obtained by superimposing picture content of a plurality of layers in a preset canvas region, the transparent channel video stream being used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream being used to reflect color information of the video frame in the target video stream.
[0075] The decoding module 302 is configured to decode the transparent channel video stream and the non-transparent channel video stream respectively to obtain a transparent video frame and a non-transparent video frame belonging to the same time point respectively.
[0076] The synthesis module 303 is configured to synthesize the transparent video frame and the non-transparent video frame to obtain a video frame in the reconstructed target video stream.
[0077] The first display module 304 is configured to render the reconstructed video frame and display the rendering result.
[0078] In a possible implementation, the device 300 further includes:
[0079] The second obtaining module is configured to obtain the target video stream in response to an encoding operation.
[0080] The encoding module is configured to encode the target video stream to obtain the transparent channel video stream and the non-transparent channel video stream.
[0081] In a possible implementation, the color information is represented by first RGB information, and the synthesis module 303 is specifically configured to:
[0082] performing pre-multiplication processing on the first RGB information of the non-transparent video frame and the transparency information of the transparent video frame, to obtain a video frame in the reconstructed target video stream according to a result of the pre-multiplication processing.
[0083] In a possible implementation, the color information is represented by YUV information, and the synthesizing module 303 is specifically configured to:
[0084] convert the YUV information of the non-transparent video frame into second RGB information;
[0085] perform pre-multiplication processing on the second RGB information and the transparency information of the transparent video frame, to obtain a video frame in the reconstructed target video stream according to a result of the pre-multiplication processing, and the transparency information of the transparent video frame is represented by a Y component of the transparent video frame.
[0086] In a possible implementation, the preset video parameters of the transparent channel video stream and the non-transparent channel video stream are the same, and the preset video parameters include resolution, display timestamp and GOP structure.
[0087] In a possible implementation, the transparent video frame and the non-transparent video frame are transmitted through the same pipeline.
[0088] In a possible implementation, the apparatus 300 further includes:
[0089] The second displaying module is configured to, in a case where the non-transparent video frame does not have a corresponding transparent video frame, render the non-transparent video frame and display a rendering result.
[0090] For the implementation of the modules in the apparatus 300, refer to the related embodiments described above, which will not be repeated here.
[0091] Based on the same inventive concept, the embodiments of the present disclosure further provide a computer readable medium having a computer program stored thereon, which is executed by a processing apparatus to implement the steps of the video display method.
[0092] Based on the same inventive concept, the embodiments of the present disclosure further provide an electronic device, which includes:
[0093] a storage apparatus having a computer program stored thereon;
[0094] a processing apparatus configured to execute the computer program in the storage apparatus to implement the steps of the video display method.
[0095] The following refers to Figure 4This diagram illustrates a structural schematic of an electronic device 400 suitable for implementing embodiments of the present disclosure. The terminal devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0096] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0097] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0098] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.
[0099] It is noted that the aforementioned computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example and without limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a computer-readable program code transmitted by a computer-readable storage medium or carried by a carrier wave in a baseband or as part of a carrier wave. Such a propagated computer-readable signal medium can take various forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can be used to carry or store a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wire, cable, RF (radio frequency), or the like, or any suitable combination of the foregoing.
[0100] In some embodiments, the electronic device can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications of any form or medium (e.g., a communications network). Examples of communications networks include local area networks ("LAN"), wide area networks ("WAN"), internetworks (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future developed networks.
[0101] The aforementioned computer-readable medium can be contained in the aforementioned electronic device; or can exist separately without being assembled into the electronic device.
[0102] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: in response to a rendering operation for a target video stream, the target video stream being obtained by superimposing picture content of a plurality of layers in a preset canvas region, acquire a transparent channel video stream and a non-transparent channel video stream encoded from the target video stream, the transparent channel video stream being used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream being used to reflect color information of the video frame in the target video stream; respectively decode the transparent channel video stream and the non-transparent channel video stream to respectively obtain a transparent video frame and a non-transparent video frame belonging to the same time; synthesize the transparent video frame and the non-transparent video frame to obtain a video frame in the target video stream that is reconstructed; and render the reconstructed video frame and display a rendering result.
[0103] Computer program code for carrying out operations of the present disclosure can be written in any of one or more programming languages or combinations of languages including object or visual programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0104] The flow and block diagrams in the drawings show architectural, functional, and operational representations of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0105] The modules described in the embodiments of the present disclosure can be implemented by software or by hardware. In some cases, the name of the module does not constitute a limitation on the module itself.
[0106] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting examples of exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0107] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of a program of a processor, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] The above description is merely exemplary of the disclosure and the application of the principles thereof. It is not intended to limit the disclosure to the specific form set forth above. Rather, the disclosure is to cover by the appended claims whatever falls within the true scope of the disclosure, including equivalents. For example, although specific features are described above, one of ordinary skill in the art will appreciate that the features can be combined with other features disclosed herein (but not limited to) to form a technical solution.
[0109] Moreover, although the operations of some of the disclosed examples are described in a particular, sequential order for convenient presentation, it should be understood that this manner of description encompasses rearrangement of otherwise illustrated operations without departing from the scope of the disclosure. For example, operations described sequentially can in some cases reasonably be performed in parallel, or in a different order. Also, descriptions of features in the above-discussion are not to be taken as limiting—other features can be included within the scope of the disclosure.
[0110] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With respect to the devices in the above-described embodiments, in which various modules perform operations, the specific manner in which the various modules perform the operations has been described in detail in the embodiments relating to the method. Here, no detailed explanation will be given.
Claims
1. A video display method characterized by, The method comprises the following steps: in response to a rendering operation for a target video stream, obtaining a transparent channel video stream and a non-transparent channel video stream encoded from the target video stream, the target video stream being obtained by superimposing picture content of at least a plurality of layers in a preset canvas region, the transparent channel video stream being used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream being used to reflect color information of the video frame in the target video stream; decoding the transparent channel video stream and the non-transparent channel video stream respectively to obtain a transparent video frame and a non-transparent video frame belonging to the same time point respectively; synthesizing the transparent video frame and the non-transparent video frame to obtain a video frame in the reconstructed target video stream; rendering the reconstructed video frame and displaying a rendering result.
2. The method of claim 1, wherein, The method further comprises the following steps: in response to an encoding operation, obtaining the target video stream; encoding the target video stream to obtain the transparent channel video stream and the non-transparent channel video stream.
3. The method of claim 1, wherein, The color information is represented by first RGB information, and the step of synthesizing the transparent video frame and the non-transparent video frame to obtain a video frame in the reconstructed target video stream comprises the following steps: performing pre-multiplication processing on the first RGB information of the non-transparent video frame and the transparency information of the transparent video frame, and obtaining a video frame in the reconstructed target video stream according to a result of the pre-multiplication processing.
4. The method of claim 1, wherein, The color information is represented by YUV information, and the step of synthesizing the transparent video frame and the non-transparent video frame to obtain a video frame in the reconstructed target video stream comprises the following steps: converting YUV information of the non-transparent video frame into second RGB information; performing pre-multiplication processing on the second RGB information and the transparency information of the transparent video frame, and obtaining a video frame in the reconstructed target video stream according to a result of the pre-multiplication processing, the transparency information of the transparent video frame being represented by a Y component of the transparent video frame.
5. The method of claim 1, wherein, The preset video parameters of the transparent channel video stream and the non-transparent channel video stream are the same, and the preset video parameters comprise resolution, display timestamp and GOP structure.
6. The method of claim 1, wherein, The transparent video frame and the non-transparent video frame are transmitted through the same pipeline.
7. The method of claim 1, wherein, The method further comprises the following steps: in a case where the non-transparent video frame does not have a corresponding transparent video frame, rendering the non-transparent video frame and displaying a rendering result.
8. A video display device, characterized in that: a first obtaining module is configured to, in response to a rendering operation for a target video stream, obtain a transparent channel video stream and a non-transparent channel video stream encoded from the target video stream, the target video stream being obtained by superimposing picture content of at least a plurality of layers in a preset canvas region, the transparent channel video stream being used to reflect transparency information of a video frame in the target video stream, and the non-transparent channel video stream being used to reflect color information of the video frame in the target video stream; a decoding module, configured to decode the transparent channel video stream and the non-transparent channel video stream respectively to obtain transparent video frames and non-transparent video frames respectively belonging to the same time instant; a synthesizing module, configured to synthesize the transparent video frames and the non-transparent video frames to obtain video frames in the reconstructed target video stream; a first displaying module, configured to render the reconstructed video frames and display a rendering result.
9. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by a processing device to implement the steps of the method in any one of claims 1-7.
10. An electronic device, comprising: comprising: a storage device, on which a computer program is stored; a processing device, configured to execute the computer program in the storage device to implement the steps of the method in any one of claims 1-7.
Citation Information
Patent Citations
Video image processing method, computer equipment and storage medium
CN115396730A
Page display method and device, equipment, storage medium and product
CN116527983A