[go: up one dir, main page]

CN113691866B - Video processing method, device, electronic device and medium - Google Patents

Video processing method, device, electronic device and medium Download PDF

Info

Publication number
CN113691866B
CN113691866B CN202110978074.2A CN202110978074A CN113691866B CN 113691866 B CN113691866 B CN 113691866B CN 202110978074 A CN202110978074 A CN 202110978074A CN 113691866 B CN113691866 B CN 113691866B
Authority
CN
China
Prior art keywords
video
data
current
image frame
current video
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110978074.2A
Other languages
Chinese (zh)
Other versions
CN113691866A (en
Inventor
李宇航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110978074.2A priority Critical patent/CN113691866B/en
Publication of CN113691866A publication Critical patent/CN113691866A/en
Application granted granted Critical
Publication of CN113691866B publication Critical patent/CN113691866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4318Generation of visual interfaces for content selection or interaction; Content or additional data rendering by altering the content in the rendering process, e.g. blanking, blurring or masking an image region
    • 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 or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • 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/4782Web browsing, e.g. WebTV
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8173End-user applications, e.g. Web browser, game

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本公开公开了一种视频处理方法、装置、设备、介质和产品,涉及计算机视觉、图像处理等领域。视频处理方法包括:针对具有灰度数据和色彩数据的当前视频,处理当前视频的灰度数据,得到透明度数据;基于透明度数据和色彩数据,构建与当前视频相关联的至少一个待显示图像;显示至少一个待显示图像。

The present disclosure discloses a video processing method, device, equipment, medium and product, which relate to the fields of computer vision, image processing, etc. The video processing method includes: for a current video having grayscale data and color data, processing the grayscale data of the current video to obtain transparency data; constructing at least one to-be-displayed image associated with the current video based on the transparency data and the color data; and displaying at least one to-be-displayed image.

Description

视频处理方法、装置、电子设备和介质Video processing method, device, electronic device and medium

技术领域Technical Field

本公开涉及计算机技术领域,尤其涉及计算机视觉、图像处理等领域,更具体地,涉及一种视频处理方法、装置、电子设备、介质和程序产品。The present disclosure relates to the field of computer technology, in particular to the fields of computer vision, image processing, and more specifically to a video processing method, device, electronic device, medium, and program product.

背景技术Background technique

随着互联网的快速发展,用户对视频播放的要求越来越高。例如,用户在浏览器页面上浏览相关内容时,希望在浏览器页面上播放的视频尽量不影响用户浏览相关内容,使得用户能够同时浏览相关内容和观看播放的视频。但是,相关技术中视频播放的技术难以满足用户的需求,降低了用户浏览相关内容和观看视频的体验。With the rapid development of the Internet, users have higher and higher requirements for video playback. For example, when a user browses related content on a browser page, it is hoped that the video played on the browser page will not affect the user's browsing of related content as much as possible, so that the user can browse related content and watch the played video at the same time. However, the video playback technology in the related art is difficult to meet the needs of users, which reduces the user's experience of browsing related content and watching videos.

发明内容Summary of the invention

本公开提供了一种视频处理方法、装置、电子设备、存储介质以及程序产品。The present disclosure provides a video processing method, device, electronic device, storage medium and program product.

根据本公开的一方面,提供了一种视频处理方法,包括:针对具有灰度数据和色彩数据的当前视频,处理所述当前视频的灰度数据,得到透明度数据;基于所述透明度数据和所述色彩数据,构建与所述当前视频相关联的至少一个待显示图像;显示所述至少一个待显示图像。According to one aspect of the present disclosure, a video processing method is provided, comprising: for a current video having grayscale data and color data, processing the grayscale data of the current video to obtain transparency data; constructing at least one image to be displayed associated with the current video based on the transparency data and the color data; and displaying the at least one image to be displayed.

根据本公开的另一方面,提供了一种视频处理装置,包括:第一处理模块、构建模块以及第一显示模块。第一处理模块,用于针对具有灰度数据和色彩数据的当前视频,处理所述当前视频的灰度数据,得到透明度数据;构建模块,用于基于所述透明度数据和所述色彩数据,构建与所述当前视频相关联的至少一个待显示图像;第一显示模块,用于显示所述至少一个待显示图像。According to another aspect of the present disclosure, a video processing device is provided, comprising: a first processing module, a construction module, and a first display module. The first processing module is used to process the grayscale data of a current video having grayscale data and color data to obtain transparency data; the construction module is used to construct at least one to-be-displayed image associated with the current video based on the transparency data and the color data; and the first display module is used to display the at least one to-be-displayed image.

根据本公开的另一方面,提供了一种电子设备,包括:至少一个处理器和与所述至少一个处理器通信连接的存储器。其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的视频处理方法。According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned video processing method.

根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行上述的视频处理方法。According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned video processing method.

根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述的视频处理方法。According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned video processing method when executed by a processor.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

图1示意性示出了根据本公开一实施例的视频处理方法和装置的应用场景;FIG1 schematically shows an application scenario of a video processing method and apparatus according to an embodiment of the present disclosure;

图2示意性示出了根据本公开一实施例的视频处理方法的流程图;FIG2 schematically shows a flow chart of a video processing method according to an embodiment of the present disclosure;

图3示意性示出了根据本公开另一实施例的视频处理方法的流程图;FIG3 schematically shows a flow chart of a video processing method according to another embodiment of the present disclosure;

图4示意性示出了根据本公开一实施例的视频处理方法的示意图;FIG4 schematically shows a schematic diagram of a video processing method according to an embodiment of the present disclosure;

图5示意性示出了根据本公开一实施例的视频处理装置的框图;以及FIG5 schematically shows a block diagram of a video processing device according to an embodiment of the present disclosure; and

图6是用来实现本公开实施例的用于执行视频处理的电子设备的框图。FIG. 6 is a block diagram of an electronic device for performing video processing to implement an embodiment of the present disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and/or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。When using expressions such as "at least one of A, B, and C", they should generally be interpreted according to the meaning of the expression commonly understood by technical personnel in this field (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc.).

本公开的实施例提供了一种视频处理方法。视频处理方法包括:针对具有灰度数据和色彩数据的当前视频,处理当前视频的灰度数据,得到透明度数据。然后,基于透明度数据和色彩数据,构建与当前视频相关联的至少一个待显示图像。接下来,显示至少一个待显示图像。The embodiment of the present disclosure provides a video processing method. The video processing method includes: for a current video having grayscale data and color data, processing the grayscale data of the current video to obtain transparency data. Then, based on the transparency data and the color data, constructing at least one to-be-displayed image associated with the current video. Next, displaying the at least one to-be-displayed image.

图1示意性示出了根据本公开一实施例的视频处理方法和装置的应用场景。需要注意的是,图1所示仅为可以应用本公开实施例的应用场景的示例,以帮助本领域技术人员理解本公开的技术内容,但并不意味着本公开实施例不可以用于其他设备、系统、环境或场景。FIG1 schematically shows an application scenario of a video processing method and apparatus according to an embodiment of the present disclosure. It should be noted that FIG1 is only an example of an application scenario to which the present disclosure embodiment can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the present disclosure embodiment cannot be used in other devices, systems, environments or scenarios.

如图1所示,本公开实施例的应用场景100包括浏览器页面110,在浏览器页面110上可以显示相关的内容。As shown in FIG. 1 , the application scenario 100 of the embodiment of the present disclosure includes a browser page 110 , on which relevant content can be displayed.

例如,在浏览器页面110上显示的相关内容以“X”表示,显示的相关内容包括但不仅限于文字、图片、图标等等。例如,当用户通过浏览器进行搜索时,相关内容可以包括针对用户的搜索词的搜索结果。For example, the related content displayed on the browser page 110 is represented by an "X", and the displayed related content includes but is not limited to text, pictures, icons, etc. For example, when a user searches through a browser, the related content may include search results for the user's search terms.

示例性地,在浏览器页面110上可以播放视频。相关技术在播放视频111时,视频111通常遮挡显示在浏览器页面110上的相关内容。Exemplarily, a video may be played on the browser page 110. Related Art When a video 111 is played, the video 111 usually blocks related content displayed on the browser page 110.

为了解决视频111遮挡显示在浏览器页面110上的相关内容的问题,可以将具有透明度数据的视频112播放在浏览器页面110上,尽可能避免视频112遮挡显示在浏览器页面110上的相关内容。具有透明度数据的视频112中的背景部分例如为透明。In order to solve the problem that the video 111 blocks the relevant content displayed on the browser page 110, the video 112 with transparency data can be played on the browser page 110 to avoid the video 112 blocking the relevant content displayed on the browser page 110 as much as possible. The background part of the video 112 with transparency data is transparent, for example.

但是,相关技术的浏览器通常不支持播放具有透明度数据的视频112,因此,通过本公开实施例的视频处理方法,可以实现在浏览器页面110上显示具有透明度数据的视频112。However, browsers in related technologies generally do not support playing the video 112 with transparency data. Therefore, through the video processing method of the embodiment of the present disclosure, it is possible to display the video 112 with transparency data on the browser page 110.

本公开实施例提供了一种视频处理方法,下面结合图1的应用场景,参考图2~图4来描述根据本公开示例性实施方式的视频处理方法。An embodiment of the present disclosure provides a video processing method. The video processing method according to an exemplary implementation of the present disclosure is described below with reference to FIGS. 2 to 4 in conjunction with the application scenario of FIG. 1 .

图2示意性示出了根据本公开一实施例的视频处理方法的流程图。FIG. 2 schematically shows a flow chart of a video processing method according to an embodiment of the present disclosure.

如图2所示,本公开实施例的视频处理方法200例如可以包括操作S210~操作S230。As shown in FIG. 2 , the video processing method 200 of the embodiment of the present disclosure may include, for example, operations S210 to S230 .

在操作S210,针对具有灰度数据和色彩数据的当前视频,处理当前视频的灰度数据,得到透明度数据。In operation S210, for a current video having grayscale data and color data, grayscale data of the current video is processed to obtain transparency data.

在操作S220,基于透明度数据和色彩数据,构建与当前视频相关联的至少一个待显示图像。In operation S220, at least one to-be-displayed image associated with the current video is constructed based on the transparency data and the color data.

在操作S230,显示至少一个待显示图像。In operation S230, at least one image to be displayed is displayed.

示例性地,当前视频例如包括灰度通道和色彩通道,灰度通道指示了灰度数据,色彩通道指示了色彩数据。色彩通道例如包括RGB通道,R表示红色、G表示绿色、B表示蓝色,即,RGB通道包括三个通道,每个通道的像素值可以不同,每个通道的像素值的取值范围例如为0-255。灰色通道可以包括一个通道,该通道的像素值的取值范围例如为0-255。或者,该灰色通道也可以包括三个通道,该三个通道的像素值的取值均相同,例如均为0-255。Exemplarily, the current video includes a grayscale channel and a color channel, the grayscale channel indicates grayscale data, and the color channel indicates color data. The color channel includes, for example, RGB channels, R represents red, G represents green, and B represents blue, that is, the RGB channel includes three channels, the pixel value of each channel may be different, and the value range of the pixel value of each channel is, for example, 0-255. The gray channel may include one channel, and the value range of the pixel value of the channel is, for example, 0-255. Alternatively, the gray channel may also include three channels, and the pixel values of the three channels are all the same, for example, all 0-255.

当前视频的灰度数据例如是针对当前视频中每个图像帧中的背景部分,色彩数据例如是针对当前视频中每个图像帧中的主要对象所在部分。例如,如果当前视频是针对用户的,则色彩数据是针对用户所在的部分,灰度数据则是针对除用户之外的其他部分。The grayscale data of the current video is, for example, for the background part in each image frame in the current video, and the color data is, for example, for the part where the main object is located in each image frame in the current video. For example, if the current video is for a user, the color data is for the part where the user is located, and the grayscale data is for other parts except the user.

接下来,处理该灰度数据得到透明度数据,该透明度数据表征了当前视频中每个图像帧的背景部分的透明度。基于透明度数据和色彩数据构建至少一个待显示图像,该至少一个待显示图像与当前视频中的图像帧对应。至少一个待显示图像可以组成待显示视频,该待显示视频为透明视频,透明视频中的背景部分为透明。在一示例中,至少一个待显示图像的数量和当前视频中的图像帧数量可以一致。在得到至少一个待显示图像之后,可以显示待显示图像,进而实现播放透明视频。Next, the grayscale data is processed to obtain transparency data, which characterizes the transparency of the background part of each image frame in the current video. At least one image to be displayed is constructed based on the transparency data and the color data, and the at least one image to be displayed corresponds to the image frame in the current video. At least one image to be displayed can constitute a video to be displayed, and the video to be displayed is a transparent video, and the background part in the transparent video is transparent. In one example, the number of at least one image to be displayed and the number of image frames in the current video can be consistent. After obtaining at least one image to be displayed, the image to be displayed can be displayed, thereby achieving the playback of the transparent video.

根据本公开的实施例,在一些场景下播放器或浏览器不支持播放具有透明度数据的视频,因此无法将具有透明度数据的视频导入播放器或浏览器中。通过本公开实施例的技术方案,将具有灰度数据的当前视频导入播放器或浏览器中之后,再处理灰度数据得到透明度数据,基于透明度数据和色彩数据渲染与当前视频对应的多个待显示图像,该待显示图像的背景部分为透明,通过显示待显示图像间接实现了通过播放器或浏览器播放具有透明度数据的视频,实现了用户对视频播放的需求。According to the embodiments of the present disclosure, in some scenarios, the player or browser does not support playing videos with transparency data, so it is impossible to import videos with transparency data into the player or browser. Through the technical solution of the embodiments of the present disclosure, after the current video with grayscale data is imported into the player or browser, the grayscale data is processed to obtain transparency data, and multiple images to be displayed corresponding to the current video are rendered based on the transparency data and color data. The background part of the image to be displayed is transparent, and the video with transparency data is indirectly played through the player or browser by displaying the image to be displayed, thereby meeting the user's demand for video playback.

图3示意性示出了根据本公开另一实施例的视频处理方法的流程图。FIG3 schematically shows a flow chart of a video processing method according to another embodiment of the present disclosure.

如图3所示,本公开实施例的视频处理方法200例如可以包括操作S310~操作S360。其中,操作S340例如包括操作S341~操作S343。As shown in Fig. 3, the video processing method 200 of the embodiment of the present disclosure may include, for example, operations S310 to S360, wherein operation S340 includes, for example, operations S341 to S343.

在操作S310,获取初始视频,初始视频包括透明度数据和色彩数据。In operation S310, an initial video is acquired, the initial video including transparency data and color data.

以初始视频中的一个图像帧为例,该图像帧中的某一像素可以表示为RGBA(r,g,b,a),其中,r、g、b例如表示色彩通道,r、g、b取值范围例如均为0-255。a例如表示透明通道,a的取值范围例如为0-1,当a为0时表示完全透明,当a为1时表示完全不透明,当a=0.5时表示半透明。Taking an image frame in the initial video as an example, a certain pixel in the image frame can be represented as RGBA (r, g, b, a), where r, g, b represent color channels, and the value ranges of r, g, b are, for example, 0-255. a represents a transparent channel, and the value range of a is, for example, 0-1. When a is 0, it means completely transparent, when a is 1, it means completely opaque, and when a=0.5, it means semi-transparent.

在操作S320,处理透明度数据,得到灰度数据。In operation S320, the transparency data is processed to obtain grayscale data.

在操作S330,基于灰度数据和色彩数据,得到当前视频。In operation S330, a current video is obtained based on the grayscale data and the color data.

例如,以第一权重对透明度数据进行加权处理,得到灰度数据。在一示例中,第一权重可以是数值255,将透明度数据乘以第一权重得到对应的灰度数据。例如,针对像素(r,g,b,a),处理其中的透明度数据a得到灰度数据a*255,处理后的像素可以表示为(r,g,b,a*255)。基于每个处理后的像素,得到当前视频。For example, the transparency data is weighted with a first weight to obtain grayscale data. In one example, the first weight may be a value of 255, and the transparency data is multiplied by the first weight to obtain the corresponding grayscale data. For example, for a pixel (r, g, b, a), the transparency data a is processed to obtain grayscale data a*255, and the processed pixel may be represented as (r, g, b, a*255). Based on each processed pixel, the current video is obtained.

在操作S340,针对具有灰度数据和色彩数据的当前视频,处理当前视频的灰度数据,得到透明度数据。例如,操作S340包括以下操作S341~操作S343。In operation S340, for a current video having grayscale data and color data, grayscale data of the current video is processed to obtain transparency data. For example, operation S340 includes the following operations S341 to S343.

在操作S341,在浏览器页面上播放当前视频。In operation S341, the current video is played on the browser page.

在操作S342,从播放的当前视频中确定当前图像帧。In operation S342, a current image frame is determined from the current video being played.

在操作S343,处理当前图像帧的灰度数据,得到针对当前图像帧的透明度数据。In operation S343, the grayscale data of the current image frame is processed to obtain transparency data for the current image frame.

示例性地,在浏览器页面上播放当前视频时,可以以隐藏格式进行播放,即用户在浏览器页面上看不到隐藏的当前视频,避免当前视频遮挡浏览器页面上的相关内容。然后,从隐藏播放的当前视频中确定此刻正在显示的当前图像帧。Exemplarily, when playing the current video on the browser page, it can be played in a hidden format, that is, the user cannot see the hidden current video on the browser page, avoiding the current video from blocking the relevant content on the browser page. Then, the current image frame being displayed at this moment is determined from the hidden current video.

然后,以第二权重对当前图像帧的灰度数据进行加权处理,得到针对当前图像帧的透明度数据。例如,针对当前图像帧,该当前图像帧的每个像素包括色彩数据灰度数据,将每个像素的灰度数据乘以第二权重得到透明度数据。Then, the grayscale data of the current image frame is weighted by the second weight to obtain transparency data for the current image frame. For example, for the current image frame, each pixel of the current image frame includes color data and grayscale data, and the grayscale data of each pixel is multiplied by the second weight to obtain transparency data.

例如,第二权重与第一权重互为倒数,当第一权重为255时,第二权重为1/255。例如,针对一个像素(r,g,b,a*255),a*255为灰度数据,基于第二权重处理该灰度数据a*255得到透明度数据a*255*1/255=a,处理后的像素可以表示为(r,g,b,a),a表示透明度数据。For example, the second weight is the reciprocal of the first weight, and when the first weight is 255, the second weight is 1/255. For example, for a pixel (r, g, b, a*255), a*255 is grayscale data, and the grayscale data a*255 is processed based on the second weight to obtain transparency data a*255*1/255=a. The processed pixel can be represented as (r, g, b, a), and a represents transparency data.

在操作S350,基于透明度数据和色彩数据,构建与当前视频相关联的至少一个待显示图像。In operation S350, at least one to-be-displayed image associated with the current video is constructed based on the transparency data and the color data.

例如,基于针对当前图像帧的透明度数据和针对当前图像帧的色彩数据,构建与当前图像帧对应的一个待显示图像。换言之,在当前视频隐藏播放时,可以实时检测当前视频正在显示的当前图像帧,并基于当前图像帧渲染得到对应的待显示图像,该待显示图像具有透明度数据。For example, based on the transparency data and the color data of the current image frame, an image to be displayed corresponding to the current image frame is constructed. In other words, when the current video is hidden and played, the current image frame being displayed by the current video can be detected in real time, and the corresponding image to be displayed can be rendered based on the current image frame, and the image to be displayed has transparency data.

在操作S360,显示至少一个待显示图像。例如,在浏览器的画布上显示至少一个待显示图像,即,通过检测当前视频的播放进度来逐帧进行渲染生成待显示图像,并将待显示图像显示在画布上。In operation S360, at least one image to be displayed is displayed. For example, at least one image to be displayed is displayed on a canvas of a browser, that is, the image to be displayed is generated by rendering frame by frame by detecting the playback progress of the current video, and the image to be displayed is displayed on the canvas.

根据本公开的实施例,在一些场景下浏览器不支持播放具有透明度数据的初始视频,因此无法将具有透明度数据的初始视频导入浏览器中。通过本公开实施例的技术方案,将初始视频中的透明度数据处理成灰度数据,从而得到当前视频,然后将具有灰度数据的当前视频导入浏览器中。According to the embodiments of the present disclosure, in some scenarios, the browser does not support playing the initial video with transparency data, so the initial video with transparency data cannot be imported into the browser. Through the technical solution of the embodiments of the present disclosure, the transparency data in the initial video is processed into grayscale data to obtain the current video, and then the current video with grayscale data is imported into the browser.

将当前视频导入浏览器之后,以隐藏的方式播放当前视频,并实时检测当前视频正在显示的当前图像帧,处理当前图像帧的灰度数据以渲染得到具有透明度数据的待显示图像,通过显示待显示图像间接实现了通过浏览器播放具有透明度数据的视频,解决了在一些场景下浏览器不支持播放具有透明度数据的视频的问题,实现了用户对视频播放的需求。After the current video is imported into the browser, the current video is played in a hidden manner, and the current image frame being displayed by the current video is detected in real time. The grayscale data of the current image frame is processed to render an image to be displayed with transparency data. By displaying the image to be displayed, the video with transparency data is indirectly played through the browser, which solves the problem that the browser does not support the playback of videos with transparency data in some scenarios and meets the user's demand for video playback.

根据本公开的实施例,还可以在浏览器的画布上显示控件,控件用于控制当前视频的播放状态。例如,播放状态包括开始播放、暂停播放、播放进度中的至少一项。通过控件可以控制当前视频的进行播放、暂停、播放进度等。显示控件可以包括播放键、暂停键、进度条等,以进度条为例,通过拖动进度条可以调整当前视频的播放进度。According to an embodiment of the present disclosure, a control may also be displayed on the canvas of the browser, and the control is used to control the playback state of the current video. For example, the playback state includes at least one of starting playback, pausing playback, and playback progress. The control may be used to control the playback, pausing, and playback progress of the current video. The display control may include a play button, a pause button, a progress bar, and the like. Taking the progress bar as an example, the playback progress of the current video may be adjusted by dragging the progress bar.

当前视频本来是具有原始控件来控制当前视频的播放状态的,但是,当前视频以隐藏方式进行播放时,原始控件也被隐藏。虽然当前视频以隐藏方式进行播放,本公开实施例还是可以通过在画布上渲染生成控件来控制当前视频的播放状态。当通过控件接收到输入操作时,基于输入操作控制当前视频的播放状态。基于当前视频的播放状态,改变至少一个待显示图像的显示模式。例如,至少一个待显示图像可以作为待显示视频,待显示视频即为透明视频,通过检测当前视频的播放状态,同步改变待显示视频的显示状态,使得待显示视频的显示状态与当前视频的状态一致。例如,当通过控件接收到的输入操作为暂停时,控制当前视频的播放状态为暂停状态,并将待显示视频的显示状态由播放状态改变为暂停状态。The current video originally has an original control to control the playback state of the current video, but when the current video is played in a hidden manner, the original control is also hidden. Although the current video is played in a hidden manner, the disclosed embodiment can still control the playback state of the current video by rendering a generated control on a canvas. When an input operation is received through the control, the playback state of the current video is controlled based on the input operation. Based on the playback state of the current video, the display mode of at least one image to be displayed is changed. For example, at least one image to be displayed can be used as a video to be displayed, and the video to be displayed is a transparent video. By detecting the playback state of the current video, the display state of the video to be displayed is synchronously changed so that the display state of the video to be displayed is consistent with the state of the current video. For example, when the input operation received through the control is pause, the playback state of the current video is controlled to be a pause state, and the display state of the video to be displayed is changed from a play state to a pause state.

根据本公开的实施例,通过在浏览器的画布上渲染生成控件,并通过控件控制当前视频的播放状态,进而将透明视频的状态同步为与当前视频的状态一致,实现间接通过浏览器播放透明视频的效果,解决了在一些场景下浏览器不支持具有透明度数据的视频播放的问题。并且通过控件可以实现根据用户需求来控制透明视频的状态,提高用户的体验。According to the embodiments of the present disclosure, by rendering and generating controls on the canvas of the browser, and controlling the playback state of the current video through the controls, the state of the transparent video is synchronized to be consistent with the state of the current video, and the effect of indirectly playing the transparent video through the browser is achieved, which solves the problem that the browser does not support the playback of videos with transparency data in some scenarios. In addition, the state of the transparent video can be controlled according to user needs through the controls, thereby improving the user experience.

图4示意性示出了根据本公开一实施例的视频处理方法的示意图。FIG. 4 schematically shows a schematic diagram of a video processing method according to an embodiment of the present disclosure.

如图4所示,当前视频410包括灰度通道411和色彩通道412,灰度通道411和色彩通道412合并形成当前视频410。As shown in FIG. 4 , the current video 410 includes a grayscale channel 411 and a color channel 412 , and the grayscale channel 411 and the color channel 412 are combined to form the current video 410 .

将当前视频410导入浏览器,例如将当前视频410作为浏览器中webGL接口的输入,webGL是一种JavaScript API,可在兼容的Web浏览器中渲染高性能的交互式3D和2D图像。然后,将灰度通道411转换为透明通道,例如逐帧解析灰度通道411对应的灰度像素数据,将灰度像素数据转换为透明像素数据。接下来,将透明通道和色彩通道412合并,得到透明视频420。The current video 410 is imported into the browser, for example, the current video 410 is used as the input of the webGL interface in the browser, which is a JavaScript API that can render high-performance interactive 3D and 2D images in a compatible web browser. Then, the grayscale channel 411 is converted into a transparent channel, for example, the grayscale pixel data corresponding to the grayscale channel 411 is parsed frame by frame, and the grayscale pixel data is converted into transparent pixel data. Next, the transparent channel and the color channel 412 are merged to obtain a transparent video 420.

在浏览器中以隐藏方式播放当前视频410时,同时在浏览器的画布上逐帧渲染,实现在画布上显示透明视频420的效果,其中,透明视频420包括多帧待显示图像。另外,可以将与当前视频410对应的音频数据作为针对透明视频420的音频数据。When the current video 410 is played in a hidden manner in the browser, it is rendered frame by frame on the browser canvas to achieve the effect of displaying the transparent video 420 on the canvas, wherein the transparent video 420 includes multiple frames of images to be displayed. In addition, the audio data corresponding to the current video 410 can be used as the audio data for the transparent video 420.

可以理解,通过将初始视频的透明度数据转换为灰度数据得到当前视频,以便将当前视频导入浏览器中,然后利用webGL解析并渲染生成透明视频,实现了在浏览器页面上播放透明视频的效果,满足视频播放的需求。It can be understood that the current video is obtained by converting the transparency data of the initial video into grayscale data so that the current video can be imported into the browser, and then webGL is used to parse and render to generate a transparent video, thereby achieving the effect of playing a transparent video on the browser page and meeting the needs of video playback.

图5示意性示出了根据本公开一实施例的视频处理装置的框图。FIG5 schematically shows a block diagram of a video processing device according to an embodiment of the present disclosure.

如图5所示,本公开实施例的视频处理装置500例如包括第一处理模块510、构建模块520以及第一显示模块530。As shown in FIG. 5 , the video processing device 500 according to the embodiment of the present disclosure includes, for example, a first processing module 510 , a construction module 520 , and a first display module 530 .

第一处理模块510可以用于针对具有灰度数据和色彩数据的当前视频,处理当前视频的灰度数据,得到透明度数据。根据本公开实施例,第一处理模块510例如可以执行上文参考图2描述的操作S210,在此不再赘述。The first processing module 510 can be used to process the grayscale data of the current video with grayscale data and color data to obtain transparency data. According to an embodiment of the present disclosure, the first processing module 510 can, for example, perform operation S210 described above with reference to FIG. 2, which will not be repeated here.

构建模块520可以用于基于透明度数据和色彩数据,构建与当前视频相关联的至少一个待显示图像。根据本公开实施例,构建模块520例如可以执行上文参考图2描述的操作S220,在此不再赘述。The construction module 520 may be used to construct at least one to-be-displayed image associated with the current video based on the transparency data and the color data. According to an embodiment of the present disclosure, the construction module 520 may, for example, perform the operation S220 described above with reference to FIG. 2 , which will not be described in detail herein.

第一显示模块530可以用于显示至少一个待显示图像。根据本公开实施例,第一显示模块530例如可以执行上文参考图2描述的操作S230,在此不再赘述。The first display module 530 may be used to display at least one image to be displayed. According to an embodiment of the present disclosure, the first display module 530 may, for example, perform the operation S230 described above with reference to FIG. 2 , which will not be described in detail herein.

根据本公开的实施例,装置500还可以包括:第一获取模块、第二处理模块和第二获取模块。第一获取模块,用于获取初始视频,其中,初始视频包括透明度数据和色彩数据;第二处理模块,用于处理透明度数据,得到灰度数据;第二获取模块,用于基于灰度数据和色彩数据,得到当前视频。According to an embodiment of the present disclosure, the device 500 may further include: a first acquisition module, a second processing module, and a second acquisition module. The first acquisition module is used to acquire an initial video, wherein the initial video includes transparency data and color data; the second processing module is used to process the transparency data to obtain grayscale data; and the second acquisition module is used to obtain a current video based on the grayscale data and the color data.

根据本公开的实施例,第二处理模块还用于:以第一权重对透明度数据进行加权处理,得到灰度数据。According to an embodiment of the present disclosure, the second processing module is further used to: perform weighted processing on the transparency data with a first weight to obtain grayscale data.

根据本公开的实施例,第一处理模块510包括:播放子模块、确定子模块和处理子模块。播放子模块,用于在浏览器页面上播放当前视频;确定子模块,用于从播放的当前视频中确定当前图像帧;处理子模块,用于处理当前图像帧的灰度数据,得到针对当前图像帧的透明度数据,其中,当前视频以隐藏格式进行播放。According to an embodiment of the present disclosure, the first processing module 510 includes: a playing submodule, a determining submodule and a processing submodule. The playing submodule is used to play the current video on the browser page; the determining submodule is used to determine the current image frame from the current video being played; the processing submodule is used to process the grayscale data of the current image frame to obtain the transparency data for the current image frame, wherein the current video is played in a hidden format.

根据本公开的实施例,处理子模块还用于:以第二权重对当前图像帧的灰度数据进行加权处理,得到针对当前图像帧的透明度数据,其中,第二权重与第一权重互为倒数。According to an embodiment of the present disclosure, the processing submodule is further used to: perform weighted processing on the grayscale data of the current image frame with a second weight to obtain transparency data for the current image frame, wherein the second weight and the first weight are reciprocals of each other.

根据本公开的实施例,构建模块520还用于:基于针对当前图像帧的透明度数据和针对当前图像帧的色彩数据,构建与当前图像帧对应的一个待显示图像。According to an embodiment of the present disclosure, the construction module 520 is further used to construct an image to be displayed corresponding to the current image frame based on transparency data for the current image frame and color data for the current image frame.

根据本公开的实施例,第一显示模块530还用于:在浏览器的画布上显示至少一个待显示图像。According to an embodiment of the present disclosure, the first display module 530 is further configured to: display at least one image to be displayed on a canvas of the browser.

根据本公开的实施例,装置500还可以包括:第二显示模块,用于在浏览器的画布上显示控件,其中,控件用于控制当前视频的播放状态,其中,播放状态包括开始播放、暂停播放、播放进度中的至少一项。According to an embodiment of the present disclosure, the device 500 may further include: a second display module, used to display controls on the canvas of the browser, wherein the controls are used to control the playback status of the current video, wherein the playback status includes at least one of starting playback, pausing playback, and playback progress.

根据本公开的实施例,装置500还可以包括:控制模块和改变模块。控制模块,用于响应于通过控件接收到输入操作,基于输入操作控制当前视频的播放状态;改变模块,用于基于当前视频的播放状态,改变至少一个待显示图像的显示模式。According to an embodiment of the present disclosure, the device 500 may further include: a control module and a change module. The control module is used to control the playback state of the current video based on the input operation in response to receiving the input operation through the control; the change module is used to change the display mode of at least one image to be displayed based on the playback state of the current video.

本公开的技术方案中,所涉及的用户个人信息的收集、存储、使用、加工、传输、提供和公开等处理,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

图6是用来实现本公开实施例的用于执行视频处理的电子设备的框图。FIG. 6 is a block diagram of an electronic device for performing video processing to implement an embodiment of the present disclosure.

图6示出了可以用来实施本公开实施例的示例电子设备600的示意性框图。电子设备600旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG6 shows a schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure. The electronic device 600 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and/or required herein.

如图6所示,设备600包括计算单元601,其可以根据存储在只读存储器(ROM)602中的计算机程序或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序,来执行各种适当的动作和处理。在RAM 603中,还可存储设备600操作所需的各种程序和数据。计算单元601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in Figure 6, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604.

设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

计算单元601可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元601的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元601执行上文所描述的各个方法和处理,例如视频处理方法。例如,在一些实施例中,视频处理方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM 602和/或通信单元609而被载入和/或安装到设备600上。当计算机程序加载到RAM 603并由计算单元601执行时,可以执行上文描述的视频处理方法的一个或多个步骤。备选地,在其他实施例中,计算单元601可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行视频处理方法。The computing unit 601 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as video processing methods. For example, in some embodiments, the video processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed on the device 600 via ROM 602 and/or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the video processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the video processing method in any other appropriate manner (e.g., by means of firmware).

本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至y一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various implementations may include: being implemented in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程视频处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable video processing device, so that the program code, when executed by the processor or controller, causes the functions/operations specified in the flow chart and/or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims (16)

1.一种视频处理方法,包括:1. A video processing method, comprising: 以隐藏格式播放当前视频,其中,所述当前视频包括针对背景的灰度数据和针对对象的色彩数据;Playing a current video in a hidden format, wherein the current video includes grayscale data for a background and color data for an object; 在以隐藏格式播放当前视频的过程中,检测当前视频正在播放的当前图像帧,并将检测到的当前图像帧的灰度数据转换为透明度数据;In the process of playing the current video in the hidden format, detecting the current image frame of the current video being played, and converting the grayscale data of the detected current image frame into transparency data; 基于所述透明度数据和所述色彩数据,构建与所述当前视频相关联的至少一个待显示图像,作为透明视频;以及constructing at least one to-be-displayed image associated with the current video as a transparent video based on the transparency data and the color data; and 以显示格式播放所述透明视频;Playing the transparent video in a display format; 其中,所述当前视频的播放状态和所述透明视频的播放状态是同步的,在所述当前视频和所述透明视频同步播放的过程中,所述当前视频中的控件被隐藏,其中,所述控件用于控制所述当前视频的播放状态,所述播放状态包括开始播放、暂停播放、播放进度中的至少一项;The play state of the current video and the play state of the transparent video are synchronized. During the synchronous play of the current video and the transparent video, the controls in the current video are hidden. The controls are used to control the play state of the current video. The play state includes at least one of start play, pause play, and play progress. 所述方法还包括:The method further comprises: 在浏览器的画布上显示所述控件,响应于通过控件接收到输入操作,基于输入操作控制所述当前视频的播放状态;Displaying the control on a canvas of the browser, and in response to receiving an input operation through the control, controlling the playback state of the current video based on the input operation; 检测所述当前视频的播放状态,将所述透明视频的播放状态同步为与所述当前视频的播放状态一致。The playback state of the current video is detected, and the playback state of the transparent video is synchronized to be consistent with the playback state of the current video. 2.根据权利要求1所述的方法,还包括:2. The method according to claim 1, further comprising: 获取初始视频,其中,所述初始视频包括透明度数据和色彩数据;Acquire an initial video, wherein the initial video includes transparency data and color data; 处理所述透明度数据,得到灰度数据;以及Processing the transparency data to obtain grayscale data; and 基于所述灰度数据和所述色彩数据,得到所述当前视频。The current video is obtained based on the grayscale data and the color data. 3.根据权利要求2所述的方法,其中,所述处理所述透明度数据,得到灰度数据包括:3. The method according to claim 2, wherein the processing of the transparency data to obtain grayscale data comprises: 以第一权重对所述透明度数据进行加权处理,得到所述灰度数据。The transparency data is weighted by a first weight to obtain the grayscale data. 4.根据权利要求3所述的方法,其中,所述检测当前视频正在播放的当前图像帧,并将检测到的当前图像帧的灰度数据转换为透明度数据包括:4. The method according to claim 3, wherein the step of detecting a current image frame of the current video being played and converting the grayscale data of the detected current image frame into transparency data comprises: 在浏览器页面上播放所述当前视频;Play the current video on the browser page; 从播放的当前视频中确定当前图像帧;以及Determining a current image frame from the current video being played; and 处理所述当前图像帧的灰度数据,得到针对当前图像帧的透明度数据。The grayscale data of the current image frame is processed to obtain transparency data for the current image frame. 5.根据权利要求4所述的方法,其中,所述处理所述当前图像帧的灰度数据,得到针对当前图像帧的透明度数据包括:5. The method according to claim 4, wherein the processing of the grayscale data of the current image frame to obtain transparency data for the current image frame comprises: 以第二权重对所述当前图像帧的灰度数据进行加权处理,得到针对当前图像帧的透明度数据,The grayscale data of the current image frame is weighted by a second weight to obtain transparency data for the current image frame. 其中,所述第二权重与所述第一权重互为倒数。The second weight and the first weight are reciprocals of each other. 6.根据权利要求4或5所述的方法,其中,所述基于所述透明度数据和所述色彩数据,构建与所述当前视频相关联的至少一个待显示图像包括:6. The method according to claim 4 or 5, wherein constructing at least one to-be-displayed image associated with the current video based on the transparency data and the color data comprises: 基于针对当前图像帧的透明度数据和针对当前图像帧的色彩数据,构建与所述当前图像帧对应的一个待显示图像。Based on the transparency data for the current image frame and the color data for the current image frame, an image to be displayed corresponding to the current image frame is constructed. 7.根据权利要求6所述的方法,其中,所述以显示格式播放所述透明视频包括:7. The method according to claim 6, wherein playing the transparent video in a display format comprises: 在浏览器的画布上显示所述至少一个待显示图像。The at least one image to be displayed is displayed on a canvas of the browser. 8.一种视频处理装置,包括:8. A video processing device, comprising: 第一处理模块,用于以隐藏格式播放当前视频,其中,所述当前视频包括针对背景的灰度数据和针对对象的色彩数据;在以隐藏格式播放当前视频的过程中,检测当前视频正在播放的当前图像帧,并将检测到的当前图像帧的灰度数据转换为透明度数据;A first processing module is used to play the current video in a hidden format, wherein the current video includes grayscale data for the background and color data for the object; in the process of playing the current video in the hidden format, detect a current image frame of the current video being played, and convert the grayscale data of the detected current image frame into transparency data; 构建模块,用于基于所述透明度数据和所述色彩数据,构建与所述当前视频相关联的至少一个待显示图像,作为透明视频;以及a construction module, configured to construct at least one to-be-displayed image associated with the current video as a transparent video based on the transparency data and the color data; and 第一显示模块,用于以显示格式播放所述透明视频;A first display module, used for playing the transparent video in a display format; 其中,所述当前视频的播放状态和所述透明视频的播放状态是同步的,在所述当前视频和所述透明视频同步播放的过程中,所述当前视频中的控件被隐藏,其中,所述控件用于控制所述当前视频的播放状态,所述播放状态包括开始播放、暂停播放、播放进度中的至少一项;The play state of the current video and the play state of the transparent video are synchronized. During the synchronous play of the current video and the transparent video, the controls in the current video are hidden. The controls are used to control the play state of the current video. The play state includes at least one of start play, pause play, and play progress. 所述装置还包括:The device also includes: 控制模块,用于在浏览器的画布上显示所述控件,响应于通过控件接收到输入操作,基于输入操作控制所述当前视频的播放状态;A control module, configured to display the control on a canvas of the browser, and in response to receiving an input operation through the control, control the playback state of the current video based on the input operation; 同步模块,用于检测所述当前视频的播放状态,将所述透明视频的播放状态同步为与所述当前视频的播放状态一致。The synchronization module is used to detect the playback status of the current video and synchronize the playback status of the transparent video to be consistent with the playback status of the current video. 9.根据权利要求8所述的装置,还包括:9. The apparatus according to claim 8, further comprising: 第一获取模块,用于获取初始视频,其中,所述初始视频包括透明度数据和色彩数据;A first acquisition module, used to acquire an initial video, wherein the initial video includes transparency data and color data; 第二处理模块,用于处理所述透明度数据,得到灰度数据;以及A second processing module, used for processing the transparency data to obtain grayscale data; and 第二获取模块,用于基于所述灰度数据和所述色彩数据,得到所述当前视频。The second acquisition module is used to obtain the current video based on the grayscale data and the color data. 10.根据权利要求9所述的装置,其中,所述第二处理模块还用于:10. The device according to claim 9, wherein the second processing module is further configured to: 以第一权重对所述透明度数据进行加权处理,得到所述灰度数据。The transparency data is weighted by a first weight to obtain the grayscale data. 11.根据权利要求10所述的装置,其中,所述第一处理模块包括:11. The apparatus according to claim 10, wherein the first processing module comprises: 播放子模块,用于在浏览器页面上播放所述当前视频;A playback submodule, used to play the current video on a browser page; 确定子模块,用于从播放的当前视频中确定当前图像帧;以及A determination submodule, used to determine a current image frame from the current video being played; and 处理子模块,用于处理所述当前图像帧的灰度数据,得到针对当前图像帧的透明度数据。The processing submodule is used to process the grayscale data of the current image frame to obtain transparency data for the current image frame. 12.根据权利要求11所述的装置,其中,所述处理子模块还用于:12. The device according to claim 11, wherein the processing submodule is further configured to: 以第二权重对所述当前图像帧的灰度数据进行加权处理,得到针对当前图像帧的透明度数据,The grayscale data of the current image frame is weighted by a second weight to obtain transparency data for the current image frame. 其中,所述第二权重与所述第一权重互为倒数。The second weight and the first weight are reciprocals of each other. 13.根据权利要求11或12所述的装置,其中,所述构建模块还用于:13. The device according to claim 11 or 12, wherein the building block is further used for: 基于针对当前图像帧的透明度数据和针对当前图像帧的色彩数据,构建与所述当前图像帧对应的一个待显示图像。Based on the transparency data for the current image frame and the color data for the current image frame, an image to be displayed corresponding to the current image frame is constructed. 14.根据权利要求13所述的装置,其中,所述第一显示模块还用于:14. The device according to claim 13, wherein the first display module is further used for: 在浏览器的画布上显示所述至少一个待显示图像。The at least one image to be displayed is displayed on a canvas of the browser. 15. 一种电子设备,包括:15. An electronic device, comprising: 至少一个处理器;以及at least one processor; and 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7. 16.一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1-7中任一项所述的方法。16. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method of any one of claims 1 to 7.
CN202110978074.2A 2021-08-24 2021-08-24 Video processing method, device, electronic device and medium Active CN113691866B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110978074.2A CN113691866B (en) 2021-08-24 2021-08-24 Video processing method, device, electronic device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110978074.2A CN113691866B (en) 2021-08-24 2021-08-24 Video processing method, device, electronic device and medium

Publications (2)

Publication Number Publication Date
CN113691866A CN113691866A (en) 2021-11-23
CN113691866B true CN113691866B (en) 2024-05-31

Family

ID=78582086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110978074.2A Active CN113691866B (en) 2021-08-24 2021-08-24 Video processing method, device, electronic device and medium

Country Status (1)

Country Link
CN (1) CN113691866B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6981227B1 (en) * 2002-02-04 2005-12-27 Mircrosoft Corporation Systems and methods for a dimmable user interface
CN102221953A (en) * 2010-04-14 2011-10-19 上海中标软件有限公司 Realization method for transparent user interface video player and player thereof
CN105446585A (en) * 2014-08-29 2016-03-30 优视科技有限公司 Video display method and device of Android intelligent terminal browser
CN108235055A (en) * 2017-12-15 2018-06-29 苏宁云商集团股份有限公司 Transparent video implementation method and equipment in AR scenes
CN109462731A (en) * 2018-11-27 2019-03-12 北京潘达互娱科技有限公司 Playback method, device, terminal and the server of effect video are moved in a kind of live streaming
CN109729417A (en) * 2019-03-28 2019-05-07 深圳市酷开网络科技有限公司 A kind of video-see play handling method, smart television and storage medium
CN109874048A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 The translucent display methods of video window component, device and computer equipment
CN111669646A (en) * 2019-03-07 2020-09-15 北京陌陌信息技术有限公司 Playing method, device, device and medium of transparent video
CN112399245A (en) * 2019-08-18 2021-02-23 海信视像科技股份有限公司 Playing method and display device
CN112884665A (en) * 2021-01-25 2021-06-01 腾讯科技(深圳)有限公司 Animation playing method and device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080111822A1 (en) * 2006-09-22 2008-05-15 Yahoo, Inc.! Method and system for presenting video
US10499118B2 (en) * 2012-04-24 2019-12-03 Skreens Entertainment Technologies, Inc. Virtual and augmented reality system and headset display

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6981227B1 (en) * 2002-02-04 2005-12-27 Mircrosoft Corporation Systems and methods for a dimmable user interface
CN102221953A (en) * 2010-04-14 2011-10-19 上海中标软件有限公司 Realization method for transparent user interface video player and player thereof
CN105446585A (en) * 2014-08-29 2016-03-30 优视科技有限公司 Video display method and device of Android intelligent terminal browser
CN108235055A (en) * 2017-12-15 2018-06-29 苏宁云商集团股份有限公司 Transparent video implementation method and equipment in AR scenes
CN109462731A (en) * 2018-11-27 2019-03-12 北京潘达互娱科技有限公司 Playback method, device, terminal and the server of effect video are moved in a kind of live streaming
CN109874048A (en) * 2019-01-11 2019-06-11 平安科技(深圳)有限公司 The translucent display methods of video window component, device and computer equipment
CN111669646A (en) * 2019-03-07 2020-09-15 北京陌陌信息技术有限公司 Playing method, device, device and medium of transparent video
CN109729417A (en) * 2019-03-28 2019-05-07 深圳市酷开网络科技有限公司 A kind of video-see play handling method, smart television and storage medium
CN112399245A (en) * 2019-08-18 2021-02-23 海信视像科技股份有限公司 Playing method and display device
CN112884665A (en) * 2021-01-25 2021-06-01 腾讯科技(深圳)有限公司 Animation playing method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Adam L. Anderson ; Bingxiong Lin ; Yu Sun.Virtually Transparent Epidermal Imagery (VTEI): On New Approaches to In Vivo Wireless High-Definition Video and Image Processing.IEEE Transactions on Biomedical Circuits and Systems.2013,全文. *
富视频类Web应用系统的一种可扩展框架;于述春;赵嫦花;何佳;;怀化学院学报;20171128(11);全文 *

Also Published As

Publication number Publication date
CN113691866A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
KR102552532B1 (en) Method and device for image rendering
CN113628311B (en) Image rendering method, image rendering device, electronic device and storage medium
CN115022679B (en) Video processing method, device, electronic device and medium
CN113453073B (en) Image rendering method, device, electronic equipment and storage medium
WO2023045317A1 (en) Expression driving method and apparatus, electronic device and storage medium
CN114218889A (en) Document processing and document model training method, apparatus, device and storage medium
CN109545333A (en) The method and device that Dicom image shows, handles
CN117710527B (en) Image processing method, device and product based on artificial intelligence large model
CN114443197A (en) Interface processing method, device, electronic device and storage medium
US20230145443A1 (en) Video stitching method and apparatus, electronic device, and storage medium
CN113691866B (en) Video processing method, device, electronic device and medium
CN111882483B (en) Video rendering method and device
CN113608809A (en) Component layout method, device, equipment, storage medium and program product
CN112667880A (en) Search result display method, device, equipment, storage medium and program product
CN119692303A (en) Page chart adjustment method, device, electronic device and storage medium
CN116363260B (en) Image generation method, device and electronic equipment
CN113656134B (en) Color matching method, device, device and storage medium for interface elements
CN117785165A (en) Chart generation method and device based on large model and electronic equipment
CN113836455B (en) Special effects rendering method, device, equipment, storage medium and computer program product
CN113744414B (en) Image processing method, device, equipment and storage medium
CN111324244A (en) Method and device for switching picture display types
CN116152412A (en) Model rendering method, device and device
CN114648601A (en) Virtual image generation method, electronic device, program product and user terminal
CN113515647A (en) Method, device and electronic device for displaying multimedia works
CN112860874A (en) Question-answer interaction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant