WO2023024563A1 - Video processing method, server, and computer-readable storage medium - Google Patents

Video processing method, server, and computer-readable storage medium Download PDF

Info

Publication number
WO2023024563A1
WO2023024563A1 PCT/CN2022/091023 CN2022091023W WO2023024563A1 WO 2023024563 A1 WO2023024563 A1 WO 2023024563A1 CN 2022091023 W CN2022091023 W CN 2022091023W WO 2023024563 A1 WO2023024563 A1 WO 2023024563A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
image
frame
change area
area
Prior art date
Application number
PCT/CN2022/091023
Other languages
French (fr)
Chinese (zh)
Inventor
任丽君
崔振峰
高俊平
陈浩
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023024563A1 publication Critical patent/WO2023024563A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Definitions

  • the embodiments of the present application relate to the technical field of virtual desktop transmission, and in particular, relate to a video processing method, a server, and a computer-readable storage medium.
  • desktop virtualization With the development of computer technology and communication technology, desktop virtualization and the development of cloud computing, the concept of cloud desktop has entered the market, and has developed rapidly and occupied a certain share in the market.
  • desktop transmission protocol the desktop operating system generated by the virtualization server is pushed to the user terminal.
  • the desktop transmission protocol plays an extremely important role.
  • mainstream desktop protocols include Microsoft's RDP protocol, Cirtix's ICA protocol, VMware's PCoIP protocol, and Red Hat's SPICE protocol.
  • Red Hat's open source desktop protocol SPICE (Simple Protocol for Independent Computing Environment) has been widely used in the industry due to its rich media support, smaller bandwidth occupation and more secure data transmission.
  • the SPICE protocol uses the refresh frame rate of the graphics area to judge the video area, and uses the MJPEG compression method to perform lossy compression on the video image.
  • the image information is updated quickly.
  • the server thinks that there is a video stream.
  • the video stream is compressed and sent to the client. .
  • the changed area images of other non-video areas of the desktop are sent to the client by the desktop stream, and the changed area images of the video area are sent to the client by the video stream.
  • the processing for desktop streaming and video streaming is different in terms of compression ratio, frame rate, etc.
  • the bullet chatting is overlaid on the video, and the two areas partially overlap, but the bullet chatting and the video belong to different image areas.
  • the appearance of the bullet chatting will destroy the formation conditions of the video stream, resulting in misidentification of the video
  • the video image and barrage will be sent to the client in the form of desktop streaming.
  • the frame rate is low and the bandwidth usage is large, which will cause problems such as video playback freezes and video image fragmentation.
  • Embodiments of the present application provide a video processing method, a server, and a computer-readable storage medium.
  • the embodiment of the present application provides a video processing method, which is applied to the server, and the method includes: traversing each frame image of the cloud desktop to determine the video change area; When the difference between the video change areas corresponding to the next frame is less than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than a preset value, it is determined that the next frame belongs to a continuous video frame; according to the The number of frames of the continuous video frame determines the video playback status; when it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal.
  • the embodiment of the present application provides a video processing method, which is applied to the terminal, and the method includes: receiving the video change area compressed and encoded by the server, and the video change area is traversed by the server for each frame of the cloud desktop The image is obtained; the video change area is decoded and rendered to display each frame of the video.
  • an embodiment of the present application provides a server, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the first The video processing method described in the aspect.
  • an embodiment of the present application provides a terminal, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the above second method when executing the computer program.
  • a terminal including: a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the above second method when executing the computer program.
  • the embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to make the computer perform the above-mentioned first aspect.
  • Fig. 1 is the main flowchart (server side) of a kind of video processing method that an embodiment of the present application provides;
  • Fig. 2 is a subflow chart of a video processing method provided by an embodiment of the present application.
  • Fig. 3 is a subflow chart of a video processing method provided by an embodiment of the present application.
  • Fig. 4 is a subflow chart of a video processing method provided by an embodiment of the present application.
  • FIG. 5 is a main flowchart (terminal side) of a video processing method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • Fig. 7 is a schematic diagram of a terminal structure provided by an embodiment of the present application.
  • multiple means more than two, greater than, less than, exceeding, etc. are understood as not including the original number, and above, below, within, etc. are understood as including the original number. If there is a description of "first”, “second”, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the indicated The sequence relationship of the technical characteristics.
  • desktop virtualization With the development of computer technology and communication technology, desktop virtualization and the development of cloud computing, the concept of cloud desktop has entered the market, and has developed rapidly and occupied a certain share in the market.
  • desktop transmission protocol the desktop operating system generated by the virtualization server is pushed to the user terminal. In this process, the desktop transmission protocol plays an extremely important role.
  • mainstream desktop protocols include Microsoft's RDP protocol, Cirtix's ICA protocol, VMware's PCoIP protocol, and Red Hat's SPICE protocol.
  • Red Hat's open source desktop protocol SPICE (Simple Protocol for Independent Computing Environments) has been widely used in the industry due to its rich media support, smaller bandwidth occupation, and more secure data transmission.
  • the SPICE protocol uses the refresh frame rate of the graphics area to judge the video area, and uses the MJPEG compression method to perform lossy compression on the video image.
  • the image information is updated quickly.
  • the server thinks that there is a video stream.
  • the video stream is compressed and sent to the client. .
  • the changed area images of other non-video areas of the desktop are sent to the client by the desktop stream, and the changed area images of the video area are sent to the client by the video stream.
  • the processing for desktop streaming and video streaming is different in terms of compression ratio, frame rate, etc.
  • the bullet chatting is overlaid on the video, and the two areas partially overlap, but the bullet chatting and the video belong to different image areas.
  • the appearance of the bullet chatting will destroy the formation conditions of the video stream, resulting in misidentification of the video
  • the video image and barrage will be sent to the client in the form of desktop streaming.
  • the frame rate is low and the bandwidth usage is large, which will cause problems such as video playback freezes and video image fragmentation.
  • the embodiment of the present application provides a video processing method, a server and a computer that can Read the storage medium, and determine the video change area by traversing each frame of the cloud desktop image.
  • the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the area of the video change area is relatively
  • the proportion of the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of continuous video frames.
  • the compressed and encoded video change area is sent to the terminal . Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded. Compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
  • FIG. 1 is a flowchart of a video processing method provided by an embodiment of the present application.
  • the video processing method can be applied to a server, and the video processing method includes but not limited to the following steps:
  • Step 101 traversing each frame image of the cloud desktop to determine the video change area
  • Step 102 when the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is smaller than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than a preset value, determine the next A frame belongs to consecutive video frames;
  • Step 103 determine the video playback state according to the number of frames of continuous video frames
  • Step 104 when it is determined that the video starts to play, send the compressed and coded video change area to the terminal.
  • each frame of the cloud desktop image is traversed to determine the video change area, and the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the area of the video change area is relatively large.
  • the proportion of the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of continuous video frames.
  • the compressed and encoded video change area is sent to the terminal .
  • this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
  • the server can be installed on the server to traverse all the changing areas of each frame of the image on the cloud desktop to find out all the changing areas of the image.
  • the video change region is identified by finding the maximum change region among all image change regions, and then judging the image complexity of the maximum change region.
  • image complexity depends on factors such as image color complexity and image size, and a certain score will be calculated according to the proportion of each part. According to the score, the image complexity can be divided into high, medium, and low. Three levels, for example, the image complexity of playing video changes is generally a high level, and the image complexity of a pure text area is generally a low level.
  • this application does not specifically limit the specific value of the pixel threshold.
  • the pixel threshold as 20 pixels as an example, when the center coordinates of the maximum change area of the next frame image and the maximum change area of the previous frame image differ by 20 pixel, or the area of the maximum change area reaches a certain proportion of the terminal screen, and if the proportion is greater than a certain preset value, the next frame can be considered as a continuous video frame.
  • the preset value can be set according to the requirements of video recognition, because the specific numerical value of the preset value is not limited.
  • the server installed on the server can traverse all the image change areas of each frame of the cloud desktop, and then find the largest change area from all image change areas, and then calculate the maximum change area of the image
  • the image complexity of the image is judged. If it is a pure text area, the image complexity is low level, while the image complexity of the video change area is high level.
  • the video change area in the image is determined by judging the image complexity level. In addition to judging whether the image complexity of the maximum change region meets the high-level image complexity, it is also necessary to judge whether the next frame of image belongs to a continuous video frame.
  • the next frame can be considered as a continuous video frame.
  • the continuous video frames reach 15 frames, it is determined that the video playback starts.
  • the continuous video frames are less than 5 frames, it is determined that the video playback ends.
  • the changing image in each frame can be compressed and encoded using the H.264 standard, and then sent to the client installed on the terminal at a frame rate of 18fps, so as to improve the fragmentation of the video image playing in the barrage scene and the Carton and other issues.
  • step 101 may include but not limited to the following sub-steps:
  • Step 1011 identifying the updated image area in each frame of the video to determine all image change areas
  • Step 1012 find out the maximum change area from all image change areas
  • Step 1013 determine the image complexity of the maximum change area according to the weight value corresponding to the image parameter
  • Step 1014 determine the video change area according to the image complexity of the largest change area.
  • the image parameters include but not limited to the color of the image and the size of the image. Therefore, the calculation of the weight value can calculate a certain score according to the color complexity of the image and the respective ratio of the image size.
  • the image can be The complexity is divided into three levels: high, medium, and low. For example, the complexity of playing video changes is generally high level, and the image complexity of pure text areas is generally low level. Finally, the video change area is determined according to the image complexity of the maximum change area, and if the image complexity of the maximum change area is high, it can be determined as the video change area.
  • step 103 may include but not limited to the following sub-steps:
  • the first frame number threshold can be set according to the requirements of video recognition. Therefore, this application does not specifically limit the specific value of the first frame number threshold. Taking the first frame number threshold as 15 frames as an example, For example, in the case that the continuous video frames are greater than or equal to 15 frames, it is determined that the video playback starts.
  • step 103 may include but not limited to the following sub-steps:
  • the frame number of the continuous video frame is less than or equal to the second frame number threshold, it is determined that the video playback ends, wherein the second frame number threshold is less than the first frame number threshold.
  • the second frame number threshold can be set according to the requirements of video recognition. Therefore, this application does not specifically limit the specific value of the second frame number threshold. Taking the second frame number threshold as 5 frames as an example, When the continuous video frame is less than or equal to 5 frames, it is determined that the video playback ends. It should be noted that the second frame number threshold is smaller than the first frame number threshold.
  • step 103 may include but not limited to the following sub-steps:
  • first frame number threshold and the second frame number threshold can be set according to the requirements of video recognition. Taking the first frame number threshold as 15 frames and the second frame number threshold as 5 frames as an example, in continuous video When the frame is less than 15 frames and greater than 5 frames, counting of continuous video frames is restarted. Continuous video frames are recounted to re-judge the video playback status.
  • step 104 may include but not limited to the following sub-steps:
  • Step 1041 compressing and encoding each frame of video change area using the H.264 standard
  • Step 1042 sending the video change area to the terminal at a frame rate of 18 fps.
  • the compression coding method and the frame rate for sending the video change region to the terminal can be selected according to the transmission requirements. Therefore, this application does not specifically limit the compression coding method and the specific value of the frame rate.
  • the H.264 standard is an example.
  • the H.264 standard can be used to compress and encode the video change area of each frame, and the video change area can be sent to the terminal at a frame rate of 18fps, and the client installed on the terminal receives the image data. After that, the client renders and displays the image by decoding it.
  • step 101 may include but not limited to the following sub-steps:
  • the SPICE protocol is mainly composed of server, client and related components QXL, as shown in Figure 4.
  • the screen update starts from the command of the drawing operation requested by the application program in the virtual machine to the operating system of the virtual machine.
  • the QXL driver inside the virtual machine captures the drawing operation of the graphics application and passes it to the QEMU virtual QXL device backend.
  • the SPICE library loaded into the QEMU space reads the QXL commands.
  • the SPICE server maintains the rendering tree, updates the image area information according to the drawing instructions, and sends the image data to the client after certain processing.
  • the client parses the data and completes the update of the image screen.
  • dependent libraries supporting the H.264 compression algorithm are deployed on the SPICE server and the client respectively, so as to prepare for the virtualization environment.
  • Start the virtual machine connect the SPICE client to the server, and obtain a complete desktop image.
  • the end user opens the video player to start playing the video.
  • the QXL driver inside the virtual machine captures the drawing operation of the graphics application, and passes the drawing instruction to the QEMU virtual QXL device backend.
  • the SPICE server obtains the drawing instruction, and the drawing instruction carries image information to be updated.
  • the SPICE server updates the image area information according to the drawing instructions, processes the image data and sends them to the client, and the client parses the data to complete the image update.
  • FIG. 5 is a flowchart of a video processing method provided by an embodiment of the present application.
  • the video processing method can be applied to a terminal, and the video processing method includes but is not limited to the following steps:
  • Step 201 receiving the video change area compressed and coded by the server, the video change area is obtained by traversing each frame of image of the cloud desktop by the server;
  • Step 202 decoding and rendering the video change area to display each frame of the video.
  • the server installed on the server traverses the image change area of each frame of the cloud desktop, excludes the image outside the video change area, and processes the specific change area.
  • a video stream is formed and compressed. After encoding, it is sent to the terminal, and the client installed on the terminal receives the video change area compressed and encoded by the server, decodes and renders the video change area to display each frame of the video image, and completes the image update.
  • the video change area is provided by the server Obtained by traversing each image frame of the cloud desktop. Based on this, compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
  • Start the virtual machine connect the SPICE client to the server, and obtain a complete desktop image.
  • the end user opens the video player to start playing the video.
  • the QXL driver inside the virtual machine captures the drawing operation of the graphics application, and passes the graphics drawing instruction to the QEMU virtual QXL device backend.
  • the SPICE server obtains the drawing command, which carries the image information to be updated.
  • the SPICE server judges the updated image area in each frame of image. Traverse all changing regions of the current frame to find the largest changing region.
  • the image complexity of the video change area is relatively high, and it is judged whether the above image complexity of the maximum change area satisfies the video image complexity.
  • the calculation of image complexity depends on factors such as image color complexity and image size. A certain score will be calculated according to the proportion of each part. According to the score, the image complexity can be divided into three grades, high, medium, and low. Playing video changes image complexity Generally high. Determine whether the next frame image belongs to a continuous video frame.
  • the next frame can be considered as a continuous video frame.
  • the continuous video frame reaches 15 frames, it is determined that the video playback starts. And when it is determined that the continuous video frame is less than 5 frames, it is determined that the video playback ends.
  • the changing image in each frame can be compressed and encoded using the H.264 standard, and sent to the client at a frame rate of 18fps. The client completes decoding, rendering and displaying the image, thereby completing the image update.
  • the embodiment of the present application also provides a server.
  • the server includes: one or more processors and memories, and one processor and memories are taken as an example in FIG. 6 .
  • the processor and the memory may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 6 .
  • the memory can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the video processing method in the above-mentioned embodiments of the present application.
  • the processor executes the non-transitory software program and the program stored in the memory, so as to implement the video processing method in the above-mentioned embodiments of the present application.
  • the memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application required by the function; the data storage area may store the data required for executing the video processing method in the above-mentioned embodiment of the present application wait.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the memory may include memory located remotely from the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the non-transitory software programs and programs required to realize the video processing method in the above embodiment of the present application are stored in the memory, and when executed by one or more processors, the video processing method in the above embodiment of the present application is executed, for example , execute the method steps 101 to 104 in Fig. 1 described above, the method steps 1011 to 1014 in Fig. 2, and the method steps 1041 to 1042 in Fig.
  • the embodiment of the present application also provides a terminal.
  • the terminal includes: one or more processors and memories, and one processor and memories are taken as an example in FIG. 7 .
  • the processor and the memory may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 7 .
  • the memory can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the video processing method in the above-mentioned embodiments of the present application.
  • the processor executes the non-transitory software program and the program stored in the memory, so as to implement the video processing method in the above-mentioned embodiments of the present application.
  • the memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application required by the function; the data storage area may store the data required for executing the video processing method in the above-mentioned embodiment of the present application wait.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the memory may include memory located remotely from the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the non-transitory software programs and programs required to realize the video processing method in the above embodiment of the present application are stored in the memory, and when executed by one or more processors, the video processing method in the above embodiment of the present application is executed, for example , execute steps 201 to 202 of the method in Figure 5 described above, and the server installed on the server traverses the image change area of each frame, excludes images other than the video change area, and processes the specific change area. Image conditions, form a video stream, and send it to the terminal after compression and encoding.
  • the client installed on the terminal receives the video change area compressed and encoded by the server, decodes and renders the video change area to display each frame of the video image, and completes the image screen Update, wherein, the video change area is obtained by the server traversing each frame of the image of the cloud desktop. Based on this, compared with the native SPICE protocol, it can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer-executable program, and the computer-executable program is executed by one or more control processors, for example, as shown in FIG. 6
  • Execution by one of the processors can cause the above-mentioned one or more processors to execute the video processing method in the above-mentioned embodiment of the present application, for example, execute the method steps 101 to 104 in FIG. 1 described above, and the method in FIG.
  • the embodiment of this application includes: by traversing each frame of the cloud desktop image to determine the video change area, the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the video change area
  • the proportion of the area relative to the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of consecutive video frames.
  • the compressed and encoded video change area is sent to the terminal. Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded.
  • this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable programs, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Abstract

A video processing method, a server, and a computer-readable storage medium. The method comprises: traversing each frame of image of a cloud desktop to determine a video change region (101); when a difference between the video change regions respectively corresponding to a previous frame and a next frame in any two adjacent frames is less than a pixel threshold, or a ratio of the area of the video change regions to a screen of a terminal is greater than a preset value, determining that the next frame belongs to a continuous video frame (102); determining a video playing state according to the number of frames of the continuous video frame (103); and when it is determined that a video starts to play, sending the compressed and encoded video change regions to the terminal (104). On this basis, by traversing each frame of image change region, an image other than the video change regions is excluded, and a specific change region is processed; and when video image conditions are continuously satisfied, a video stream is formed, and the video stream is sent to the terminal after being compressed and encoded.

Description

视频处理方法、服务器和计算机可读存储介质Video processing method, server and computer readable storage medium
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202110967926.8、申请日为2021年8月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202110967926.8 and a filing date of August 23, 2021, and claims the priority of this Chinese patent application. The entire content of this Chinese patent application is hereby incorporated by reference into this application.
技术领域technical field
本申请实施例涉及虚拟桌面传输技术领域,特别是涉及一种视频处理方法、服务器和计算机可读存储介质。The embodiments of the present application relate to the technical field of virtual desktop transmission, and in particular, relate to a video processing method, a server, and a computer-readable storage medium.
背景技术Background technique
随着计算机技术及通信技术的发展,桌面虚拟化随着云计算的发展,云桌面的概念走入市场,并且迅速发展并在市场占领一定份额。利用桌面传输协议,将虚拟化服务器生成的桌面操作系统推送到用户终端。这一过程中,桌面传输协议发挥着极其重要的作用。目前主流的桌面协议有微软的RDP协议,Cirtix的ICA协议,VMware的PCoIP协议,以及红帽的SPICE协议等。其中红帽公司的开源桌面协议SPICE(独立计算环境简单协议)以丰富的媒体支持,更小带宽占用以及更安全的数据传输等优点,在业界得到广泛应用。With the development of computer technology and communication technology, desktop virtualization and the development of cloud computing, the concept of cloud desktop has entered the market, and has developed rapidly and occupied a certain share in the market. Using the desktop transmission protocol, the desktop operating system generated by the virtualization server is pushed to the user terminal. In this process, the desktop transmission protocol plays an extremely important role. Currently, mainstream desktop protocols include Microsoft's RDP protocol, Cirtix's ICA protocol, VMware's PCoIP protocol, and Red Hat's SPICE protocol. Among them, Red Hat's open source desktop protocol SPICE (Simple Protocol for Independent Computing Environment) has been widely used in the industry due to its rich media support, smaller bandwidth occupation and more secure data transmission.
SPICE协议在视频处理方面采用图形区域的刷新帧率来判断视频区域,并采用MJPEG的压缩方式对视频图像进行有损压缩。用户在终端播放视频时,图像信息快速更新,只有满足在同一区域内,图像刷新帧率达20帧,服务端认为有视频流产生,为保证流畅度,对视频流进行压缩处理发送至客户端。对于桌面其他非视频区域的变化区域图像则以桌面流发送至客户端,而视频区域的变化区域图像则以视频流发送至客户端。针对桌面流和视频流的处理在压缩比、帧频等方面是不同的。In terms of video processing, the SPICE protocol uses the refresh frame rate of the graphics area to judge the video area, and uses the MJPEG compression method to perform lossy compression on the video image. When the user plays a video on the terminal, the image information is updated quickly. As long as the image refresh frame rate reaches 20 frames in the same area, the server thinks that there is a video stream. To ensure smoothness, the video stream is compressed and sent to the client. . The changed area images of other non-video areas of the desktop are sent to the client by the desktop stream, and the changed area images of the video area are sent to the client by the video stream. The processing for desktop streaming and video streaming is different in terms of compression ratio, frame rate, etc.
在弹幕场景下,弹幕覆盖在视频上方,两者区域有部分重叠,但弹幕和视频属于不同的图像区域,此时,弹幕的出现会破坏视频流的形成条件,导致视频误识别,此时视频图像以及弹幕都会以桌面流形式发送至客户端。该情况帧率较低、带宽占用大,会导致播放视频卡顿,视频图像被割裂等问题。In the bullet chatting scenario, the bullet chatting is overlaid on the video, and the two areas partially overlap, but the bullet chatting and the video belong to different image areas. At this time, the appearance of the bullet chatting will destroy the formation conditions of the video stream, resulting in misidentification of the video , at this time the video image and barrage will be sent to the client in the form of desktop streaming. In this case, the frame rate is low and the bandwidth usage is large, which will cause problems such as video playback freezes and video image fragmentation.
发明内容Contents of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics described in detail in this article. This summary is not intended to limit the scope of the claims.
本申请实施例提供了一种视频处理方法、服务器和计算机可读存储介质。Embodiments of the present application provide a video processing method, a server, and a computer-readable storage medium.
第一方面,本申请实施例提供了一种视频处理方法,应用于服务器,所述方法包括:遍历云桌面每一帧图像以确定视频变化区域;在任意相邻两帧中的上一帧和下一帧分别对应的所述视频变化区域相差小于像素阈值,或者所述视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定所述下一帧属于连续视频帧;根据所述连续视频帧的帧数确定视频播放状态;当确定视频开始播放,发送经过压缩编码的所述视频变化区域给终端。In the first aspect, the embodiment of the present application provides a video processing method, which is applied to the server, and the method includes: traversing each frame image of the cloud desktop to determine the video change area; When the difference between the video change areas corresponding to the next frame is less than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than a preset value, it is determined that the next frame belongs to a continuous video frame; according to the The number of frames of the continuous video frame determines the video playback status; when it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal.
第二方面,本申请实施例提供了一种视频处理方法,应用于终端,所述方法包括:接收 经过服务器压缩编码的视频变化区域,所述视频变化区域由所述服务器遍历云桌面每一帧图像而得到;对所述视频变化区域解码渲染,以显示视频每一帧图像。In the second aspect, the embodiment of the present application provides a video processing method, which is applied to the terminal, and the method includes: receiving the video change area compressed and encoded by the server, and the video change area is traversed by the server for each frame of the cloud desktop The image is obtained; the video change area is decoded and rendered to display each frame of the video.
第三方面,本申请实施例提供了一种服务器,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上第一方面所述的视频处理方法。In a third aspect, an embodiment of the present application provides a server, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the first The video processing method described in the aspect.
第四方面,本申请实施例提供了一种终端,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上第二方面所述的视频处理方法。In a fourth aspect, an embodiment of the present application provides a terminal, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the above second method when executing the computer program. The video processing method described in the aspect.
第五方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行程序,所述计算机可执行程序用于使计算机执行如上第一方面所述的视频处理方法,或者如上第二方面所述的视频处理方法。In the fifth aspect, the embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to make the computer perform the above-mentioned first aspect. A video processing method, or the video processing method described in the second aspect above.
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the application will be set forth in the description which follows, and, in part, will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
附图说明Description of drawings
附图用来提供对本申请技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present application, and constitute a part of the specification, and are used together with the embodiments of the present application to explain the technical solution of the present application, and do not constitute a limitation to the technical solution of the present application.
图1是本申请一个实施例提供的一种视频处理方法的主流程图(服务器侧);Fig. 1 is the main flowchart (server side) of a kind of video processing method that an embodiment of the present application provides;
图2是本申请一个实施例提供的一种视频处理方法的子流程图;Fig. 2 is a subflow chart of a video processing method provided by an embodiment of the present application;
图3是本申请一个实施例提供的一种视频处理方法的子流程图;Fig. 3 is a subflow chart of a video processing method provided by an embodiment of the present application;
图4是本申请一个实施例提供的一种视频处理方法的子流程图;Fig. 4 is a subflow chart of a video processing method provided by an embodiment of the present application;
图5是本申请一个实施例提供的一种视频处理方法的主流程图(终端侧);FIG. 5 is a main flowchart (terminal side) of a video processing method provided by an embodiment of the present application;
图6是本申请一个实施例提供的服务器结构示意图;FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application;
图7是本申请一个实施例提供的终端结构示意图。Fig. 7 is a schematic diagram of a terminal structure provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
应了解,在本申请实施例的描述中,多个(或多项)的含义是两个以上,大于、小于、超过等理解为不包括本数,以上、以下、以内等理解为包括本数。如果有描述到“第一”、“第二”等只是用于区分技术特征为目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量或者隐含指明所指示的技术特征的先后关系。It should be understood that in the description of the embodiments of the present application, multiple (or multiple) means more than two, greater than, less than, exceeding, etc. are understood as not including the original number, and above, below, within, etc. are understood as including the original number. If there is a description of "first", "second", etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the indicated The sequence relationship of the technical characteristics.
随着计算机技术及通信技术的发展,桌面虚拟化随着云计算的发展,云桌面的概念走入市场,并且迅速发展并在市场占领一定份额。利用桌面传输协议,将虚拟化服务器生成的桌面操作系统推送到用户终端。这一过程中,桌面传输协议发挥着极其重要的作用。目前主流的桌面协议有微软的RDP协议,Cirtix的ICA协议,VMware的PCoIP协议,以及红帽的SPICE协议等。其中红帽公司的开源桌面协议SPICE(独立计算环境简单协议)以丰富的媒体支持, 更小带宽占用以及更安全的数据传输等优点,在业界得到广泛应用。With the development of computer technology and communication technology, desktop virtualization and the development of cloud computing, the concept of cloud desktop has entered the market, and has developed rapidly and occupied a certain share in the market. Using the desktop transmission protocol, the desktop operating system generated by the virtualization server is pushed to the user terminal. In this process, the desktop transmission protocol plays an extremely important role. Currently, mainstream desktop protocols include Microsoft's RDP protocol, Cirtix's ICA protocol, VMware's PCoIP protocol, and Red Hat's SPICE protocol. Among them, Red Hat's open source desktop protocol SPICE (Simple Protocol for Independent Computing Environments) has been widely used in the industry due to its rich media support, smaller bandwidth occupation, and more secure data transmission.
SPICE协议在视频处理方面采用图形区域的刷新帧率来判断视频区域,并采用MJPEG的压缩方式对视频图像进行有损压缩。用户在终端播放视频时,图像信息快速更新,只有满足在同一区域内,图像刷新帧率达20帧,服务端认为有视频流产生,为保证流畅度,对视频流进行压缩处理发送至客户端。对于桌面其他非视频区域的变化区域图像则以桌面流发送至客户端,而视频区域的变化区域图像则以视频流发送至客户端。针对桌面流和视频流的处理在压缩比、帧频等方面是不同的。In terms of video processing, the SPICE protocol uses the refresh frame rate of the graphics area to judge the video area, and uses the MJPEG compression method to perform lossy compression on the video image. When the user plays a video on the terminal, the image information is updated quickly. As long as the image refresh frame rate reaches 20 frames in the same area, the server thinks that there is a video stream. To ensure smoothness, the video stream is compressed and sent to the client. . The changed area images of other non-video areas of the desktop are sent to the client by the desktop stream, and the changed area images of the video area are sent to the client by the video stream. The processing for desktop streaming and video streaming is different in terms of compression ratio, frame rate, etc.
在弹幕场景下,弹幕覆盖在视频上方,两者区域有部分重叠,但弹幕和视频属于不同的图像区域,此时,弹幕的出现会破坏视频流的形成条件,导致视频误识别,此时视频图像以及弹幕都会以桌面流形式发送至客户端。该情况帧率较低、带宽占用大,会导致播放视频卡顿,视频图像被割裂等问题。In the bullet chatting scenario, the bullet chatting is overlaid on the video, and the two areas partially overlap, but the bullet chatting and the video belong to different image areas. At this time, the appearance of the bullet chatting will destroy the formation conditions of the video stream, resulting in misidentification of the video , at this time the video image and barrage will be sent to the client in the form of desktop streaming. In this case, the frame rate is low and the bandwidth usage is large, which will cause problems such as video playback freezes and video image fragmentation.
针对目前虚机桌面协议(SPICE)存在的视频形成识别机制引起协议视频播放画面不流畅,有弹幕时出现画面撕裂等问题,本申请实施例提供了一种视频处理方法、服务器和计算机可读存储介质,通过遍历云桌面每一帧图像以确定视频变化区域,在任意相邻两帧中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧,根据连续视频帧的帧数确定视频播放状态,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。基于此,通过遍历桌面所有图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端。对比原生SPICE协议,本方法能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。Aiming at the problem that the video formation recognition mechanism existing in the current virtual machine desktop protocol (SPICE) causes the protocol video playback screen to be unsmooth, and the screen is torn when there is a barrage, the embodiment of the present application provides a video processing method, a server and a computer that can Read the storage medium, and determine the video change area by traversing each frame of the cloud desktop image. The difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the area of the video change area is relatively When the proportion of the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of continuous video frames. When it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal . Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded. Compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
如图1所示,图1是本申请一个实施例提供的一种视频处理方法的流程图。该视频处理方法可以应用于服务器,视频处理方法包括但不限于如下步骤:As shown in FIG. 1 , FIG. 1 is a flowchart of a video processing method provided by an embodiment of the present application. The video processing method can be applied to a server, and the video processing method includes but not limited to the following steps:
步骤101,遍历云桌面每一帧图像以确定视频变化区域; Step 101, traversing each frame image of the cloud desktop to determine the video change area;
步骤102,在任意相邻两帧中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧; Step 102, when the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is smaller than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than a preset value, determine the next A frame belongs to consecutive video frames;
步骤103,根据连续视频帧的帧数确定视频播放状态; Step 103, determine the video playback state according to the number of frames of continuous video frames;
步骤104,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。 Step 104, when it is determined that the video starts to play, send the compressed and coded video change area to the terminal.
可以理解的是,遍历云桌面每一帧图像以确定视频变化区域,在任意相邻两帧中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧,根据连续视频帧的帧数确定视频播放状态,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。基于此,通过遍历桌面所有图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端。对比原生SPICE协议,本方法能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。It can be understood that each frame of the cloud desktop image is traversed to determine the video change area, and the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the area of the video change area is relatively large. When the proportion of the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of continuous video frames. When it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal . Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded. Compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
可以理解的是,可以通过安装在服务器的上服务端遍历云桌面每帧图像所有变化区域,以找出所有图像变化区域。需要说明的是,通过在所有图像变化区域中找出最大变化区域,再对最大变化区域的图像复杂度进行判断,以识别出视频变化区域。It can be understood that the server can be installed on the server to traverse all the changing areas of each frame of the image on the cloud desktop to find out all the changing areas of the image. It should be noted that the video change region is identified by finding the maximum change region among all image change regions, and then judging the image complexity of the maximum change region.
可以理解的是,图像复杂度的计算依赖与图像的色彩复杂及图像大小等因素,会根据各 部分的比例计算出一定的分值,根据分值可将图像复杂度分为高、中、低三个等级,例如,播放视频变化图像复杂度一般为高等级,纯文字区域图像复杂度一般为低等级。It is understandable that the calculation of image complexity depends on factors such as image color complexity and image size, and a certain score will be calculated according to the proportion of each part. According to the score, the image complexity can be divided into high, medium, and low. Three levels, for example, the image complexity of playing video changes is generally a high level, and the image complexity of a pure text area is generally a low level.
可以理解的是,本申请对于像素阈值的具体数值不做具体限定,以像素阈值为20个像素为例,当下一帧图像最大变化区域与上一帧图像的最大变化区域中心坐标相差在20个像素内,或者最大变化区域面积达到终端屏幕一定占比,该占比大于某一预设值,则可以认为下一帧属于连续视频帧。需要说明的是,预设值可以根据视频识别的要求进行设定,因为,对预设值的具体数值也不作限定。It can be understood that this application does not specifically limit the specific value of the pixel threshold. Taking the pixel threshold as 20 pixels as an example, when the center coordinates of the maximum change area of the next frame image and the maximum change area of the previous frame image differ by 20 pixel, or the area of the maximum change area reaches a certain proportion of the terminal screen, and if the proportion is greater than a certain preset value, the next frame can be considered as a continuous video frame. It should be noted that the preset value can be set according to the requirements of video recognition, because the specific numerical value of the preset value is not limited.
可以理解的是,在弹幕场景下,可以通过安装在服务器的上服务端遍历云桌面每帧图像所有图像变化区域,再从所有图像变化区域中找出最大变化区域,再对图像最大变化区域的图像复杂度进行判断,如果是纯文字区域,则图像复杂度为低等级,而视频变化区域的图像复杂度为高等级,通过对图像复杂度等级的判断来确定图像中的视频变化区域。除了判断最大变化区域图像复杂度是否满足高等级的图像复杂度,还需要判断下一帧图像是否属于连续视频帧。例如,若下一帧图像最大变化区域与上一帧图像的最大变化区域中心坐标相差在20个像素内,或者最大变化区域面积达到终端屏幕一定占比,此时可以认为下一帧属于连续视频帧。当确定连续视频帧达到15帧,则判定视频播放开始。当确定连续视频帧小于5帧,则判定视频播放结束。当判定视频播放开始,可以将每一帧内变化图像采用H.264标准进行压缩编码,再以18fps帧频发送至安装在终端上的客户端,从而能够改善弹幕场景下播放视频图像割裂及卡顿等问题。It is understandable that in the barrage scene, the server installed on the server can traverse all the image change areas of each frame of the cloud desktop, and then find the largest change area from all image change areas, and then calculate the maximum change area of the image The image complexity of the image is judged. If it is a pure text area, the image complexity is low level, while the image complexity of the video change area is high level. The video change area in the image is determined by judging the image complexity level. In addition to judging whether the image complexity of the maximum change region meets the high-level image complexity, it is also necessary to judge whether the next frame of image belongs to a continuous video frame. For example, if the difference between the center coordinates of the maximum change area of the next frame image and the maximum change area of the previous frame image is within 20 pixels, or the area of the maximum change area reaches a certain proportion of the terminal screen, then the next frame can be considered as a continuous video frame. When it is determined that the continuous video frames reach 15 frames, it is determined that the video playback starts. When it is determined that the continuous video frames are less than 5 frames, it is determined that the video playback ends. When it is determined that the video playback starts, the changing image in each frame can be compressed and encoded using the H.264 standard, and then sent to the client installed on the terminal at a frame rate of 18fps, so as to improve the fragmentation of the video image playing in the barrage scene and the Carton and other issues.
如图2所示,步骤101可以包括但不限于如下子步骤:As shown in Figure 2, step 101 may include but not limited to the following sub-steps:
步骤1011,识别视频每一帧图像内更新的图像区域,以确定所有图像变化区域; Step 1011, identifying the updated image area in each frame of the video to determine all image change areas;
步骤1012,从所有图像变化区域中找出最大变化区域; Step 1012, find out the maximum change area from all image change areas;
步骤1013,根据图像参数对应的权重值确定最大变化区域的图像复杂度; Step 1013, determine the image complexity of the maximum change area according to the weight value corresponding to the image parameter;
步骤1014,根据最大变化区域的图像复杂度确定视频变化区域。 Step 1014, determine the video change area according to the image complexity of the largest change area.
可以理解的是,对于遍历云桌面每一帧图像以确定图像变化区域和图像变化区域的图像复杂度的具体方式,可以通过先识别视频每一帧图像内更新的图像区域,以确定所有图像变化区域,然后从所有图像变化区域中找出最大变化区域,再根据图像参数对应的权重值确定最大变化区域的图像复杂度,其中,图像复杂度根据权重值分为高等级、中等级和低等级。需要说明的是,图像参数包括但不限于图像的色彩和图像的大小,因此,权重值的计算可以根据图像的色彩复杂以及图像大小各自的比例计算出一定的分值,根据分值可将图像复杂度分为高、中、低三个等级,例如,播放视频变化图像复杂度一般为高等级,纯文字区域图像复杂度一般为低等级。最后,根据最大变化区域的图像复杂度确定视频变化区域,若最大变化区域的图像复杂度为高等级,则可以确定为视频变化区域。It can be understood that, for the specific method of traversing each frame of image of the cloud desktop to determine the image change area and the image complexity of the image change area, it is possible to first identify the updated image area in each frame image of the video to determine all image change areas. area, and then find the largest change area from all image change areas, and then determine the image complexity of the largest change area according to the weight value corresponding to the image parameter, where the image complexity is divided into high level, middle level and low level according to the weight value . It should be noted that the image parameters include but not limited to the color of the image and the size of the image. Therefore, the calculation of the weight value can calculate a certain score according to the color complexity of the image and the respective ratio of the image size. According to the score, the image can be The complexity is divided into three levels: high, medium, and low. For example, the complexity of playing video changes is generally high level, and the image complexity of pure text areas is generally low level. Finally, the video change area is determined according to the image complexity of the maximum change area, and if the image complexity of the maximum change area is high, it can be determined as the video change area.
可以理解的是,步骤103可以包括但不限于如下子步骤:It can be understood that step 103 may include but not limited to the following sub-steps:
在连续视频帧的帧数大于等于第一帧数阈值的情况下,确定视频播放开始。When the number of consecutive video frames is greater than or equal to the first frame number threshold, it is determined that video playback starts.
可以理解的是,第一帧数阈值可以根据视频识别的要求进行设定,因此,本申请对于第一帧数阈值的具体数值不做具体限定,以第一帧数阈值为15帧为例,例如,在连续视频帧大于等于15帧的情况下,则判定视频播放开始。It can be understood that the first frame number threshold can be set according to the requirements of video recognition. Therefore, this application does not specifically limit the specific value of the first frame number threshold. Taking the first frame number threshold as 15 frames as an example, For example, in the case that the continuous video frames are greater than or equal to 15 frames, it is determined that the video playback starts.
可以理解的是,步骤103可以包括但不限于如下子步骤:It can be understood that step 103 may include but not limited to the following sub-steps:
在连续视频帧的帧数小于等于第二帧数阈值的情况下,确定视频播放结束,其中,第二 帧数阈值小于第一帧数阈值。In the case that the frame number of the continuous video frame is less than or equal to the second frame number threshold, it is determined that the video playback ends, wherein the second frame number threshold is less than the first frame number threshold.
可以理解的是,第二帧数阈值可以根据视频识别的要求进行设定,因此,本申请对于第二帧数阈值的具体数值不做具体限定,以第二帧数阈值为5帧为例,在连续视频帧小于等于5帧的情况下,则判定视频播放结束。需要说明的是,第二帧数阈值要小于第一帧数阈值。It can be understood that the second frame number threshold can be set according to the requirements of video recognition. Therefore, this application does not specifically limit the specific value of the second frame number threshold. Taking the second frame number threshold as 5 frames as an example, When the continuous video frame is less than or equal to 5 frames, it is determined that the video playback ends. It should be noted that the second frame number threshold is smaller than the first frame number threshold.
可以理解的是,步骤103可以包括但不限于如下子步骤:It can be understood that step 103 may include but not limited to the following sub-steps:
在连续视频帧的帧数小于第一帧数阈值且大于第二帧数阈值的情况下,连续视频帧重新开始计数。When the number of consecutive video frames is less than the first frame number threshold and greater than the second frame number threshold, counting of the continuous video frames is restarted.
可以理解的是,第一帧数阈值和第二帧数阈值可以根据视频识别的要求进行设定,以第一帧数阈值为15帧、第二帧数阈值为5帧为例,在连续视频帧小于15帧且大于5帧的情况下,则对连续视频帧重新开始计数。连续视频帧重新计数,以重新判断视频播放状态。It can be understood that the first frame number threshold and the second frame number threshold can be set according to the requirements of video recognition. Taking the first frame number threshold as 15 frames and the second frame number threshold as 5 frames as an example, in continuous video When the frame is less than 15 frames and greater than 5 frames, counting of continuous video frames is restarted. Continuous video frames are recounted to re-judge the video playback status.
如图3所示,步骤104可以包括但不限于如下子步骤:As shown in Figure 3, step 104 may include but not limited to the following sub-steps:
步骤1041,对每一帧视频变化区域采用H.264标准进行压缩编码; Step 1041, compressing and encoding each frame of video change area using the H.264 standard;
步骤1042,以18fps帧频发送视频变化区域给终端。 Step 1042, sending the video change area to the terminal at a frame rate of 18 fps.
可以理解的是,对于压缩编码的方式以及发送视频变化区域给终端的帧频可以根据传输的要求来选择,因此,本申请对于压缩编码的方式和帧频的具体数值不做具体限定,以采用H.264标准为例,可以采用H.264标准对对每一帧图视频变化区域进行压缩编码,并且可以以18fps帧频发送视频变化区域给终端,安装在终端上的客户端接收到图像数据后,客户端通过解码渲染并显示图像。It can be understood that the compression coding method and the frame rate for sending the video change region to the terminal can be selected according to the transmission requirements. Therefore, this application does not specifically limit the compression coding method and the specific value of the frame rate. The H.264 standard is an example. The H.264 standard can be used to compress and encode the video change area of each frame, and the video change area can be sent to the terminal at a frame rate of 18fps, and the client installed on the terminal receives the image data. After that, the client renders and displays the image by decoding it.
可以理解的是,在步骤101之前可以包括但不限于如下子步骤:It can be understood that before step 101 may include but not limited to the following sub-steps:
获取绘图指令,绘图指令携带有需要更新视频每一帧图像的信息。Obtain the drawing instruction, which carries the information that needs to update each frame of the video.
可以理解的是,本申请的实现依赖SPICE协议图形命令流消息交互。SPICE协议主要由服务端,客户端以及相关组件QXL组成,如图4所示。画面更新起始于虚拟机内应用程序向虚机操作系统请求的绘制图形操作的命令。之后,虚拟机内部的QXL驱动捕获到图形应用程序的绘制操作,传递到QEMU虚拟的QXL设备后端。接着,加载到QEMU空间的SPICE库读取QXL命令。SPICE服务端维护渲染树,根据绘图指令来更新图像区域信息,对这些图像数据进行一定处理后发送至客户端。客户端解析数据进而完成图像画面更新。It can be understood that the implementation of the present application relies on the SPICE protocol graphics command stream message interaction. The SPICE protocol is mainly composed of server, client and related components QXL, as shown in Figure 4. The screen update starts from the command of the drawing operation requested by the application program in the virtual machine to the operating system of the virtual machine. After that, the QXL driver inside the virtual machine captures the drawing operation of the graphics application and passes it to the QEMU virtual QXL device backend. Next, the SPICE library loaded into the QEMU space reads the QXL commands. The SPICE server maintains the rendering tree, updates the image area information according to the drawing instructions, and sends the image data to the client after certain processing. The client parses the data and completes the update of the image screen.
具体地,在SPICE服务端和客户端分别部署好支持H.264压缩算法的依赖库,以作为虚拟化环境准备。启动虚拟机,SPICE客户端连接服务器,获取到完整的桌面图像。终端用户打开视频播放器开始播放视频。当虚拟机内开始播放视频时,虚拟机内部的QXL驱动捕获到图形应用程序的绘制操作,将该绘图指令传递到QEMU虚拟的QXL设备后端。SPICE服务端获取到该绘图指令,该绘图指令携带所需更新的图像信息。SPICE服务端根据绘图指令来更新图像区域信息,对这些图像数据进行一定处理后发送至客户端,客户端解析数据进而完成图像画面更新。Specifically, dependent libraries supporting the H.264 compression algorithm are deployed on the SPICE server and the client respectively, so as to prepare for the virtualization environment. Start the virtual machine, connect the SPICE client to the server, and obtain a complete desktop image. The end user opens the video player to start playing the video. When the video starts playing in the virtual machine, the QXL driver inside the virtual machine captures the drawing operation of the graphics application, and passes the drawing instruction to the QEMU virtual QXL device backend. The SPICE server obtains the drawing instruction, and the drawing instruction carries image information to be updated. The SPICE server updates the image area information according to the drawing instructions, processes the image data and sends them to the client, and the client parses the data to complete the image update.
如图5所示,图5是本申请一个实施例提供的一种视频处理方法的流程图。该视频处理方法可以应用于终端,视频处理方法包括但不限于如下步骤:As shown in FIG. 5 , FIG. 5 is a flowchart of a video processing method provided by an embodiment of the present application. The video processing method can be applied to a terminal, and the video processing method includes but is not limited to the following steps:
步骤201,接收经过服务器压缩编码的视频变化区域,视频变化区域由服务器遍历云桌面每一帧图像而得到; Step 201, receiving the video change area compressed and coded by the server, the video change area is obtained by traversing each frame of image of the cloud desktop by the server;
步骤202,对视频变化区域解码渲染,以显示视频每一帧图像。 Step 202, decoding and rendering the video change area to display each frame of the video.
可以理解的是,安装在服务器的服务端通过遍历云桌面每一帧图像变化区域,排除视频 变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端,安装在终端的客户端接收经过服务器压缩编码的视频变化区域,对视频变化区域解码渲染,以显示视频每一帧图像,从而完成图像画面更新,其中,视频变化区域由服务器遍历云桌面每一帧图像而得到。基于此,对比原生SPICE协议,本方法能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。It can be understood that the server installed on the server traverses the image change area of each frame of the cloud desktop, excludes the image outside the video change area, and processes the specific change area. When the video image conditions are continuously met, a video stream is formed and compressed. After encoding, it is sent to the terminal, and the client installed on the terminal receives the video change area compressed and encoded by the server, decodes and renders the video change area to display each frame of the video image, and completes the image update. Among them, the video change area is provided by the server Obtained by traversing each image frame of the cloud desktop. Based on this, compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
以下结合具体实施例进一步介绍本申请提供的视频处理方法。The following further introduces the video processing method provided by the present application in conjunction with specific embodiments.
进行虚拟化环境准备,在SPICE服务端和客户端分别部署好支持H.264压缩算法的依赖库。Prepare the virtualization environment, and deploy the dependent libraries supporting the H.264 compression algorithm on the SPICE server and client respectively.
启动虚拟机,SPICE客户端连接服务器,获取到完整的桌面图像。终端用户打开视频播放器开始播放视频。当虚拟机内开始播放视频时,虚拟机内部的QXL驱动捕获到图形应用程序的绘制操作,将该图形绘制指令传递到QEMU虚拟的QXL设备后端。Start the virtual machine, connect the SPICE client to the server, and obtain a complete desktop image. The end user opens the video player to start playing the video. When the video starts to play in the virtual machine, the QXL driver inside the virtual machine captures the drawing operation of the graphics application, and passes the graphics drawing instruction to the QEMU virtual QXL device backend.
SPICE服务端获取到该绘图指令,该指令携带所需更新的图像信息。SPICE服务端对每一帧图像内更新的图像区域进行判断。遍历当前帧所有变化区域,找出最大变化区域。视频变化区域的图像复杂度较高,判断上述最大变化区域图像复杂度是否满足视频图像复杂度。图像复杂度的计算依赖与图像的色彩复杂及图像大小等因素,会根据各部分的比例计算出一定的分值,根据分值可将图像复杂度分为高中低三等,播放视频变化图像复杂度一般为高。判断下一帧图像是否属于连续视频帧。下一帧图像最大变化区域与上一帧图像的最大变化区域中心坐标相差在20个像素内,或者最大变化区域面积达到屏幕一定占比,此时可以认为下一帧属于连续视频帧。当确定连续视频帧达到15帧,判定视频播放开始。而当确定连续视频帧小于5帧,判定视频播放结束。当判定视频播放开始,可以将每一帧内变化图像采用H.264标准进行压缩编码,以18fps帧频发送至客户端,客户端完成解码渲染并展示图像,从而完成图像画面更新。The SPICE server obtains the drawing command, which carries the image information to be updated. The SPICE server judges the updated image area in each frame of image. Traverse all changing regions of the current frame to find the largest changing region. The image complexity of the video change area is relatively high, and it is judged whether the above image complexity of the maximum change area satisfies the video image complexity. The calculation of image complexity depends on factors such as image color complexity and image size. A certain score will be calculated according to the proportion of each part. According to the score, the image complexity can be divided into three grades, high, medium, and low. Playing video changes image complexity Generally high. Determine whether the next frame image belongs to a continuous video frame. If the difference between the maximum change area of the next frame image and the center coordinate of the maximum change area of the previous frame image is within 20 pixels, or the area of the maximum change area reaches a certain proportion of the screen, the next frame can be considered as a continuous video frame. When it is determined that the continuous video frame reaches 15 frames, it is determined that the video playback starts. And when it is determined that the continuous video frame is less than 5 frames, it is determined that the video playback ends. When it is determined that the video playback starts, the changing image in each frame can be compressed and encoded using the H.264 standard, and sent to the client at a frame rate of 18fps. The client completes decoding, rendering and displaying the image, thereby completing the image update.
如图6所示,本申请实施例还提供了一种服务器。As shown in FIG. 6 , the embodiment of the present application also provides a server.
具体地,该服务器包括:一个或多个处理器和存储器,图6中以一个处理器及存储器为例。处理器和存储器可以通过总线或者其他方式连接,图6中以通过总线连接为例。Specifically, the server includes: one or more processors and memories, and one processor and memories are taken as an example in FIG. 6 . The processor and the memory may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 6 .
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序,如上述本申请实施例中的视频处理方法。处理器通过运行存储在存储器中的非暂态软件程序以及程序,从而实现上述本申请实施例中的视频处理方法。As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the video processing method in the above-mentioned embodiments of the present application. The processor executes the non-transitory software program and the program stored in the memory, so as to implement the video processing method in the above-mentioned embodiments of the present application.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储执行上述本申请实施例中的视频处理方法所需的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application required by the function; the data storage area may store the data required for executing the video processing method in the above-mentioned embodiment of the present application wait. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may include memory located remotely from the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
实现上述本申请实施例中的视频处理方法所需的非暂态软件程序以及程序存储在存储器中,当被一个或者多个处理器执行时,执行上述本申请实施例中的视频处理方法,例如,执行以上描述的图1中的方法步骤101至步骤104,图2中的方法步骤1011至步骤1014,图3中的方法步骤1041至步骤1042,通过遍历云桌面每一帧图像以确定视频变化区域,在任意相邻两帧中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区 域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧,根据连续视频帧的帧数确定视频播放状态,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。基于此,通过遍历桌面所有图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端。对比原生SPICE协议,能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。The non-transitory software programs and programs required to realize the video processing method in the above embodiment of the present application are stored in the memory, and when executed by one or more processors, the video processing method in the above embodiment of the present application is executed, for example , execute the method steps 101 to 104 in Fig. 1 described above, the method steps 1011 to 1014 in Fig. 2, and the method steps 1041 to 1042 in Fig. 3, and determine the video change by traversing each frame image of the cloud desktop If the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than the preset value, determine the next The frames belong to continuous video frames, and the video playback status is determined according to the number of consecutive video frames. When it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal. Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded. Compared with the native SPICE protocol, it can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
如图7所示,本申请实施例还提供了一种终端。As shown in FIG. 7 , the embodiment of the present application also provides a terminal.
具体地,该终端包括:一个或多个处理器和存储器,图7中以一个处理器及存储器为例。处理器和存储器可以通过总线或者其他方式连接,图7中以通过总线连接为例。Specifically, the terminal includes: one or more processors and memories, and one processor and memories are taken as an example in FIG. 7 . The processor and the memory may be connected through a bus or in other ways, and connection through a bus is taken as an example in FIG. 7 .
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序,如上述本申请实施例中的视频处理方法。处理器通过运行存储在存储器中的非暂态软件程序以及程序,从而实现上述本申请实施例中的视频处理方法。As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the video processing method in the above-mentioned embodiments of the present application. The processor executes the non-transitory software program and the program stored in the memory, so as to implement the video processing method in the above-mentioned embodiments of the present application.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储执行上述本申请实施例中的视频处理方法所需的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application required by the function; the data storage area may store the data required for executing the video processing method in the above-mentioned embodiment of the present application wait. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may include memory located remotely from the processor, and these remote memories may be connected to the terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
实现上述本申请实施例中的视频处理方法所需的非暂态软件程序以及程序存储在存储器中,当被一个或者多个处理器执行时,执行上述本申请实施例中的视频处理方法,例如,执行以上描述的图5中的方法步骤201至步骤202,安装在服务器的服务端通过遍历每一帧图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端,安装在终端的客户端接收经过服务器压缩编码的视频变化区域,对视频变化区域解码渲染,以显示视频每一帧图像,从而完成图像画面更新,其中,视频变化区域由服务器遍历云桌面每一帧图像而得到。基于此,对比原生SPICE协议,能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。The non-transitory software programs and programs required to realize the video processing method in the above embodiment of the present application are stored in the memory, and when executed by one or more processors, the video processing method in the above embodiment of the present application is executed, for example , execute steps 201 to 202 of the method in Figure 5 described above, and the server installed on the server traverses the image change area of each frame, excludes images other than the video change area, and processes the specific change area. Image conditions, form a video stream, and send it to the terminal after compression and encoding. The client installed on the terminal receives the video change area compressed and encoded by the server, decodes and renders the video change area to display each frame of the video image, and completes the image screen Update, wherein, the video change area is obtained by the server traversing each frame of the image of the cloud desktop. Based on this, compared with the native SPICE protocol, it can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
此外,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机可执行程序,该计算机可执行程序被一个或多个控制处理器执行,例如,被图6中的一个处理器执行,可使得上述一个或多个处理器执行上述本申请实施例中的视频处理方法,例如,执行以上描述的图1中的方法步骤101至步骤104,图2中的方法步骤1011至步骤1014,图3中的方法步骤1041至步骤1042,图5中的方法步骤201至步骤202,通过遍历云桌面每一帧图像以确定视频变化区域,在任意相邻两帧中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧,根据连续视频帧的帧数确定视频播放状态,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。基于此,通过遍历桌面所有图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端,终端接收经过服务器压缩编码的视频变化区域,对视频变化区域解码渲染,以显示视频每一帧图像,从而完成图像画面更新。对比原生SPICE协议,能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。In addition, the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer-executable program, and the computer-executable program is executed by one or more control processors, for example, as shown in FIG. 6 Execution by one of the processors can cause the above-mentioned one or more processors to execute the video processing method in the above-mentioned embodiment of the present application, for example, execute the method steps 101 to 104 in FIG. 1 described above, and the method in FIG. 2 Step 1011 to step 1014, method step 1041 to step 1042 in Figure 3, method step 201 to step 202 in Figure 5, by traversing each frame image of the cloud desktop to determine the video change area, in any two adjacent frames If the difference between the video change areas corresponding to the previous frame and the next frame is less than the pixel threshold, or the ratio of the area of the video change area to the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame. The number of frames determines the video playback status. When it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal. Based on this, by traversing all the image change areas of the desktop, excluding images other than the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed, compressed and encoded, and then sent to the terminal, and the terminal receives it after compression by the server The coded video change area is decoded and rendered to display each frame of the video, thereby completing the update of the image screen. Compared with the native SPICE protocol, it can greatly improve the problems of video image fragmentation and stuttering in the barrage scene.
本申请实施例包括:通过遍历云桌面每一帧图像以确定视频变化区域,在任意相邻两帧 中的上一帧和下一帧分别对应的视频变化区域相差小于像素阈值,或者视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定下一帧属于连续视频帧,根据连续视频帧的帧数确定视频播放状态,当确定视频开始播放,发送经过压缩编码的视频变化区域给终端。基于此,通过遍历桌面所有图像变化区域,排除视频变化区域以外的图像,对特定的变化区域处理,当连续满足视频图像条件,形成视频流,经过压缩编码后发送至终端。对比原生SPICE协议,本方法能够在很大程度上改善弹幕场景下播放视频图像割裂及卡顿等问题。The embodiment of this application includes: by traversing each frame of the cloud desktop image to determine the video change area, the difference between the video change areas corresponding to the previous frame and the next frame in any two adjacent frames is less than the pixel threshold, or the video change area When the proportion of the area relative to the terminal screen is greater than the preset value, it is determined that the next frame belongs to a continuous video frame, and the video playback status is determined according to the number of consecutive video frames. When it is determined that the video starts to play, the compressed and encoded video change area is sent to the terminal. Based on this, by traversing all image change areas on the desktop, excluding images outside the video change area, and processing specific change areas, when the video image conditions are continuously met, a video stream is formed and sent to the terminal after being compressed and encoded. Compared with the native SPICE protocol, this method can greatly improve the problems of video image fragmentation and stuttering in the bullet chatting scene.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统可以被实施为软件、固件、硬件及其适当的组合。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读程序、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读程序、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those skilled in the art can understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware and an appropriate combination thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit . Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable programs, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable programs, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
以上是对本申请的一些实施进行了具体说明,但本申请并不局限于上述实施方式,熟悉本领域的技术人员在不违背本申请范围的共享条件下还可作出种种等同的变形或替换,这些等同的变形或替换均包括在本申请权利要求所限定的范围内。The above is a specific description of some implementations of the present application, but the present application is not limited to the above-mentioned embodiments, and those skilled in the art can also make various equivalent deformations or replacements without violating the sharing conditions of the scope of the present application. Equivalent modifications or replacements are all within the scope defined by the claims of the present application.

Claims (12)

  1. 一种视频处理方法,应用于服务器,所述方法包括:A video processing method applied to a server, the method comprising:
    遍历云桌面每一帧图像以确定视频变化区域;Traversing each frame of the cloud desktop image to determine the video change area;
    在任意相邻两帧中的上一帧和下一帧分别对应的所述视频变化区域相差小于像素阈值,或者所述视频变化区域面积相对终端屏幕的占比大于预设值的情况下,确定所述下一帧属于连续视频帧;In the case where the difference between the video change regions corresponding to the previous frame and the next frame in any two adjacent frames is smaller than the pixel threshold, or the ratio of the area of the video change region to the terminal screen is greater than a preset value, determine The next frame belongs to consecutive video frames;
    根据所述连续视频帧的帧数确定视频播放状态;Determine the video playback state according to the frame number of the continuous video frame;
    当确定视频开始播放,发送经过压缩编码的所述视频变化区域给终端。When it is determined that the video starts to play, the compressed and coded video change area is sent to the terminal.
  2. 根据权利要求1所述的方法,其中,所述遍历云桌面每一帧图像以确定视频变化区域,包括:The method according to claim 1, wherein said traversing each frame image of the cloud desktop to determine the video change area comprises:
    识别云桌面每一帧图像内更新的图像区域,以确定所有图像变化区域;Identify the updated image area in each frame image of the cloud desktop to determine all image change areas;
    从所有图像变化区域中找出最大变化区域;Find the largest change area from all image change areas;
    根据图像参数对应的权重值确定所述最大变化区域的图像复杂度;determining the image complexity of the maximum change region according to the weight value corresponding to the image parameter;
    根据所述最大变化区域的图像复杂度确定视频变化区域。Determine the video change area according to the image complexity of the maximum change area.
  3. 根据权利要求2所述的方法,其中,所述图像参数包括以下至少之一:The method according to claim 2, wherein the image parameters include at least one of the following:
    图像的色彩;the color of the image;
    图像的大小。The size of the image.
  4. 根据权利要求2所述的方法,其中,所述根据所述连续视频帧的帧数确定视频播放状态,包括:The method according to claim 2, wherein said determining the video playback state according to the number of consecutive video frames comprises:
    在所述连续视频帧的帧数大于等于第一帧数阈值的情况下,确定视频播放开始。If the frame number of the continuous video frames is greater than or equal to the first frame number threshold, it is determined that video playback starts.
  5. 根据权利要求4所述的方法,其中,所述根据所述连续视频帧的帧数确定视频播放状态,包括:The method according to claim 4, wherein said determining the video playback status according to the frame number of the continuous video frames comprises:
    在所述连续视频帧的帧数小于等于第二帧数阈值的情况下,确定视频播放结束,其中,所述第二帧数阈值小于所述第一帧数阈值。If the frame number of the continuous video frames is less than or equal to a second frame number threshold, it is determined that the video playback ends, wherein the second frame number threshold is smaller than the first frame number threshold.
  6. 根据权利要求5所述的方法,其中,所述根据所述连续视频帧的帧数确定视频播放状态,包括:The method according to claim 5, wherein said determining the video playback status according to the frame number of the continuous video frames comprises:
    在所述连续视频帧的帧数小于所述第一帧数阈值且大于所述第二帧数阈值的情况下,所述连续视频帧重新开始计数。When the frame number of the continuous video frames is less than the first frame number threshold and greater than the second frame number threshold, the continuous video frames restart counting.
  7. 根据权利要求1所述的方法,其中,所述发送经过压缩编码的所述视频变化区域给终端,包括:The method according to claim 1, wherein the sending the compressed and coded video change region to the terminal comprises:
    对每一帧所述视频变化区域采用H.264标准进行压缩编码;compressing and encoding the video change area described in each frame using the H.264 standard;
    以18fps帧频发送所述视频变化区域给终端。Send the video change area to the terminal at a frame rate of 18fps.
  8. 根据权利要求1所述的方法,其中,在所述遍历云桌面每一帧图像以确定视频变化区域之前,还包括:The method according to claim 1, wherein, before traversing each frame image of the cloud desktop to determine the video change area, further comprising:
    获取绘图指令,所述绘图指令携带有需要更新视频每一帧图像的信息。A drawing instruction is obtained, and the drawing instruction carries information that needs to update each frame of the video.
  9. 一种视频处理方法,应用于终端,所述方法包括:A video processing method applied to a terminal, the method comprising:
    接收经过服务器压缩编码的视频变化区域,所述视频变化区域由所述服务器遍历云桌面每一帧图像而得到;Receiving the video change area compressed and encoded by the server, the video change area is obtained by traversing each frame of image of the cloud desktop by the server;
    对所述视频变化区域解码渲染,以显示视频每一帧图像。Decode and render the video change area to display each frame of the video.
  10. 一种服务器,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求1至8中任意一项所述的视频处理方法。A server, comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein, when the processor executes the computer program, the computer program described in any one of claims 1 to 8 is implemented. The video processing method described above.
  11. 一种终端,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求9所述的视频处理方法。A terminal, comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the video processing method according to claim 9 is implemented when the processor executes the computer program.
  12. 一种计算机可读存储介质,存储有计算机可执行程序,其中,所述计算机可执行程序用于使计算机执行如权利要求1至8任意一项所述的视频处理方法,或者如权利要求9所述的视频处理方法。A computer-readable storage medium storing a computer-executable program, wherein the computer-executable program is used to enable a computer to execute the video processing method according to any one of claims 1 to 8, or the computer-executable program according to claim 9 The video processing method described above.
PCT/CN2022/091023 2021-08-23 2022-05-05 Video processing method, server, and computer-readable storage medium WO2023024563A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110967926.8A CN113423012B (en) 2021-08-23 2021-08-23 Video processing method, server, and computer-readable storage medium
CN202110967926.8 2021-08-23

Publications (1)

Publication Number Publication Date
WO2023024563A1 true WO2023024563A1 (en) 2023-03-02

Family

ID=77719276

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091023 WO2023024563A1 (en) 2021-08-23 2022-05-05 Video processing method, server, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN113423012B (en)
WO (1) WO2023024563A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113423012B (en) * 2021-08-23 2021-12-03 中兴通讯股份有限公司 Video processing method, server, and computer-readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883140A (en) * 2010-06-13 2010-11-10 北京北大众志微系统科技有限责任公司 Coding system and method based on remote display as well as server
US20110103465A1 (en) * 2009-10-30 2011-05-05 Kuo-Lung Chang Encoding method of screen frame and electronic device applying the same
CN102541555A (en) * 2011-12-27 2012-07-04 福建升腾资讯有限公司 Method for remotely smoothly playing desktop video in API (application programming interface) interception mode
CN102625106A (en) * 2012-03-28 2012-08-01 上海交通大学 Scene self-adaptive screen encoding rate control method and system
CN102771119A (en) * 2009-12-22 2012-11-07 思杰系统有限公司 Systems and methods for video-aware screen capture and compression
US20130159393A1 (en) * 2011-12-20 2013-06-20 Fujitsu Limited Information processing apparatus and method
TW201509172A (en) * 2013-08-28 2015-03-01 Intel Corp Media encoding using changed regions
CN105809659A (en) * 2014-12-30 2016-07-27 华为技术有限公司 Video detection method and device
CN106101830A (en) * 2016-07-08 2016-11-09 中霆云计算科技(上海)有限公司 A kind of video flow detection method combined based on region detection and applying detection
CN106227477A (en) * 2016-07-08 2016-12-14 中霆云计算科技(上海)有限公司 A kind of damage automatic switching method for the lossless of RDP
CN107368269A (en) * 2016-05-11 2017-11-21 北京京东尚科信息技术有限公司 Transmit the methods, devices and systems of screen picture
CN109660832A (en) * 2018-11-10 2019-04-19 江苏网进科技股份有限公司 A kind of desktop virtual system and method
CN112788425A (en) * 2020-12-28 2021-05-11 深圳Tcl新技术有限公司 Dynamic area display method, device, equipment and computer readable storage medium
WO2021147464A1 (en) * 2020-01-22 2021-07-29 北京字节跳动网络技术有限公司 Video processing method and apparatus, and electronic device
CN113423012A (en) * 2021-08-23 2021-09-21 中兴通讯股份有限公司 Video processing method, server, and computer-readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104053019A (en) * 2013-03-12 2014-09-17 中兴通讯股份有限公司 Video playing and processing method and device based on virtual desktop
CN104618473B (en) * 2015-01-26 2019-04-16 上海视聪网络信息技术有限公司 Virtual machine desktop display methods and device
CN105245915B (en) * 2015-09-30 2018-11-23 上海有孚网络股份有限公司 Cloud desktop collaborative HD video transmission method
KR102167505B1 (en) * 2019-02-28 2020-10-19 에스케이브로드밴드주식회사 Virtual desktop system for high-definition video service and method thereof
CN112291587A (en) * 2019-07-25 2021-01-29 上海达龙信息科技有限公司 Dynamic video frame processing method, system, medium and server of remote desktop

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110103465A1 (en) * 2009-10-30 2011-05-05 Kuo-Lung Chang Encoding method of screen frame and electronic device applying the same
CN102771119A (en) * 2009-12-22 2012-11-07 思杰系统有限公司 Systems and methods for video-aware screen capture and compression
CN101883140A (en) * 2010-06-13 2010-11-10 北京北大众志微系统科技有限责任公司 Coding system and method based on remote display as well as server
US20130159393A1 (en) * 2011-12-20 2013-06-20 Fujitsu Limited Information processing apparatus and method
CN102541555A (en) * 2011-12-27 2012-07-04 福建升腾资讯有限公司 Method for remotely smoothly playing desktop video in API (application programming interface) interception mode
CN102625106A (en) * 2012-03-28 2012-08-01 上海交通大学 Scene self-adaptive screen encoding rate control method and system
TW201509172A (en) * 2013-08-28 2015-03-01 Intel Corp Media encoding using changed regions
CN105809659A (en) * 2014-12-30 2016-07-27 华为技术有限公司 Video detection method and device
CN107368269A (en) * 2016-05-11 2017-11-21 北京京东尚科信息技术有限公司 Transmit the methods, devices and systems of screen picture
CN106101830A (en) * 2016-07-08 2016-11-09 中霆云计算科技(上海)有限公司 A kind of video flow detection method combined based on region detection and applying detection
CN106227477A (en) * 2016-07-08 2016-12-14 中霆云计算科技(上海)有限公司 A kind of damage automatic switching method for the lossless of RDP
CN109660832A (en) * 2018-11-10 2019-04-19 江苏网进科技股份有限公司 A kind of desktop virtual system and method
WO2021147464A1 (en) * 2020-01-22 2021-07-29 北京字节跳动网络技术有限公司 Video processing method and apparatus, and electronic device
CN112788425A (en) * 2020-12-28 2021-05-11 深圳Tcl新技术有限公司 Dynamic area display method, device, equipment and computer readable storage medium
CN113423012A (en) * 2021-08-23 2021-09-21 中兴通讯股份有限公司 Video processing method, server, and computer-readable storage medium

Also Published As

Publication number Publication date
CN113423012A (en) 2021-09-21
CN113423012B (en) 2021-12-03

Similar Documents

Publication Publication Date Title
CN111882626B (en) Image processing method, device, server and medium
US10306180B2 (en) Predictive virtual reality content streaming techniques
CN109600666B (en) Video playing method, device, medium and electronic equipment in game scene
EP4192015A1 (en) Video encoding method, video decoding method, apparatus, electronic device, storage medium, and computer program product
US9081536B2 (en) Performance enhancement in virtual desktop infrastructure (VDI)
US9619916B2 (en) Method for transmitting digital scene description data and transmitter and receiver scene processing device
CN112235626B (en) Video rendering method and device, electronic equipment and storage medium
US9426476B2 (en) Video stream
US11317123B2 (en) Systems and methods for using pre-calculated block hashes for image block matching
US20130147787A1 (en) Systems and Methods for Transmitting Visual Content
US10805570B2 (en) System and method for streaming multimedia data
WO2017129118A1 (en) Graphic instruction data processing method, apparatus and system
CN110582012B (en) Video switching method, video processing device and storage medium
US20220193540A1 (en) Method and system for a cloud native 3d scene game
US9438917B2 (en) System and method for adaptive bandwidth management
US11356739B2 (en) Video playback method, terminal apparatus, and storage medium
CN112843676B (en) Data processing method, device, terminal, server and storage medium
WO2023024563A1 (en) Video processing method, server, and computer-readable storage medium
WO2023040825A1 (en) Media information transmission method, computing device and storage medium
US10462200B2 (en) System for cloud streaming service, method for still image-based cloud streaming service and apparatus therefor
JP2016525297A (en) Picture reference control for video decoding using a graphics processor
CN111885417B (en) VR video playing method, device, equipment and storage medium
CN114598912A (en) Multimedia file display method and device, storage medium and electronic equipment
CN111683286A (en) Novel video redirection method
WO2021103983A1 (en) Epg ui frame processing method and device, server and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22859913

Country of ref document: EP

Kind code of ref document: A1