Video processing method and device
By dividing the video data to be encoded into two streams of color channels and transparency channels, and encoding and merging them using high-efficiency video encoding standards, the problem that the prior art cannot generate HEVC-With-Alpha video code stream is solved, and efficient video processing and code stream fusion is achieved.
Patent Information
- Application Number
- CN202311815983.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art cannot directly form the HEVC-With-Alpha video code stream, and it is impossible to simply realize the fusion of the brightness chrominance (YUV) channel and the Alpha channel, resulting in low video processing efficiency.
The video data to be encoded is divided into a first video stream and a second video stream, the first video stream includes color channel data, and the second video stream includes transparency channel data. Two video streams are encoded by an encoder with the same encoding parameters, and then the encoding results are modified and merged according to the high-efficiency video encoding standard to generate a video encoding file that complies with the HEVC-With-Alpha standard.
The generation of HEVC-With-Alpha video code stream is realized, which improves the efficiency of video processing, can effectively blend color channels and transparent channels, and generate high-efficiency video coded files.
Smart Images

Figure CN120223899A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical fields of computers and network communications, and particularly to a video processing method and apparatus. Background Art
[0002] Currently, the entire process of generating a High Efficiency Video Coding with Alpha (HEVC-With-Alpha) video bitstream is completely completed by the encoder side, that is, the encoder generates the entire bitstream according to the coding standard. This process depends on the encoder. At present, most hardware encoders do not support directly outputting the HEVC-With-Alpha format, so it is impossible to generate a video in the HEVC-With-Alpha format.
[0003] In the prior art, it is impossible to simply implement the fusion of the Luma Chrominance (YUV) channel and the Alpha channel, and the efficiency is low when forming a standard HEVC-With-Alpha video bitstream. Summary of the Invention
[0004] Embodiments of the present disclosure provide a video processing method and apparatus to solve the problem that it is currently impossible to directly form a HEVC-With-Alpha video bitstream.
[0005] In a first aspect, embodiments of the present disclosure provide a video processing method, including:
[0006] Dividing the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes transparency channel data in the video data to be encoded;
[0007] Encoding the first video stream through a first encoder to obtain a first encoding result, and encoding the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder use the same encoding parameters;
[0008] According to the High Efficiency Video Coding standard, performing a parameter modification operation on the first encoding result to obtain a third encoding result, performing a parameter modification operation on the second encoding result to obtain a fourth encoding result, and merging the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the High Efficiency Video Coding standard;
[0009] Generating a video encoding file according to the target encoding result.
[0010] Second aspect, embodiments of the present disclosure provide a video processing device, including:
[0011] A first processing unit, configured to divide the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes alpha channel data in the video data to be encoded;
[0012] A second processing unit, configured to encode the first video stream through a first encoder to obtain a first encoding result, and encode the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder adopt the same encoding parameters;
[0013] A third processing unit, configured to perform parameter modification operations on the first encoding result according to the High Efficiency Video Coding (HEVC) standard to obtain a third encoding result, perform parameter modification operations on the second encoding result to obtain a fourth encoding result, and merge the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the HEVC standard;
[0014] A fourth processing unit, configured to generate a video encoding file according to the target encoding result.
[0015] Third aspect, embodiments of the present disclosure provide an electronic device, including: a processor and a memory;
[0016] The memory stores computer-executable instructions;
[0017] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible designs of the first aspect above.
[0018] Fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the video processing method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0019] Fifth aspect, embodiments of the present disclosure provide a computer program product, including a computer program, and when the computer program is executed by the processor, the video processing method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0020] The video processing method and device provided in this embodiment divide the video data to be encoded into a first video stream and a second video stream. Playing the video encoding file, the first video stream includes the color channel data in the video data to be encoded of the video encoding file, and the second video stream of the playing video encoding file includes the transparency channel data in the video data to be encoded of the video encoding file. Then, the first encoder encodes the first video stream to obtain a first encoding result, and the second encoder encodes the second video stream of the playing video encoding file to obtain a second encoding result. Among them, the first encoder of the playing video encoding file and the second encoder of the playing video encoding file use the same encoding parameters. Then, according to the High Efficiency Video Coding (HEVC) standard, parameter modification operations are performed on the first encoding result of the playing video encoding file to obtain a third encoding result, and parameter modification operations are performed on the second encoding result of the playing video encoding file to obtain a fourth encoding result. Then, the third encoding result of the playing video encoding file and the fourth encoding result of the playing video encoding file are merged to obtain a target encoding result. Among them, the bitstream distribution of the target encoding result of the playing video encoding file conforms to the HEVC standard. Finally, a video encoding file is generated according to the target encoding result of the playing video encoding file. In this technical solution, after dividing the video data to be encoded into two streams, parameter modification is respectively performed using the HEVC standard to achieve the fusion of the color channel and the transparency channel, and a transparency-high efficiency video encoding file corresponding to the video data to be encoded is obtained. Description of the Drawings
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0022] Figure 1 It is a video image without a transparency channel provided by the prior art;
[0023] Figure 2 It is a schematic flowchart of the video processing method provided by the embodiment of the present disclosure Figure 1 ;
[0024] Figure 3 It is a video image with a transparency channel provided by the embodiment of the present disclosure;
[0025] Figure 4 It is a schematic flowchart of the video processing method provided by the embodiment of the present disclosure Figure 2 ;
[0026] Figure 5 It is a schematic flowchart of the video processing method provided by the embodiment of the present disclosureFigure 3 ;
[0027] Figure 6 Schematic structural diagram of the video processing device provided by an embodiment of the present disclosure;
[0028] Figure 7 Schematic structural diagram of the electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.
[0030] Currently, the entire process of generating a High Efficiency Video Coding with Alpha (HEVC-With-Alpha) video bitstream is completely completed at the encoder end, that is, the encoder generates the entire bitstream according to the coding standard. This process depends on the encoder. Currently, most hardware encoders do not support directly outputting the HEVC-With-Alpha format, so it is impossible to generate a video in the HEVC-With-Alpha format.
[0031] In the prior art, it is impossible to simply implement the fusion of the Luma Chrominance (YUV) channel and the Alpha channel, and the efficiency is low when forming a standard HEVC-With-Alpha video bitstream.
[0032] For example, Figure 1 A video image without an alpha channel provided by the prior art. As Figure 1 shown, the image B in the next layer is covered by the image A in the upper layer and its channel.
[0033] That is, in the prior art, it is impossible to implement the fusion of the Luma Chrominance (YUV) channel (i.e., the color channel) and the Alpha channel, so as to form a standard HEVC-With-Alpha video bitstream, and thus it has become an urgent technical problem to more accurately implement video processing.
[0034] In view of the above technical problems, the technical concept of the inventor is as follows: In the prior art, since the existing encoder cannot support the output of the HEVC-With-Alpha format, if the Red-Green-Blue-Alpha (RGBA) video to be encoded is divided into two streams at this time, namely the Red-Green-Blue (RGB) video stream and the transparency video stream, and encoded using the encoder, then according to the standard document, the extension data in the Video Parameter Set (VPS) of the RGB video stream is modified, and the Sequence Parameter Set (SPS) and Picture Parameter Set (PPS) in the transparency video stream are modified, etc. After that, the modification results are merged to obtain a standard HEVC-With-Alpha video bitstream.
[0035] Among them, information such as SPS and PPS are parameter sets in the Alpha channel parameter set, and the extension data in VPS is data in the YUV channel parameter set.
[0036] It should be understood that the execution entity electronic device of the present disclosure can be a server, a terminal device (for example, a computer, a mobile phone, a calculator, etc.).
[0037] The following are embodiments of the method, device, equipment, and medium involved in the present disclosure. In each method embodiment, the technical solutions can be combined with each other.
[0038] Figure 2 Schematic diagram of the video processing method flow provided by the embodiment of the present disclosure Figure 1 , refer to Figure 2 , the processing method of this service function includes:
[0039] Step 21: Divide the video data to be encoded into a first video stream and a second video stream;
[0040] Among them, the first video stream includes the color channel data in the video data to be encoded, and the second video stream includes the transparency channel data in the video data to be encoded.
[0041] In this step, the video data to be encoded is divided into a video stream of color channel data and a video stream of transparency channel data. The implementation method can be to perform separate processing through image processing software, that is, input the video data to be encoded into the image processing software, and output the video stream of color channel data and the video stream of transparency channel data, that is, the first video stream and the second video stream.
[0042] In a possible implementation, the video data to be encoded is a Red Green Blue Alpha (RGBA) video.
[0043] Step 22: Encode the first video stream through a first encoder to obtain a first encoded result, and encode the second video stream through a second encoder to obtain a second encoded result;
[0044] Among them, the first encoder and the second encoder use the same encoding parameters.
[0045] In this step, after obtaining the first video stream corresponding to the color channel data and the second video stream corresponding to the alpha channel data as described above, the first video stream and the second video stream are respectively input into the first encoder and the second encoder with the same encoding parameters, and the first encoded result corresponding to the first video stream and the second encoded result corresponding to the second video stream are output.
[0046] That is, in the above possible implementation, after determining the RGB video stream and the alpha video stream according to the RGBA video as described above, the RGB video stream and the alpha video stream are respectively input into a hardware encoder (in a possible implementation, the first encoder and the second encoder can be the same encoder), and the first encoded result corresponding to the RGB video stream and the second encoded result corresponding to the alpha video stream are obtained.
[0047] Among them, the same encoding parameters, such as compression ratio, resolution, frame rate, etc., can maintain the consistency between the two channels for independent RGB and Alpha channel encoding.
[0048] Step 23: Modify the parameters of the first encoded result according to the High Efficiency Video Coding (HEVC) standard to obtain a third encoded result, modify the parameters of the second encoded result to obtain a fourth encoded result, and merge the third encoded result and the fourth encoded result to obtain a target encoded result;
[0049] Among them, the bitstream distribution of the target encoded result conforms to the High Efficiency Video Coding standard;
[0050] In this step, the High Efficiency Video Coding standard refers to the official document or specification of the relevant video coding standard. It can refer to Annex F of the H.265 / HEVC (High Efficiency Video Coding) standard document, which details various technologies and specifications related to video coding.
[0051] Under this implementation, the High Efficiency Video Coding standard is used to modify the parameters of the first encoded result and the second encoded result respectively.
[0052] Among them, modifying the parameters of the second encoded result means changing the transparency of the pixels in the transparency video (i.e., the Alpha value). Transparency is a property that describes the visibility of pixels or objects, ranging from completely transparent (completely invisible) to completely opaque (completely visible). By modifying the transparency parameters, the visibility of each pixel in the video can be controlled to achieve specific visual effects. For example, by adjusting the transparency parameters, an object in a video can be semi-transparently superimposed on the background to produce a dreamy effect.
[0053] Modifying the parameters of the first encoded result means changing the color of the pixels in the video. Red, Green, Blue (RGB) is a color model. By adjusting the intensities of red, green, and blue light, various colors can be mixed. Modifying the RGB parameters can change the color of each pixel in the video. For example, increasing the red parameter can make the pixel appear red, increasing the green parameter can make the pixel appear green, and increasing the blue parameter can make the pixel appear blue. By adjusting the RGB parameters, effects such as color correction, color balance, and color separation can be achieved.
[0054] Optionally, according to the High Efficiency Video Coding standard, an implementation of obtaining the third encoded result by performing a parameter modification operation on the first encoded result can be: modifying the extension data in the video parameter set of the first encoded result to the standard parameter set corresponding to High Efficiency Video Coding in the High Efficiency Video Coding standard to obtain the third encoded result.
[0055] In this implementation, changing the extension data of the VPS in the YUV encoding to the standard parameter set in the High Efficiency Video Coding standard means reorganizing and representing the extension information in the YUV-encoded video sequence in a standard way as a set of parameters for describing specific functions or standard variants. This step will ensure that the extension data of the VPS in the YUV encoding is expressed in a standard format and manner so that it can be correctly parsed and processed by a standard decoder.
[0056] Optionally, according to the High Efficiency Video Coding standard, an implementation of obtaining the fourth encoded result by performing a parameter modification operation on the second encoded result can be: modifying the sequence parameter set and the picture parameter set in the second encoded result to the index values corresponding to transparency in the High Efficiency Video Coding standard to obtain the fourth encoded result.
[0057] In this implementation, information such as SPS in the Alpha channel parameter set is rewritten as the index specified in the standard document, which means moving the parameter set of the Alpha channel from its previous position to a new target position and using the index value to reference the position of these parameter sets. This can more effectively manage and decode the information of the Alpha channel, enabling it to be stored and accessed independently from the parameter set of the main video sequence. This can more effectively manage and reference these parameter sets so that the relevant information of the Alpha channel can be correctly used and parsed during subsequent decoding processes.
[0058] For example, the base layer NAL unit with nuh_layer_id = 0 is changed to: Alpha layer NAL unit with nuh_layer_id = 1: xxxx.
[0059] Furthermore, the third encoding result and the fourth encoding result are merged. The implementation of the merge can be: arranging according to the standard bitstream distribution method, merging the third encoding result and the fourth encoding result to obtain the merged target encoding result.
[0060] Step 24: Generate a video encoding file according to the target encoding result.
[0061] In this step, the target encoding result obtained after merging the above-mentioned third encoding result and fourth encoding result is encapsulated to obtain the video encoding file corresponding to the video data to be encoded.
[0062] That is, an HEVC-With-Alpha file is obtained.
[0063] Optionally, after this step, it is also possible to: use a playback device to play the video encoding file; during the process of playing the video encoding file, detect whether there is a transparent channel in the graphical user interface of the playback device.
[0064] In this implementation, in order to verify the effect of the HEVC-With-Alpha file, the HEVC-With-Alpha file can be played using a playback device, and it is detected whether there is a transparent channel in the graphical user interface of the playback device. If it exists, it indicates that the implementation effect is correct. For example, as shown in the following Figure 3 shown.
[0065] Optionally, the video encoding file is a file in the format of the digital audio compression encoding standard (MPEG-4, MP4) or a movie format file (QuickTime Movie, MOV).
[0066] In one implementation, encapsulating the target encoding result into an MP4 means integrating the encoded video and audio data streams into an MP4 container file for playback and processing on a player or other device. This process involves saving the encoded video and audio data, as well as the relevant metadata, in specific locations and formats within the MP4 file to achieve video encapsulation and storage.
[0067] Optionally, Figure 3 This is the video image with a transparent channel provided by the embodiments of the present disclosure. As Figure 3 shown, the image B in the next layer is not covered by the channel corresponding to the image A in the previous layer.
[0068] The video processing method provided by the embodiments of the present disclosure divides the video data to be encoded into a first video stream and a second video stream. Playing the first video stream of the video encoding file includes playing the color channel data in the video data to be encoded in the video encoding file. Playing the second video stream of the video encoding file includes playing the transparency channel data in the video data to be encoded in the video encoding file. And encoding the first video stream through a first encoder to obtain a first encoding result, encoding the second video stream of the played video encoding file through a second encoder to obtain a second encoding result; wherein, the first encoder of the played video encoding file and the second encoder of the played video encoding file adopt the same encoding parameters. Then, according to the High Efficiency Video Coding (HEVC) standard, parameter modification operations are performed on the first encoding result of the played video encoding file to obtain a third encoding result, parameter modification operations are performed on the second encoding result of the played video encoding file to obtain a fourth encoding result, and the third encoding result of the played video encoding file and the fourth encoding result of the played video encoding file are merged to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result of the played video encoding file conforms to the HEVC standard. Finally, a video encoding file is generated according to the target encoding result of the played video encoding file. In this technical solution, after dividing the video data to be encoded into two streams, parameter modification is respectively performed using the HEVC standard to achieve the fusion of the color channel and the transparent channel, and a transparency-HEVC video encoding file corresponding to the video data to be encoded is obtained.
[0069] Based on the above embodiments, Figure 4 This is a schematic flow chart of the video processing method provided by the embodiments of the present disclosure Figure 2 , referring to Figure 4 , in the processing method of this service function, step 23 can be implemented as follows:
[0070] Step 41: Arrange according to the standard bitstream distribution method, and merge the third encoding result and the fourth encoding result to obtain the merged target encoding result;
[0071] Among them, the standard bitstream distribution method refers to the structure and distribution method of bitstream data stipulated in the video coding standard.
[0072] Specifically, in the H.265 / HEVC standard, the bitstream distribution method includes data structures at different levels such as VPS, SPS, and PPS, and stipulates their order, block division method, and organization form.
[0073] Under this implementation, using the standard bitstream distribution method for arrangement, the third coding result corresponding to the above-determined first video stream and the fourth coding result corresponding to the second video stream are merged to obtain the merged target coding result.
[0074] Step 42: Perform encapsulation processing on the merged target coding result to generate a video coding file corresponding to the video data to be encoded.
[0075] That is, encapsulate the merged target coding result to obtain a video coding file, which can be a HEVC-With-Alpha file.
[0076] For example, save the encoded bitstream (i.e., the target coding result) as a temporary file (usually a.bin or.dat file), and create a new MP4 or MOV file as the top-level file of the container. Then add the audio and video bitstream data to the container file, and add other metadata as needed, such as title, author, description, duration, etc. Then add other tracks such as subtitle tracks and audio tracks as needed. Finally, after completing the file encapsulation, save and name the MP4 or MOV file.
[0077] The video processing method provided by the embodiments of the present disclosure arranges according to the standard bitstream distribution method, merges the third coding result and the fourth coding result to obtain the merged target coding result, and performs encapsulation processing on the merged target coding result to generate a video coding file corresponding to the video data to be encoded. This technical solution merges the two coding results after modifying the parameters, so as to obtain a high-efficiency video coding file with transparency.
[0078] Based on the above embodiments, Figure 5 This is a schematic flowchart of the video processing method provided by the embodiments of the present disclosure Figure 3 Refer to Figure 5 The processing method of this service function may include the steps:
[0079] Step 1: Start;
[0080] Step 2: RGBA video stream; and respectively execute Step 3 and Step 6;
[0081] Among them, the RGBA video to be encoded is divided into two streams, and two encoders with exactly the same parameters are created for separate encoding.
[0082] Step 3, YUV channel;
[0083] Step 4, create an encoder;
[0084] Step 5, modify the VPS information in the YUV channel; and execute Step 9;
[0085] Among them, the extension data in the VPS of the YUV encoding is rewritten into the parameter set in the standard, referring to the part in T-REC-H.265-201504Annex E;
[0086] Step 6, Alpha channel;
[0087] Step 7, create an encoder;
[0088] Among them, the parameters of the encoder in Step 4 and the encoder in Step 7 are exactly the same;
[0089] Step 8, modify the Network Abstract Layer Unit (NALU) information of the video parameter set in the Alpha channel;
[0090] According to the standard document, the SPS, PPS and other information in the Alpha channel are respectively rewritten to the target index value and then rewritten.
[0091] Step 9, merge the bitstreams;
[0092] Among them, the results of Step 5 and Step 8 are merged;
[0093] Step 10, encapsulate into MP4 or MOV;
[0094] Step 11, end.
[0095] The video processing method provided by the embodiments of the present disclosure has technical solutions and technical effects similar to those in the above embodiments, and will not be elaborated here.
[0096] Based on the above method embodiments, Figure 6 is a schematic structural diagram of a video processing device provided by the embodiments of the present disclosure. As Figure 6 shown, the video processing device includes:
[0097] The first processing unit 61 is used to divide the video data to be encoded into a first video stream and a second video stream. The first video stream includes the color channel data in the video data to be encoded, and the second video stream includes the transparency channel data in the video data to be encoded;
[0098] A second processing unit 62, configured to encode a first video stream through a first encoder to obtain a first encoding result, and encode a second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder adopt the same encoding parameters;
[0099] A third processing unit 63, configured to perform parameter modification operations on the first encoding result according to the High Efficiency Video Coding (HEVC) standard to obtain a third encoding result, perform parameter modification operations on the second encoding result to obtain a fourth encoding result, and merge the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the HEVC standard;
[0100] A fourth processing unit 64, configured to generate a video encoding file according to the target encoding result.
[0101] According to one or more embodiments of the present disclosure, the third processing unit 63 performs parameter modification operations on the first encoding result according to the HEVC standard to obtain a third encoding result, specifically for:
[0102] Modify the extended data in the video parameter set in the first encoding result to the standard parameter set corresponding to HEVC in the HEVC standard to obtain a third encoding result.
[0103] According to one or more embodiments of the present disclosure, the third processing unit 63 performs parameter modification operations on the second encoding result according to the HEVC standard to obtain a fourth encoding result, specifically for:
[0104] Modify the sequence parameter set and the picture parameter set in the second encoding result to the index values corresponding to transparency in the HEVC standard to obtain a fourth encoding result.
[0105] According to one or more embodiments of the present disclosure, the third processing unit 63 merges the third encoding result and the fourth encoding result to obtain a target encoding result, specifically for:
[0106] Arrange and merge the third encoding result and the fourth encoding result according to the standard bitstream distribution method to obtain the merged target encoding result.
[0107] According to one or more embodiments of the present disclosure, the fourth processing unit 64 is specifically for:
[0108] Perform encapsulation processing on the merged target encoding result to generate a video encoding file corresponding to the video data to be encoded.
[0109] According to one or more embodiments of the present disclosure, the fourth processing unit 64 is further for:
[0110] Play a video encoding file using a playback device;
[0111] During the process of playing the video encoding file, detect whether there is a transparent channel in the graphical user interface of the playback device.
[0112] According to one or more embodiments of the present disclosure, the video encoding file is a digital audio compression encoding standard format file or a film format file.
[0113] The video processing device provided by the embodiments of the present disclosure has technical solutions and technical effects similar to those in the above embodiments, which will not be elaborated here.
[0114] To implement the above embodiments, the embodiments of the present disclosure also provide an electronic device. Figure 7 It is a schematic structural diagram of the electronic device provided by the embodiments of the present disclosure. Refer to Figure 7 , and this electronic device can be a terminal device or a server.
[0115] Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs for short), tablet computers (PADs for short), portable media players (PMPs for short), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0116] As Figure 7 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 71, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 72 or the program loaded from the storage device 78 into the random access memory (RAM) 73. In the RAM 73, various programs and data required for the operation of the electronic device are also stored. The processing device 71, the ROM 72, and the RAM 73 are connected to each other through a bus 74. The input / output (I / O) interface 75 is also connected to the bus 74.
[0117] Typically, the following devices can be connected to the I / O interface 75: input devices 76 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 77 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 78 including, for example, magnetic tapes, hard disks, etc.; and a communication device 79. The communication device 79 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 an electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0118] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 79, or installed from the storage device 78, or installed from the ROM 72. When the computer program is executed by the processing device 71, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0119] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0120] The above computer-readable medium can be included in the above electronic device; or it can exist separately and not be assembled into the electronic device.
[0121] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the above embodiments.
[0122] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The foregoing programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may 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 case of a remote computer, the remote computer may 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 alternatively, may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0124] The units involved in the embodiments described in this disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation on the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".
[0125] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, by way of non-limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store 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. The 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 would include an electrical connection based on one or more wires, a portable computer disk, 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.
[0127] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a video processing method, including:
[0128] Dividing the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes alpha channel data in the video data to be encoded;
[0129] Encoding the first video stream through a first encoder to obtain a first encoding result, and encoding the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder use the same encoding parameters;
[0130] According to the High Efficiency Video Coding (HEVC) standard, performing a parameter modification operation on the first encoding result to obtain a third encoding result, performing a parameter modification operation on the second encoding result to obtain a fourth encoding result, and merging the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the HEVC standard;
[0131] Generating a video encoding file according to the target encoding result.
[0132] According to one or more embodiments of the present disclosure, the performing a parameter modification operation on the first encoding result to obtain a third encoding result according to the HEVC standard includes:
[0133] Modifying the extended data in the video parameter set in the first encoding result to the standard parameter set corresponding to High Efficiency Video Coding in the HEVC standard to obtain the third encoding result.
[0134] According to one or more embodiments of the present disclosure, performing a parameter modification operation on the second encoding result according to the High Efficiency Video Coding standard to obtain a fourth encoding result includes:
[0135] Modifying the sequence parameter set and the picture parameter set in the second encoding result to the index value corresponding to transparency in the High Efficiency Video Coding standard to obtain the fourth encoding result.
[0136] According to one or more embodiments of the present disclosure, merging the third encoding result and the fourth encoding result to obtain a target encoding result includes:
[0137] Arranging according to the standard bitstream distribution method, and merging the third encoding result and the fourth encoding result to obtain the merged target encoding result.
[0138] According to one or more embodiments of the present disclosure, generating a video encoding file according to the target encoding result includes:
[0139] Performing encapsulation processing on the merged target encoding result to generate a video encoding file corresponding to the video data to be encoded.
[0140] According to one or more embodiments of the present disclosure, the method further includes:
[0141] Playing the video encoding file by using a playback device;
[0142] During the process of playing the video encoding file, detecting whether there is a transparency channel in the graphical user interface of the playback device.
[0143] According to one or more embodiments of the present disclosure, the video encoding file is a digital audio compression coding standard format file or a film format file.
[0144] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a video processing device, including:
[0145] A first processing unit, configured to divide the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes transparency channel data in the video data to be encoded;
[0146] A second processing unit, configured to encode the first video stream through a first encoder to obtain a first encoding result, and encode the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder use the same encoding parameters;
[0147] A third processing unit, configured to perform parameter modification operations on the first encoding result according to the High Efficiency Video Coding (HEVC) standard to obtain a third encoding result, perform parameter modification operations on the second encoding result to obtain a fourth encoding result, and merge the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the HEVC standard;
[0148] A fourth processing unit, configured to generate a video encoding file according to the target encoding result.
[0149] According to one or more embodiments of the present disclosure, the third processing unit performs parameter modification operations on the first encoding result according to the HEVC standard to obtain a third encoding result, specifically:
[0150] Modify the extended data in the video parameter set of the first encoding result to the standard parameter set corresponding to HEVC in the HEVC standard to obtain the third encoding result.
[0151] According to one or more embodiments of the present disclosure, the third processing unit performs parameter modification operations on the second encoding result according to the HEVC standard to obtain a fourth encoding result, specifically:
[0152] Modify the sequence parameter set and the picture parameter set in the second encoding result to the index values corresponding to transparency in the HEVC standard to obtain the fourth encoding result.
[0153] According to one or more embodiments of the present disclosure, the third processing unit merges the third encoding result and the fourth encoding result to obtain a target encoding result, specifically:
[0154] Arrange according to the standard bitstream distribution method, and merge the third encoding result and the fourth encoding result to obtain the merged target encoding result.
[0155] According to one or more embodiments of the present disclosure, the fourth processing unit specifically:
[0156] Perform encapsulation processing on the merged target encoding result to generate a video encoding file corresponding to the video data to be encoded.
[0157] According to one or more embodiments of the present disclosure, the fourth processing unit is further configured to:
[0158] Play the video encoding file by using a playback device;
[0159] During the process of playing the video encoding file, detect whether there is a transparent channel in the graphical user interface of the playback device.
[0160] According to one or more embodiments of the present disclosure, the video encoding file is a digital audio compression encoding standard format file or a film format file.
[0161] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one processor and a memory;
[0162] The memory stores computer-executable instructions;
[0163] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect above and various possible designs of the first aspect.
[0164] In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the video processing method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0165] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product, including a computer program, and when the computer program is executed by the processor, the video processing method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0166] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0167] In addition, although the operations are depicted in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0168] 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. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A video processing method, characterized in that, Including: Dividing the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes alpha channel data in the video data to be encoded; Encoding the first video stream through a first encoder to obtain a first encoding result, and encoding the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder adopt the same encoding parameters; According to the High Efficiency Video Coding (HEVC) standard, performing a parameter modification operation on the first encoding result to obtain a third encoding result, performing a parameter modification operation on the second encoding result to obtain a fourth encoding result, and merging the third encoding result and the fourth encoding result to obtain a target encoding result; wherein, the bitstream distribution of the target encoding result conforms to the HEVC standard; Generating a video encoding file according to the target encoding result.
2. The method according to claim 1, characterized in that, The performing a parameter modification operation on the first encoding result according to the HEVC standard to obtain a third encoding result includes: Modifying the extended data in the video parameter set in the first encoding result to the standard parameter set corresponding to HEVC in the HEVC standard to obtain the third encoding result.
3. The method according to claim 2, wherein The performing a parameter modification operation on the second encoding result according to the HEVC standard to obtain a fourth encoding result includes: Modifying the sequence parameter set and the picture parameter set in the second encoding result to the index values corresponding to alpha in the HEVC standard to obtain the fourth encoding result.
4. The method according to any one of claims 1 to 3, characterized in that The merging the third encoding result and the fourth encoding result to obtain a target encoding result includes: Arranging according to the standard bitstream distribution method, and merging the third encoding result and the fourth encoding result to obtain the merged target encoding result.
5. The method according to any one of claims 1 to 3, characterized in that, The generating a video encoding file according to the target encoding result includes: Performing a packaging process on the target encoding result to generate a video encoding file corresponding to the video data to be encoded.
6. The method according to any one of claims 1 to 3, characterized in that The method further includes: Playing the video encoding file by using a playback device; During the process of playing the video encoding file, detecting whether there is an alpha channel in the graphical user interface of the playback device.
7. The method according to any one of claims 1-3, characterized in that, The video encoding file is a Digital Audio Compression Coding Standard format file or a film format file.
8. A video processing device, characterized in that, Including: A first processing unit, configured to divide the video data to be encoded into a first video stream and a second video stream, where the first video stream includes color channel data in the video data to be encoded, and the second video stream includes alpha channel data in the video data to be encoded; A second processing unit, configured to encode the first video stream through a first encoder to obtain a first encoding result, and encode the second video stream through a second encoder to obtain a second encoding result; wherein, the first encoder and the second encoder adopt the same encoding parameters; A third processing unit, configured to modify parameters of the first encoding result according to the High Efficiency Video Coding (HEVC) standard to obtain a third encoding result, modify parameters of the second encoding result according to the HEVC standard to obtain a fourth encoding result, and merge the third encoding result and the fourth encoding result to obtain a target encoding result; wherein the bitstream distribution of the target encoding result conforms to the HEVC standard; A fourth processing unit, configured to generate a video encoding file according to the target encoding result.
9. An electronic device, characterized in that, Comprising: A processor and a memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the video processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the video processing method according to any one of claims 1 to 7 is implemented.