Method, device, server, terminal equipment and system for video encoding and decoding
By decomposing and independently encoding audio frame data and image frame data in the video encoding server, the problems of audio and video decoding calculation and bandwidth limitations in the existing technology are solved, the video quality and playback experience are improved, and the server burden is reduced.
Patent Information
- Application Number
- CN202010668549.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-13
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-07-13
AI Technical Summary
In the existing technology, audio and video data are decoded by the cloud server and then encoded again, resulting in reduced video quality and occupied computing resources. Lossy encoding is usually used under bandwidth constraints, which affects the client's video playback experience.
In the video encoding server, the original video stream data is decomposed into audio frame data and image frame data, and are encoded separately to avoid audio and video decoding calculations. The encoded code stream is directly output to the terminal device, and the graphical user interface buffer data is independently encoded to reduce the server load. Computational burden.
It improves video quality and playback experience, reduces server computing resource usage, and saves bandwidth and computing resources.
Smart Images

Figure CN113938705B
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of video processing technology, and more specifically, to a server for video encoding, a terminal device for video decoding, a video encoding method, a video decoding method, a video encoding device, a video decoding device, and a video playback system. Background Art
[0002] At present, in order to solve the problem that the complexity of the Android system makes it impossible to run on a thin client with very limited hardware resources, the Android system and its applications can be run in a cloud server through a container. For example, an Android video application can be run in a cloud server through a container, and the obtained image data and audio data can be sent to the client through the Web Real Time Communication (WebRTC) protocol, so that the client can play the video.
[0003] Usually, the cloud server includes a WebRTC connection service module and an Android cloud container module; wherein the WebRTC connection service module is provided with an audio encoder, an image encoder, an audio channel and an image channel; and the Android cloud container module is provided with an image decoder and an audio decoder. Before the cloud server sends the image data and audio data to the client, the image decoder and the audio decoder need to decode the image data and the audio data respectively, and then the audio encoder and the image encoder need to encode the decoded original audio data and the original video data respectively, and send the encoded audio code stream to the client through the audio channel, and send the encoded video code stream to the client through the image channel, so that the client can decode and play the video.
[0004] However, in the above-mentioned prior art, the audio and video data are encoded by the audio and video encoder after being decoded. Due to bandwidth limitations, the audio and video encoders are usually lossy encoding, which makes the video quality received and played by the client lower than the original video quality. In addition, video decoding and encoding have computing workloads and will occupy certain computing resources. Summary of the invention
[0005] The embodiments of this specification provide a new technical solution for a server for video encoding.
[0006] According to a first aspect of the present specification, there is provided a server for video encoding, comprising: a video decomposition unit, an encoding unit and a sending unit which are communicatively connected in sequence;
[0007] The video decomposition unit decomposes the original video stream data into audio frame data and image frame data, and sends the audio frame data and the image frame data to the encoding unit;
[0008] The encoding unit receives the audio frame data and the image frame data, obtains the graphical user interface buffer data, and respectively encodes the audio frame data, the image frame data and the graphical user interface buffer data to obtain an encoded code stream, and sends the encoded code stream to the sending unit;
[0009] The sending unit sends the encoded code stream to the terminal device.
[0010] Optionally, the video decomposition unit includes: a video playback service module and an audio and video separation module;
[0011] The video playback service module obtains the original video stream data and sends it to the audio and video separation module; the audio and video separation module receives the original video stream data, decomposes the original video stream data into the audio frame data and the image frame data, and sends the audio frame data and the image frame data to the encoding unit.
[0012] Optionally, the encoding unit includes: a web page real-time communication connection service module, a window component module, an image encoding module,
[0013] The webpage real-time communication connection service module encodes the audio frame data into audio encoding data and the image frame data into image encoding data according to the streaming protocol, and sends the audio encoding data and the image encoding data to the sending unit;
[0014] The window component module obtains the graphical user interface buffer data and sends it to the image encoding module;
[0015] The image encoding module encodes the graphical user interface buffer data to obtain graphical user interface buffer encoded data, and sends the encoded graphical user interface buffer data to the sending unit.
[0016] Optionally, the webpage real-time communication connection service module includes an audio adapter and an image adapter;
[0017] The audio adapter encodes the audio frame data into the audio encoding data according to a stream protocol;
[0018] The image adapter encodes the image frame data into the image encoding data according to a stream protocol.
[0019] Optionally, the image encoding module is an image encoder.
[0020] Optionally, the coded code stream includes: the audio coded data, the image coded data and the graphical user interface buffer coded data;
[0021] The sending unit includes: an audio channel, a first video channel and a second video channel;
[0022] The audio channel sends the audio encoded data to the terminal device; the first video channel sends the image encoded data to the terminal device; and the second video channel sends the graphical user interface buffer encoded data to the terminal device.
[0023] According to a second aspect of the present specification, there is provided a terminal device for video decoding, comprising: a sending module, a receiving module, a decoding module and a display module which are sequentially connected in communication;
[0024] Wherein, the sending module sends a video playback request to the server;
[0025] The receiving module receives the video encoding stream returned by the server, where the video encoding stream is sent by the server after encoding the video according to the video playback request;
[0026] The decoding module decodes the video encoding code stream to obtain video stream data; and
[0027] The display module plays the decoded video stream data.
[0028] Optionally, the video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data;
[0029] Correspondingly, the decoding module decodes the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data to obtain decoded audio frame data, image frame data and graphical user interface buffer frame data, and synthesizes the decoded audio frame data, image frame data and graphical user interface buffer frame data to obtain the video stream data.
[0030] According to a third aspect of the present specification, a video encoding method is provided, including:
[0031] Get raw video stream data and GUI buffer data;
[0032] Decomposing the original video stream data into audio frame data and image frame data;
[0033] Encoding the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoded code stream;
[0034] The encoded code stream is sent to a terminal device.
[0035] Optionally, the coded code stream includes: the audio coded data, the image coded data and the graphical user interface buffer coded data;
[0036] The step of sending the encoded code stream to a terminal device comprises:
[0037] Sending the audio encoding data to the terminal device through an audio channel;
[0038] sending the image encoding data to the terminal device through a first video channel; and
[0039] The graphical user interface buffered encoded data is sent to the terminal device through a second video channel.
[0040] According to a fourth aspect of the present specification, a video decoding method is provided, including:
[0041] Receiving a video encoding stream sent by a server, wherein the video encoding stream is sent by the server after encoding the video according to the video playback request;
[0042] Decoding the video encoding code stream to obtain video stream data; and,
[0043] Play the decoded video stream data.
[0044] Optionally, the video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data;
[0045] The decoding of the video encoding code stream to obtain video stream data includes:
[0046] The encoded audio encoded data, image encoded data and graphical user interface buffer encoded data are decoded to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and the decoded audio frame data, image frame data and graphical user interface buffer data are synthesized to obtain the video stream data.
[0047] According to a fifth aspect of the present specification, a video encoding apparatus is provided, including:
[0048] An acquisition module, used for acquiring raw video stream data and graphical user interface buffer data;
[0049] A decomposition module, used for decomposing the original video stream data into audio frame data and image frame data;
[0050] An encoding module, used for encoding the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoding stream;
[0051] The sending module is used to send the encoded code stream to the terminal device.
[0052] According to a sixth aspect of the present specification, a video decoding apparatus is provided, including:
[0053] A receiving module, used for receiving a video encoding stream sent by a server, wherein the video encoding stream is sent by the server after encoding the video according to the video playback request;
[0054] A decoding module, used to decode the video encoding code stream to obtain video stream data; and
[0055] The playback module is used to play the decoded video stream data.
[0056] According to a seventh aspect of the present specification, a video playback system is provided, including:
[0057] A server for video encoding as described in any one of the first aspects of this specification; and a terminal device for video decoding as described in any one of the second aspects of this specification.
[0058] In one embodiment, a server for video encoding is provided with a video decomposition unit for decomposing the original video stream data into audio frame data and image frame data, and sending the audio frame data and the image frame data to the encoding unit; an encoding unit for receiving the audio frame data and the image frame data, obtaining the graphical user interface buffer data, and respectively encoding the audio frame data, the image frame data and the graphical user interface buffer data to obtain the encoded code stream, and sending the encoded code stream to the sending unit; and a sending unit for sending the encoded code stream to the terminal device. Since the graphical user interface buffer data can be encoded independently, and the unnecessary audio and video decoding calculation in the prior art is avoided, the audio and video data are directly encoded, thereby greatly reducing the calculation burden on the server.
[0059] Other features and advantages of the present specification will become apparent from the following detailed description of exemplary embodiments of the present specification with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the specification and, together with the description, serve to explain the principles of the specification.
[0061] Figure 1is a schematic diagram of an application scenario of an embodiment of a server for video encoding and decoding;
[0062] Figure 2 It is a schematic diagram of a framework of a cloud host operating system that can be used to implement a server for video encoding and decoding in the prior art;
[0063] Figure 3 is based on Figure 2 The system flow diagram of the cloud host operating system framework running the Android video playback cloud application;
[0064] Figure 4 It is a principle block diagram of the hardware configuration of a system for implementing a video encoding and decoding server;
[0065] Figure 5 is a schematic structural diagram of a server for video encoding and decoding according to an embodiment of this specification;
[0066] Figure 6 is a schematic structural diagram of an example of a server for video encoding and decoding according to an embodiment of this specification;
[0067] Figure 7 A flowchart showing a method for video encoding according to an embodiment of the present specification is shown;
[0068] Figure 8 A schematic diagram showing the structure of a video encoding device according to an embodiment of the present specification;
[0069] Fig. 9 is a schematic structural diagram of a terminal device for video decoding according to an embodiment of this specification;
[0070] Fig.10 A flowchart showing a method for video decoding according to an embodiment of the present specification is shown;
[0071] Fig.11 A schematic diagram of the structure of a video decoding device according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0072] Various exemplary embodiments of the present specification will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present specification.
[0073] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present specification, its application, or uses.
[0074] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0075] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0076] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0077] First of all, it should be noted that with the trend of Internet of Things, cloud-edge integration, the hardware resources and costs required by client devices are getting smaller and smaller. However, due to its own complexity, the Android system cannot run on client devices with very limited hardware resources. Therefore, running the Android system and its applications in a container on a cloud server and pushing the results to the client device through the WebRTC protocol becomes a good choice, which has achieved good results in video applications.
[0078] Usually, the cloud server includes a WebRTC connection service module and an Android cloud container module; wherein the WebRTC connection service module is provided with an audio encoder, an image encoder, an audio channel and an image channel; and the Android cloud container module is provided with an image decoder and an audio decoder. Before the cloud server sends the image data and audio data to the client, the image decoder and the audio decoder need to decode the image data and the audio data respectively, and then the audio encoder and the image encoder need to encode the decoded original audio data and the original video data respectively, and send the encoded audio code stream to the client through the audio channel, and send the encoded video code stream to the client through the image channel, so that the client can decode and play the video. However, in the above scheme, the audio and video data are encoded by the audio and video encoder after decoding. Due to bandwidth limitations, the audio and video encoders are usually lossy encoding, so that the video quality received and played by the client will be reduced compared with the original video quality, and video decoding and encoding have computing workloads, which will occupy certain computing resources.
[0079] Specific, combined Figure 1 and Figure 2As shown, taking the scenario where the Android application (Android Applications) running in the Android cloud container (Android Container) in the cloud host operating system (Host OS inCloud) on the server 1000 is an Android video application as an example, the user targets the terminal device 2000 ( Figure 2 The terminal device 2000 implements a click operation on the icon of the video application X in the client (Client) in the server 1000, and the terminal device 2000 responds to the click operation and sends a video playback request to the Android video playback cloud application in the Android cloud container (Android Container) module in the server 1000. The window component (SurfaceFlinger) in the Android framework (Android Framework) transmits the image source data to the image encoder (Video Encoder) in the web real-time communication (WebRTC) connection service through inter-process communication (Inter Process Communication, IPC), and the audio component (AudioFlinger) in the Android framework (Android Framework) transmits the audio source data to the audio encoder (Audio Encoder) in the WebRTC connection service through inter-process communication. When the terminal device 2000 sends a connection request, the server 1000 sends the audio and video streams to the terminal device 2000 through the WebRTC protocol, so that the terminal device 2000 can obtain the Android rendering result by audio and video decoding. In addition, the user's input events on the terminal device 2000, such as fast forward, fast rewind, and sending bullet screen, can be sent to the WebRTC connection service through the data channel (Data Channel) in the WebRTC connection service, and the WebRTC connection service is sent to the Android cloud container through inter-process communication. In this way, the client 2000 of the terminal device 2000 and the Android cloud container of the server 1000 interact with each other.
[0080] Specifically, Figure 3 As shown, when the cloud application running in the cloud host operating system is a video application, in its video playback operation framework, the main steps are: the video application prepares original video stream data (Media Data) and graphical user interface buffer data (GUI buffer), wherein the video stream data (Media Data) is audio stream data and video stream data compressed in a certain format, such as MP4 format; the GUI buffer is non-video interface data of the video application, such as progress bar data, bullet screen data, etc.
[0081] Among them, the video stream data (Media Data) is sent to the video playback service (Media Player Service / Media Service) in the Android framework according to the Android framework. The video playback service (Media Player Service) will call the audio and video separator (media demuxer) to decompose the video stream data (Media Data) into original audio and video frame data (AV Frame).
[0082] The video playback service (Media Player Service) in the Android framework calls the audio decoder (Audio Decoder) provided in the audio and video codec component subsystem (OMX Subsystem) to decode the original audio (Audio) frame data, and uses the image decoder (Video Decoder) to decode the original image (Video) frame data, so as to obtain the decoded audio and video frame data (Audio & Video Raw Data).
[0083] The audio and video codec component subsystem (OMX Subsystem) returns the decoded audio and video frame data (Audio & Video Raw Data) to the video player service (Media Player Service) in the Android framework. The video player service (Media Player Service) in the Android framework sends the decoded audio frame data (Audio RawData) and image frame data (Video Raw Data) to the audio component (AudioFlinger) and window component (SurfaceFlinger) in the Android framework for playback and rendering according to the presentation timestamp (PTS) in the bitstream information. Among them, the audio component (Audio Flinger) is a component in the existing Android framework, which is used to synthesize and play sound; the window component (Surface Flinger) is also a component in the existing Android framework, which is used to synthesize all window layers and display them.
[0084] The window component (Surface Flinger) synthesizes the image frame data (Video Raw Data) and the graphical user interface buffer data (GUI buffer) sent by the video application to form a buffer data frame (Frame BufferData) and sends it to the image encoder (Video Encoder) in the WebRTC connection service. The audio component (AudioFlinger) sends the audio frame data (Audio Raw Data) to the audio encoder (AudioEncoder) in the WebRTC connection service.
[0085] The video encoder (VideoEncoder) and audio encoder (AudioEncoder) in the WebRTC connection service use the IPC mechanism to capture image frame data and audio frame data from the output of the window component (Surface Flinger) and the audio component (Audio Flinger) respectively, and perform image encoding and audio encoding. The encoded video code stream is sent to the terminal device 2000 via the image channel (Video Channel) through the streaming protocol, and the encoded audio code stream is sent to the terminal device 2000 via the audio channel (Audio Channel) through the streaming protocol.
[0086] The terminal device 2000 decodes and plays the video code stream and the audio code stream, and the user can watch the rendered content through the display screen of the terminal device 2000.
[0087] It can be seen that under this framework, the audio and video are decoded by the video playback service (Media PlayerService) in the Android framework and then encoded by the audio and video encoder in the WebRTC connection service. In actual use, due to bandwidth limitations, audio and video encoding is usually lossy encoding, so the video quality that the user finally sees will be lower than the original video quality, resulting in a poor user experience. In addition, audio and video decoding and encoding have computing workloads and will occupy certain computing resources.
[0088] Based on this, this embodiment provides a new server for video encoding.
[0089] <Hardware Configuration>
[0090] Figure 4 It is a principle block diagram of the hardware configuration of a system for implementing a video encoding and decoding server.
[0091] like Figure 4 As shown, the video playback system 100 of this embodiment includes a server 1000 , a terminal device 2000 and a network 3000 .
[0092] The server 1000 may be, for example, a blade server, a rack-mounted server, etc. The server 1000 may also be a server cluster deployed in the cloud, which is not limited here.
[0093] like Figure 4 As shown, the server 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, and an input device 1600. The processor 1100 may be, for example, a central processing unit CPU, etc. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 may include, for example, a USB interface, a serial interface, etc. The communication device 1400 may be, for example, capable of wired or wireless communication. The display device 1500 may be, for example, a liquid crystal display screen. The input device 1600 may include, for example, a touch screen, a keyboard, etc.
[0094] In this embodiment, the memory 1200 of the server 1000 is used to store instructions, and the instructions are used to control the processor 1100 to operate. The technicians can design instructions according to the scheme disclosed in this specification. How the instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0095] It should be understood by those skilled in the art that although Figure 4 Multiple devices of the server 1000 are shown in the figure, but the server 1000 of the embodiment of this specification may only involve some of the devices, for example, only the processor 1100 and the memory 1200.
[0096] like Figure 4 As shown, the terminal device 2000 may include a processor 2100, a memory 2200, an interface device 2300, a communication device 2400, a display device 2500, an input device 2600, a speaker 2700, a microphone 2800, and the like. Among them, the processor 2100 is used to execute program instructions, and the program instructions may adopt an instruction set of an architecture such as x86, Arm, RISC, MIPS, SSE, etc. The memory 2200 includes, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 2300 includes, for example, a USB interface, a headphone interface, etc. The communication device 2400 is capable of wired or wireless communication, for example. The display device 2500 is, for example, a liquid crystal display screen, a touch display screen, etc. The input device 2600 may include, for example, a touch screen, a keyboard, etc. The speaker 2700 is used to output voice information. The microphone 2800 is used to collect voice information.
[0097] The terminal device 2000 can be any device that can support video playback, such as a smart phone, a portable computer, a desktop computer, a tablet computer, etc.
[0098] In this embodiment, the memory 2200 of the terminal device 2000 is used to store instructions, and the instructions are used to control the processor 2100 to operate. A technician can design instructions according to the scheme disclosed in this specification. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0099] It should be understood by those skilled in the art that although Figure 4 Multiple devices of the terminal device 2000 are shown in the figure, but the terminal device 2000 of the embodiment of this specification may only involve some of the devices, for example, only the processor 2100, the memory 2200, the display device 2500, the input device 2600, etc.
[0100] The communication network 3000 may be a wireless network or a wired network, a local area network or a wide area network. The terminal device 2000 may communicate with the server 1000 via the communication network 3000.
[0101] Figure 4 The video playback system 100 shown is illustrative only and is in no way intended to limit the present specification, its application, or use. Figure 4 Only one server 1000 and one terminal device 2000 are shown, but this does not mean that the respective numbers are limited. The video playback system 100 may include multiple servers 1000 and / or multiple terminal devices 2000.
[0102] <First Embodiment>
[0103] <Server>
[0104] like Figure 5 As shown, the server 4000 for video encoding provided by this embodiment may include: a video decomposition unit 4100, an encoding unit 4200 and a sending unit 4300 which are communicatively connected in sequence.
[0105] Among them, the server 4000 decomposes the original video stream data into audio frame data and image frame data through the video decomposition unit 4100, and sends the audio frame data and the image frame data to the encoding unit 4200; the server 4000 receives the audio frame data and the image frame data through the encoding unit 4200, obtains the graphical user interface buffer data, and encodes the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain the encoded code stream, and sends the encoded code stream to the sending unit 4300; the server 4000 sends the encoded code stream to the terminal device through the sending unit 4300.
[0106] The video decomposition unit 4100 includes: a video playback service module and an audio and video separation module. The video playback service module can obtain the original video stream data and send it to the audio and video separation module; the audio and video separation module can receive the original video stream data, decompose the original video stream data into the audio frame data and the image frame data, and send the audio frame data and the image frame data to the encoding unit 4200.
[0107] Specifically, the encoding unit 4200 includes: a web real-time communication connection service module, a window component module, and an image encoding module. The web real-time communication connection service module can encode the audio data frame into audio encoding data and encode the image frame data into image encoding data according to the streaming protocol, and send the audio encoding data and the image encoding data to the sending unit 4300; the window component module can obtain the graphical user interface buffer data and send it to the image encoding module; the image encoding module can encode the graphical user interface buffer data to obtain graphical user interface buffer encoding data and send it to the sending unit 4300.
[0108] In one example, the webpage real-time communication connection service module includes an audio adapter and an image adapter; the audio adapter can encode the audio frame data into the audio encoding data according to the streaming protocol; the image adapter can encode the image frame data into the image encoding data according to the streaming protocol. Specifically, the image encoding module can be an image encoder.
[0109] Specifically, the coded code stream includes: the audio coded data, the image coded data and the graphical user interface buffer coded data. The sending unit 4300 includes: an audio channel, a first video channel and a second video channel; the server 4000 sends the audio coded data to the terminal device through the audio channel; the server 4000 sends the image coded data to the terminal device through the first video channel; and the server 4000 sends the graphical user interface buffer coded data to the terminal device through the second video channel.
[0110] In practical applications, such as Figure 6 As shown, the video application (Android Video Playback APP) prepares the original video stream data (Media Data) and the graphical user interface buffer data (GUI buffer). The original video stream data (Media Data) is compressed in a certain format, such as MP4 format, and contains the data of the original audio stream and the original video stream. The graphical user interface buffer data (GUI buffer) is the non-video interface of the video application, such as progress bar, bullet screen, etc.
[0111] The video player service module (Media Player Service) in the video decomposition unit 4100 calls the audio and video separation module (media demuxer) to decompose the video stream data (Media Data) into audio data and image data. After decomposing the video stream data (Media Data) into audio data and image data by calling the audio and video separation module (media demuxer), the video player service module (Media Player Service) directly packages the audio data frame (Audio Frame Data) and the image data frame (Video Frame Data) and the display timestamp (Prensentation Timestamp, PTS) and other information into audio frame data (Audio Frame Data) and image frame data (Video Frame Data), and outputs them to the web real-time communication connection service module (WebRTC Connection Service).
[0112] The audio adapter and video adapter in the WebRTC Connection Service module convert the audio frame data and the video frame data into audio coded data and image coded data according to the format requirements of the streaming protocol. The audio coded data is sent to the terminal device through the audio channel, and the image coded data is sent to the terminal device through the first video channel, i.e. Figure 6 The video channel 0 (Video Channel0) in is sent to the terminal device.
[0113] Since the process of the existing Android video playback service module (Media Player Service) is changed in this embodiment, unnecessary audio and video decoding calculations in the prior art are avoided, and the audio and video encoding is directly output to the web real-time communication connection service module (WebRTC Connection Service), avoiding the calculation process of audio and video encoding and decoding in the prior art, thereby greatly reducing the computing burden on the server.
[0114] At the same time, the window component (SurfaceFlinger) module directly outputs the graphical user interface buffer data (GUI buffer) sent by the video application to the image encoder (Video Encoder) in the web real-time communication connection service module (WebRTC ConnectionService) for encoding, obtains the graphical user interface buffer encoded data, and transmits the graphical user interface buffer encoded data through the second video channel, that is, Figure 6 The video channel 1 (VideoChannel1) in the video is sent to the terminal device.
[0115] In this embodiment, by independently encoding the GUI Buffer data, the encoded GUI Buffer data can be directly output to the terminal device through the second video channel (video channel 1, VideoChanel1). At the same time, in this embodiment, the GUI Buffer data can be independently encoded and transmitted. Since the effective display area of the GUI Buffer data is small and changes little, it can be encoded with a relatively small calculation cost and transmitted with a small bandwidth, thereby saving the server's computing resources and bandwidth resources.
[0116] <Method>
[0117] Figure 7The flowchart of the video encoding method of the embodiment of this specification is shown. The method of this embodiment can be executed by the above server, for example.
[0118] Specifically, Figure 7 As shown, the method of this embodiment may include the following steps 5100 to 5400:
[0119] Step 5100, obtaining original video stream data and graphical user interface buffer data.
[0120] Step 5200: decompose the original video stream data into audio frame data and image frame data.
[0121] Step 5300: Encode the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoded bit stream.
[0122] Step 5400: Send the encoded code stream to the terminal device.
[0123] The encoded code stream includes: the audio encoded data, the image encoded data and the graphical user interface buffer encoded data.
[0124] In this step, the server can specifically send the audio encoding data to the terminal device through the audio channel; send the image encoding data to the terminal device through the first video channel; and send the graphical user interface buffer encoding data to the terminal device through the second video channel, so that the terminal device decodes the encoding code stream, synthesizes the video stream data and displays it.
[0125] <Device>
[0126] Figure 8 FIG. 2 shows a schematic diagram of the structure of a video encoding device according to an embodiment of the present specification. Figure 8 As shown, the video encoding device 6000 may include: an acquisition module 6100, a decomposition module 6200, an encoding module 6300 and a sending module 6400.
[0127] The acquisition module 6100 is used to acquire original video stream data and graphical user interface buffer data.
[0128] The decomposition module 6200 is used to decompose the original video stream data into audio frame data and image frame data.
[0129] The encoding module 6300 is used to encode the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoded bit stream.
[0130] The sending module 6400 is used to send the encoded code stream to the terminal device.
[0131] The coded code stream includes: the audio coded data, the image coded data and the graphical user interface buffer coded data. Accordingly, the sending module 6400 can specifically send the audio coded data to the terminal device through an audio channel; send the image coded data to the terminal device through a first video channel; and send the graphical user interface buffer coded data to the terminal device through a second video channel.
[0132] The above has been described in conjunction with the accompanying drawings about the server, video encoding method and device of the present embodiment. A video decomposition unit is set in the server for decomposing the original video stream data into audio frame data and image frame data, and sending the audio frame data and the image frame data to the encoding unit; a coding unit is used to receive the audio frame data and the image frame data, obtain the graphical user interface buffer data, and respectively encode the audio frame data, the image frame data and the graphical user interface buffer data to obtain the encoded code stream, and send the encoded code stream to the sending unit; and a sending unit is used to send the encoded code stream to the terminal device. Since the graphical user interface buffer data can be encoded independently, and the unnecessary audio and video decoding calculation in the prior art is avoided, the audio and video data are directly encoded, thereby greatly reducing the computing burden on the server.
[0133] <Second Embodiment>
[0134] <Terminal Equipment>
[0135] like Fig. 9 As shown, the terminal device 7000 for video decoding in this embodiment may include: a sending module 7100, a receiving module 7200, a decoding module 7300 and a display module 7400 which are sequentially connected in communication. The sending module 7100 sends a video playback request to the server; the receiving module 7200 receives a video encoding stream returned by the server, the video encoding stream is sent by the server after encoding the video according to the video playback request; the decoding module 7300 decodes the video encoding stream to obtain video stream data; and the display module 7400 plays the decoded video stream data.
[0136] Specifically, the video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data.
[0137] The decoding module 7300 decodes the encoded audio encoded data, image encoded data and graphical user interface buffer encoded data to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and synthesizes the decoded audio frame data, image frame data and graphical user interface buffer data to obtain the video stream data.
[0138] In practical applications, such as Figure 6 As shown, the terminal device decodes the audio channel (Audio Channel), the first video channel, that is, Figure 6 Video Channel 0 and the second video channel in Figure 6 The audio coded data, image coded data and graphical user interface buffer coded data received by video channel 1 (Video Channel1) in the video are synthesized and played for the decoding results of video channel 0 (Video Channel0) and video channel 1 (Video Channel1), so that the user can watch the synthesized image with the graphical user interface buffer data through the display screen of the terminal device 2000. It should be noted that the terminal device of this embodiment usually needs to support a hardware-based data display solution. When the graphical user interface (GUI) is rendered, the data received by video channel 0 (VideoChannel0) and video channel 1 (Video Channel1) can be displayed on different Overlay layers.
[0139] <Method>
[0140] Fig.10 The flowchart of the video decoding method of the embodiment of this specification is shown. The method of this embodiment can be executed by the above terminal device, for example.
[0141] Specifically, Fig.10 As shown, the method of this embodiment may include the following steps 8100 to 8300:
[0142] Step 8100: Receive a video encoding stream sent by a server, where the video encoding stream is sent by the server after encoding the video according to the video playback request.
[0143] Step 8200: decode the video encoding code stream to obtain video stream data.
[0144] The video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data. When decoding, the terminal device can specifically decode the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and synthesize the decoded audio frame data, image frame data and graphical user interface buffer data to obtain the video stream data.
[0145] Step 8300, play the decoded video stream data.
[0146] <Device>
[0147] Fig.11 FIG. 2 shows a schematic diagram of the structure of a video decoding device according to an embodiment of the present specification. Fig.11 As shown, the video encoding device 9000 may include: a receiving module 9100 , a decoding module 9200 and a playing module 9300 .
[0148] The receiving module 9100 is used to receive a video encoding stream sent by a server, where the video encoding stream is sent by the server after encoding the video according to the video playback request.
[0149] The decoding module 9200 is used to decode the video encoding code stream to obtain video stream data.
[0150] The playback module 9300 is used to play the decoded video stream data.
[0151] The video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data. The decoding module 9200 can be specifically used to decode the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and synthesize the decoded audio frame data, image frame data and graphical user interface buffer data to obtain the video stream data.
[0152] The terminal device for video decoding, the method and the apparatus for video decoding of this embodiment have been described above in conjunction with the accompanying drawings. By delegating the image synthesis work of the window component (SurfaceFlinger) originally running on the server to the terminal device, the terminal device can use the capabilities of its display hardware to quickly complete the data synthesis work, thereby saving computing resources on the server.
[0153] <System>
[0154] The video playback system of this embodiment may include the server 4000 for video encoding as described in the above embodiment; and the terminal device 7000 for video decoding as described in the above embodiment.
[0155] The present specification may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present specification.
[0156] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0157] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0158] The computer program instructions for performing the operation of this specification can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, 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 can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions, thereby realizing various aspects of this specification.
[0159] Various aspects of this specification are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of this specification. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0160] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0161] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0162] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of this specification. In this regard, each box in the flowchart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0163] The embodiments of the present specification have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of this specification is defined by the appended claims.
Claims
1. A server for video encoding, comprising: A video decomposition unit, an encoding unit and a sending unit which are sequentially communicatively connected; The video decomposition unit decomposes the original video stream data into audio frame data and image frame data, and sends the audio frame data and the image frame data to the encoding unit; The encoding unit receives the audio frame data and the image frame data, obtains the graphical user interface buffer data, and respectively encodes the audio frame data, the image frame data and the graphical user interface buffer data to obtain an encoded code stream, and sends the encoded code stream to the sending unit; The sending unit sends the encoded code stream to the terminal device; The coded code stream includes: the audio coded data after the audio frame data is coded, the image coded data after the image frame data is coded, and the graphical user interface buffer coded data after the graphical user interface buffer data is coded; The sending unit includes: an audio channel, a first video channel and a second video channel; The audio channel sends the audio encoding data to the terminal device; The first video channel sends the image encoding data to the terminal device; and The second video channel sends the graphical user interface buffered encoded data to the terminal device.
2. The server according to claim 1, wherein: The video decomposition unit includes: a video playback service module and an audio and video separation module; The video playback service module obtains the original video stream data and sends it to the audio and video separation module; The audio and video separation module receives the original video stream data, decomposes the original video stream data into the audio frame data and the image frame data, and sends the audio frame data and the image frame data to the encoding unit.
3. The server according to claim 1, wherein: The encoding unit includes: a web page real-time communication connection service module, a window component module, an image encoding module, The webpage real-time communication connection service module encodes the audio frame data into audio encoding data and the image frame data into image encoding data according to the streaming protocol, and sends the audio encoding data and the image encoding data to the sending unit; The window component module obtains the graphical user interface buffer data and sends it to the image encoding module; The image encoding module encodes the graphical user interface buffer data to obtain graphical user interface buffer encoded data, and sends the encoded graphical user interface buffer data to the sending unit.
4. The server according to claim 3, wherein: The webpage real-time communication connection service module includes an audio adapter and an image adapter; The audio adapter encodes the audio frame data into the audio encoding data according to a stream protocol; The image adapter encodes the image frame data into the image encoding data according to a stream protocol.
5. The server according to claim 3, wherein: The image encoding module is an image encoder.
6. A terminal device for video decoding, comprising: A sending module, a receiving module, a decoding module and a display module which are sequentially connected in communication; Wherein, the sending module sends a video playback request to the server; The receiving module receives the video encoding stream returned by the server, where the video encoding stream is sent by the server after encoding the video according to the video playback request; The decoding module decodes the video encoding code stream to obtain video stream data; and The display module plays the decoded video stream data; The video encoding code stream includes the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data; Correspondingly, the decoding module decodes the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data to obtain decoded audio frame data, image frame data and graphical user interface buffer frame data, and synthesizes the decoded audio frame data, image frame data and graphical user interface buffer frame data to obtain the video stream data.
7. A video encoding method, comprising: Get raw video stream data and GUI buffer data; Decomposing the original video stream data into audio frame data and image frame data; Encoding the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoded code stream; Sending the encoded code stream to a terminal device; The coded code stream includes: the audio coded data after the audio frame data is coded, the image coded data after the image frame data is coded, and the graphical user interface buffer coded data after the graphical user interface buffer data is coded; The step of sending the encoded code stream to a terminal device comprises: Sending the audio encoding data to the terminal device through an audio channel; sending the image encoding data to the terminal device through a first video channel; and The graphical user interface buffered encoded data is sent to the terminal device through a second video channel.
8. A method for video decoding, comprising: Receiving a video encoding stream sent by a server, wherein the video encoding stream is sent by the server after encoding the video according to the video playback request; Decoding the video encoding code stream to obtain video stream data; as well as, Play the decoded video stream data; The video encoding code stream includes the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data; The decoding of the video encoding code stream to obtain video stream data includes: The encoded audio encoded data, image encoded data and graphical user interface buffer encoded data are decoded to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and the decoded audio frame data, image frame data and graphical user interface buffer data are synthesized to obtain the video stream data.
9. A video encoding device, comprising: An acquisition module, used for acquiring raw video stream data and graphical user interface buffer data; A decomposition module, used for decomposing the original video stream data into audio frame data and image frame data; An encoding module, used for encoding the audio frame data, the image frame data and the graphical user interface buffer data respectively to obtain an encoding stream; A sending module, used for sending the encoded code stream to a terminal device; wherein the encoded code stream includes: audio encoded data after the audio frame data is encoded, image encoded data after the image frame data is encoded, and graphical user interface buffer encoded data after the graphical user interface buffer data is encoded; sending the encoded code stream to the terminal device includes: sending the audio encoded data to the terminal device through an audio channel; sending the image encoded data to the terminal device through a first video channel; and sending the graphical user interface buffer encoded data to the terminal device through a second video channel.
10. A video decoding device, comprising: A receiving module, used for receiving a video encoding stream sent by a server, wherein the video encoding stream is sent by the server after encoding the video according to the video playback request; a decoding module, configured to decode the video encoding code stream to obtain video stream data; wherein the video encoding code stream includes encoded audio encoding data, image encoding data and graphical user interface buffer encoding data; the decoding of the video encoding code stream to obtain video stream data comprises: decoding the encoded audio encoding data, image encoding data and graphical user interface buffer encoding data to obtain decoded audio frame data, image frame data and graphical user interface buffer data, and synthesizing the decoded audio frame data, image frame data and graphical user interface buffer data to obtain the video stream data; and, The playback module is used to play the decoded video stream data.
11. A video playback system, comprising: The server for video encoding as claimed in any one of claims 1 to 5; And, comprising a terminal device for video decoding as claimed in claim 6.
