CN116095414A - Method and device for obtaining video screenshots - Google Patents

Method and device for obtaining video screenshots Download PDF

Info

Publication number
CN116095414A
CN116095414A CN202211249420.4A CN202211249420A CN116095414A CN 116095414 A CN116095414 A CN 116095414A CN 202211249420 A CN202211249420 A CN 202211249420A CN 116095414 A CN116095414 A CN 116095414A
Authority
CN
China
Prior art keywords
screenshot
video sequence
load
video
sample
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.)
Granted
Application number
CN202211249420.4A
Other languages
Chinese (zh)
Other versions
CN116095414B (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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202211249420.4A priority Critical patent/CN116095414B/en
Priority to PCT/CN2023/089184 priority patent/WO2024077916A1/en
Publication of CN116095414A publication Critical patent/CN116095414A/en
Application granted granted Critical
Publication of CN116095414B publication Critical patent/CN116095414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47205End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for manipulating displayed content, e.g. interacting with MPEG-4 objects, editing locally
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

本公开的实施例提供了一种获取视频截图的方法和装置。所述获取视频截图的方法包括:首先响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息,然后基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,并基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,最后执行目标视频序列的截图任务,得到目标视频序列对应的视频截图,在执行截图任务之前可以预先确定每个视频序列的截图任务对应的预计截图负载,可以预先准确地分配截图任务的数量,提高了负载均衡和资源利用率。

Figure 202211249420

Embodiments of the present disclosure provide a method and device for acquiring video screenshots. The method for obtaining video screenshots includes: first, in response to obtaining a video sequence set for performing a screenshot task, acquiring video information of multiple candidate video sequences in the video sequence set, and then based on the video information of the multiple candidate video sequences, calculating The estimated screenshot load corresponding to multiple candidate video sequences, and based on the local available resources and the estimated screenshot load corresponding to multiple candidate video sequences, select the target video sequence from the video sequence set, and finally execute the screenshot task of the target video sequence to obtain the target video For the video screenshot corresponding to the sequence, the expected screenshot load corresponding to the screenshot task of each video sequence can be determined in advance before executing the screenshot task, and the number of screenshot tasks can be accurately allocated in advance, which improves load balancing and resource utilization.

Figure 202211249420

Description

获取视频截图的方法和装置Method and device for obtaining video screenshots

技术领域technical field

本公开的实施例涉及计算机技术领域和互联网技术领域,具体涉及视频处理技术领域和图像处理技术领域,尤其获取视频截图的方法和装置。The embodiments of the present disclosure relate to the field of computer technology and the field of Internet technology, specifically to the field of video processing technology and the field of image processing technology, especially the method and device for obtaining video screenshots.

背景技术Background technique

随着视频点播不断发展,越来越多的用户存在对点播截图的需求。现有点播截图等CPU密集型任务的处理流程为:为每个截图任务配置好默认的线程数,按机器的整体核数配置确定该节点上任务的并发数量。With the continuous development of video-on-demand, more and more users have a demand for video-on-demand screenshots. The processing flow of CPU-intensive tasks such as video-on-demand screenshots is as follows: configure the default number of threads for each screenshot task, and determine the number of concurrent tasks on the node according to the overall core configuration of the machine.

截图任务整个处理过程可以分为:媒体资源下载、媒体资源中的视频部分解码、图片编码、上传图片成品等步骤。在这几个步骤中,媒体资源下载消耗的是系统的下行带宽,视频解码以及图片编码主要消耗系统的cpu负载,上传图片主要消耗系统的上行带宽。下载和上传的并发数量受限于服务器所位于整个网络的带宽限制,这个一般不会首先成为瓶颈,比视频解码和图片编码的并行限制条件要宽松。不同的媒体资源的解码消耗是有差异的,所有的截图任务都使用相同的线程数进行处理,会影响任务的处理速度、尤其是视频复杂度较高的任务截图倍速比较低,并且还会造成整个系统资源的浪费。The entire processing process of the screenshot task can be divided into steps such as downloading of media resources, decoding of video parts in media resources, encoding of pictures, and uploading of finished pictures. In these steps, downloading media resources consumes the system's downlink bandwidth, video decoding and picture encoding mainly consume the system's cpu load, and uploading pictures mainly consumes the system's uplink bandwidth. The number of concurrent downloads and uploads is limited by the bandwidth of the entire network where the server is located. This generally does not become a bottleneck first, and is looser than the parallel restrictions on video decoding and image encoding. The decoding consumption of different media resources is different. All screenshot tasks are processed with the same number of threads, which will affect the processing speed of the task, especially for tasks with high video complexity. A waste of system resources.

发明内容Contents of the invention

本公开的实施例提出了一种获取视频截图的方法、装置、电子设备和计算机可读介质。Embodiments of the present disclosure provide a method, device, electronic device, and computer-readable medium for acquiring video screenshots.

第一方面,本公开的实施例提供了一种获取视频截图的方法,该方法包括:响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息;基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载;基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列;执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。In a first aspect, an embodiment of the present disclosure provides a method for acquiring video screenshots, the method including: in response to acquiring a video sequence set for performing a screenshot task, acquiring video information of multiple candidate video sequences in the video sequence set ; Based on the video information of multiple candidate video sequences, calculate the expected screenshot load corresponding to the multiple candidate video sequences; based on the local available resources and the expected screenshot load corresponding to the multiple candidate video sequences, select the target video sequence from the video sequence set; Execute The screenshot task of the target video sequence obtains the video screenshot corresponding to the target video sequence.

在一些实施例中,基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,包括:获取用于计算截图负载的负载计算公式;基于负载计算公式和多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。In some embodiments, based on the video information of the multiple candidate video sequences, calculating the expected screenshot load corresponding to the multiple candidate video sequences includes: obtaining a load calculation formula for calculating the screenshot load; based on the load calculation formula and multiple candidate videos The video information of the sequence is used to calculate the expected screenshot load corresponding to multiple candidate video sequences.

在一些实施例中,获取用于计算截图负载的负载计算公式,包括:获取样本视频序列集合,其中,样本视频序列集合包括多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载;利用回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,获取与样本视频信息和样本截图负载关联的负载计算公式。In some embodiments, obtaining a load calculation formula for calculating screenshot load includes: obtaining a set of sample video sequences, wherein the set of sample video sequences includes multiple sample video sequences, sample video information of multiple sample video sequences, and multiple The sample screenshot load corresponding to the sample video sequence; use the regression statistical method to analyze the data of multiple sample video sequences, sample video information of multiple sample video sequences, and sample screenshot loads corresponding to multiple sample video sequences, and obtain information related to the sample video and The load calculation formula of the sample screenshot load association.

在一些实施例中,该方法还包括:响应于执行目标视频序列的截图任务,获取目标视频序列对应的实时截图负载;基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式。In some embodiments, the method further includes: in response to executing the screenshot task of the target video sequence, acquiring a real-time screenshot load corresponding to the target video sequence; based on the real-time screenshot load corresponding to the target video sequence and the estimated screenshot load corresponding to the target video sequence, The load calculation formula is updated to obtain a new load calculation formula.

在一些实施例中,基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式,包括:将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,判断目标视频序列对应的实时截图负载是否符合负载条件;响应于确定目标视频序列对应的实时截图负载符合负载条件,将目标视频序列对应的实时截图负载和目标视频序列的视频信息存储至样本视频序列集合,得到新的样本视频序列集合;基于新的样本视频序列集合,对负载计算公式进行更新,得到新的负载计算公式。In some embodiments, based on the real-time screenshot load corresponding to the target video sequence and the estimated screenshot load corresponding to the target video sequence, the load calculation formula is updated to obtain a new load calculation formula, including: the real-time screenshot load corresponding to the target video sequence Compared with the expected screenshot load corresponding to the target video sequence, it is judged whether the real-time screenshot load corresponding to the target video sequence meets the load condition; in response to determining that the real-time screenshot load corresponding to the target video sequence meets the load condition, the real-time screenshot load corresponding to the target video sequence is and the video information of the target video sequence are stored in the sample video sequence set to obtain a new sample video sequence set; based on the new sample video sequence set, the load calculation formula is updated to obtain a new load calculation formula.

在一些实施例中,该方法还包括:基于新的负载计算公式和目标视频序列的视频信息,计算目标视频序列对应的新的预计截图负载;根据本地可用资源和目标视频序列对应的新的预计截图负载,对目标视频序列执行预设调整操作。In some embodiments, the method further includes: calculating a new estimated screenshot load corresponding to the target video sequence based on the new load calculation formula and video information of the target video sequence; Screenshot payloads that perform preset adjustment operations on the target video sequence.

第二方面,本公开的实施例提供了一种获取视频截图的装置,该装置包括:获取模块,被配置成响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息;计算模块,被配置成基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载;选取模块,被配置成基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列;执行模块,被配置成执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。In a second aspect, an embodiment of the present disclosure provides an apparatus for acquiring video screenshots, the apparatus including: an acquisition module configured to acquire multiple The video information of the candidate video sequence; the calculation module is configured to calculate the expected screenshot load corresponding to the multiple candidate video sequences based on the video information of the multiple candidate video sequences; the selection module is configured to be based on local available resources and multiple candidate videos The expected screenshot load corresponding to the sequence selects the target video sequence from the video sequence set; the execution module is configured to execute the screenshot task of the target video sequence to obtain the video screenshot corresponding to the target video sequence.

在一些实施例中,计算模块,包括:获取单元,被配置成获取用于计算截图负载的负载计算公式;计算单元,被配置成基于负载计算公式和多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。In some embodiments, the calculation module includes: an acquisition unit configured to acquire a load calculation formula for calculating the screenshot load; a calculation unit configured to calculate multiple load calculation formulas based on the load calculation formula and video information of multiple candidate video sequences The estimated screenshot load corresponding to candidate video sequences.

在一些实施例中,计算单元,进一步被配置成:获取样本视频序列集合,其中,样本视频序列集合包括多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载;利用回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,获取与样本视频信息和样本截图负载关联的负载计算公式。In some embodiments, the calculation unit is further configured to: acquire a set of sample video sequences, wherein the set of sample video sequences includes multiple sample video sequences, sample video information of the multiple sample video sequences, and multiple sample video sequences corresponding to Sample screenshot load; use the regression statistical method to analyze the data of multiple sample video sequences, sample video information of multiple sample video sequences, and sample screenshot loads corresponding to multiple sample video sequences, and obtain the data associated with the sample video information and sample screenshot load. Load calculation formula.

在一些实施例中,该装置还包括更新模块;获取模块,进一步被配置成:响应于执行目标视频序列的截图任务,获取目标视频序列对应的实时截图负载;更新模块,被配置成:基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式。In some embodiments, the device further includes an update module; the acquisition module is further configured to: obtain the real-time screenshot load corresponding to the target video sequence in response to executing the screenshot task of the target video sequence; the update module is configured to: based on the target The real-time screenshot load corresponding to the video sequence and the estimated screenshot load corresponding to the target video sequence update the load calculation formula to obtain a new load calculation formula.

在一些实施例中,更新模块,进一步被配置成:将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,判断目标视频序列对应的实时截图负载是否符合负载条件;响应于确定目标视频序列对应的实时截图负载符合负载条件,将目标视频序列对应的实时截图负载和目标视频序列的视频信息存储至样本视频序列集合,得到新的样本视频序列集合;基于新的样本视频序列集合,对负载计算公式进行更新,得到新的负载计算公式。In some embodiments, the update module is further configured to: compare the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and determine whether the real-time screenshot load corresponding to the target video sequence meets the load condition; respond To determine that the real-time screenshot load corresponding to the target video sequence meets the load condition, the real-time screenshot load corresponding to the target video sequence and the video information of the target video sequence are stored in the sample video sequence set to obtain a new sample video sequence set; based on the new sample video Sequence collection, update the load calculation formula to get a new load calculation formula.

在一些实施例中,计算模块,进一步被配置成:基于新的负载计算公式和目标视频序列的视频信息,计算目标视频序列对应的新的预计截图负载;执行模块,进一步被配置成:根据本地可用资源和目标视频序列对应的新的预计截图负载,对目标视频序列执行预设调整操作。In some embodiments, the calculation module is further configured to: calculate the new expected screenshot load corresponding to the target video sequence based on the new load calculation formula and the video information of the target video sequence; the execution module is further configured to: according to the local A new estimated screenshot load corresponding to the available resources and the target video sequence, and a preset adjustment operation is performed on the target video sequence.

第三方面,本公开的实施例提供了一种电子设备,该电子设备包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实施例描述的获取视频截图的方法。In a third aspect, an embodiment of the present disclosure provides an electronic device, the electronic device includes: one or more processors; a storage device, on which one or more programs are stored; when one or more programs are used by one or more A plurality of processors are executed, so that one or more processors implement the method for acquiring video screenshots as described in any embodiment of the first aspect.

第四方面,本公开的实施例提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面中任一实施例描述的获取视频截图的方法。In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for obtaining video screenshots as described in any embodiment of the first aspect is implemented .

本公开的实施例提供的获取视频截图的方法,上述执行主体首先响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息,然后基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,并基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,最后执行目标视频序列的截图任务,得到目标视频序列对应的视频截图,在执行截图任务之前可以预先确定每个视频序列的截图任务对应的预计截图负载,可以预先准确地分配截图任务的数量,不需要通过设置任务的线程数,限制任务所能使用的机器资源,基于准确计算的预计截图负载为截图任务分配资源配额即可,能够基于预计截图负载分配更多的截图任务,充分利用服务器的本地可用资源,提高了负载均衡和资源利用率。In the method for obtaining video screenshots provided by the embodiments of the present disclosure, the execution subject first acquires the video information of multiple candidate video sequences in the video sequence collection in response to the acquisition of the video sequence set used to perform the screenshot task, and then based on the multiple candidate The video information of the video sequence calculates the estimated screenshot load corresponding to multiple candidate video sequences, and based on the local available resources and the estimated screenshot load corresponding to multiple candidate video sequences, selects the target video sequence from the video sequence set, and finally executes the target video sequence Screenshot task, to get the video screenshot corresponding to the target video sequence. Before executing the screenshot task, the expected screenshot load corresponding to the screenshot task of each video sequence can be determined in advance, and the number of screenshot tasks can be accurately allocated in advance. No need to set the task The number of threads limits the machine resources that can be used by the task. Just assign resource quotas to the screenshot task based on the accurately calculated expected screenshot load. More screenshot tasks can be allocated based on the estimated screenshot load, making full use of the local available resources of the server and improving the performance of the screenshot. Load balancing and resource utilization.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1是本公开的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;

图2是根据本公开的获取视频截图的方法的一个实施例的流程图;FIG. 2 is a flow chart of an embodiment of a method for obtaining a screenshot of a video according to the present disclosure;

图3是根据本公开的获取视频截图的方法的一个应用场景的示意图;FIG. 3 is a schematic diagram of an application scenario of a method for obtaining video screenshots according to the present disclosure;

图4是根据本公开的计算多个候选视频序列对应的预计截图负载的一个实施例的流程图;Fig. 4 is a flow chart of an embodiment of calculating the expected screenshot load corresponding to multiple candidate video sequences according to the present disclosure;

图5是根据本公开的获取负载计算公式的一个实施例的流程图;FIG. 5 is a flowchart of an embodiment of obtaining a load calculation formula according to the present disclosure;

图6是根据本公开的获取视频截图的方法的另一个实施例的流程图;FIG. 6 is a flow chart of another embodiment of a method for obtaining a screenshot of a video according to the present disclosure;

图7是根据本公开的对负载计算公式进行更新的一个实施例的流程图;FIG. 7 is a flowchart of an embodiment of updating a load calculation formula according to the present disclosure;

图8是根据本公开的获取视频截图的装置的一个实施例的结构示意图;FIG. 8 is a schematic structural diagram of an embodiment of a device for obtaining video screenshots according to the present disclosure;

图9是适于用来实现本公开的实施例的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure.

具体实施方式Detailed ways

下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关公开,而非对该公开的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关公开相关的部分。The present disclosure 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 relevant disclosure, not to limit the disclosure. It should also be noted that, for the convenience of description, only the parts related to the relevant disclosure are shown in the drawings.

需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that, in the case of no conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and embodiments.

图1示出了可以应用本公开的实施例的获取视频截图的方法和装置的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which the method and device for acquiring video screenshots according to the embodiments of the present disclosure can be applied.

如图1所示,系统架构100可以包括终端设备104、105、106,网络107,服务器101、102、103。网络107用以在终端设备104、105、106与服务器101、102、103之间提供通信链路的介质。网络107可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include terminal devices 104 , 105 , and 106 , a network 107 , and servers 101 , 102 , and 103 . The network 107 is used as a medium for providing communication links between the terminal devices 104 , 105 , 106 and the servers 101 , 102 , 103 . Network 107 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.

用户可以通过终端设备104、105、106通过网络107与属于同一服务器集群的服务器101、102、103交互,以接收或发送信息等。终端设备104、105、106上可以安装有各种应用,例如物品展示应用、数据分析应用、搜索类应用等。Users can interact with the servers 101 , 102 , 103 belonging to the same server cluster through the network 107 through the terminal devices 104 , 105 , 106 to receive or send information and the like. Various applications may be installed on the terminal devices 104, 105, 106, such as item display applications, data analysis applications, search applications, and the like.

终端设备104、105、106可以是硬件,也可以是软件。当终端设备为硬件时,可以是具有显示屏并且支持与服务器通信的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。当终端设备为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 104, 105, and 106 may be hardware or software. When the terminal device is hardware, it may be various electronic devices with display screens and supporting communication with servers, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, and the like. When the terminal device is software, it can be installed in the electronic devices listed above. It can be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made here.

服务器101、102、103可以是提供各种服务的服务器,例如对与其建立通信连接的终端设备发送的请求进行接收的后台服务器。后台服务器可以对终端设备发送的请求进行接收和分析等处理,并生成处理结果。The servers 101, 102, and 103 may be servers that provide various services, for example, background servers that receive requests sent by terminal devices that establish communication connections with them. The background server can receive and analyze the request sent by the terminal device, and generate processing results.

服务器101、102、103可以获取到用于执行截图任务的视频序列集合,并对视频序列集合中的多个候选视频序列进行分析处理,获取视频序列集合中多个候选视频序列的视频信息,然后基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,并基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,最后执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。The servers 101, 102, and 103 can acquire video sequence sets used to perform screenshot tasks, analyze and process multiple candidate video sequences in the video sequence set, obtain video information of multiple candidate video sequences in the video sequence set, and then Based on the video information of multiple candidate video sequences, calculate the expected screenshot load corresponding to the multiple candidate video sequences, and select the target video sequence from the video sequence set based on the local available resources and the estimated screenshot load corresponding to the multiple candidate video sequences, and finally Execute the screenshot task of the target video sequence, and obtain the video screenshot corresponding to the target video sequence.

需要说明的是,服务器可以是硬件,也可以是软件。当服务器为硬件时,可以是为终端设备提供各种服务的各种电子设备。当服务器为软件时,可以实现成为为终端设备提供各种服务的多个软件或软件模块,也可以实现成为为终端设备提供各种服务的单个软件或软件模块。在此不做具体限定。It should be noted that the server may be hardware or software. When the server is hardware, it may be various electronic devices that provide various services for terminal devices. When the server is software, it can be implemented as a plurality of software or software modules that provide various services for the terminal device, or as a single software or software module that provides various services for the terminal device. No specific limitation is made here.

需要说明的是,本公开的实施例所提供的获取视频截图的方法可以由服务器101、102、103执行。相应地,获取视频截图的装置设置于服务器101、102、103中。It should be noted that the method for acquiring video screenshots provided by the embodiments of the present disclosure may be executed by the servers 101 , 102 , and 103 . Correspondingly, the device for obtaining video screenshots is set in the servers 101 , 102 , and 103 .

应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in Fig. 1 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.

继续参考图2,示出了根据本公开的获取视频截图的方法的一个实施例的流程200。该获取视频截图的方法包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of the method for obtaining video screenshots according to the present disclosure is shown. The method for obtaining video screenshots includes the following steps:

步骤210,响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息。Step 210, in response to acquiring a video sequence set for executing a screenshot task, acquire video information of multiple candidate video sequences in the video sequence set.

在本步骤中,获取视频截图的方法运行于其上的执行主体(例如图1中的服务器101、102、103)可以通过接收终端发送或者网络读取由多个候选视频序列组成的视频序列集合,其中,每个候选视频序列用于执行截图任务获取对应的视频截图,每个候选视频序列均为有时空联系的多个视频图像按照一定顺序排列而成的序列。In this step, the execution subject on which the method for obtaining video screenshots runs (for example, the servers 101, 102, and 103 in FIG. 1 ) can send or read a video sequence set composed of multiple candidate video sequences through the receiving terminal. , wherein each candidate video sequence is used to perform a screenshot task to obtain a corresponding video screenshot, and each candidate video sequence is a sequence of multiple video images connected in time and space arranged in a certain order.

上述执行主体可以对视频序列集合中的每个候选视频序列进行视频解析处理,探测每个候选视频序列的媒体信息,获取到每个候选视频序列的视频信息,该视频信息表征候选视频序列的视频复杂度信息,可以包括候选视频序列的分辨率、码率、帧率和编码格式等信息,不同候选视频序列的视频信息可能不同。其中,分辨率是用于度量图像内数据量多少的一个参数,通常表示成ppi(每英寸像素Pixel per inch),例如,某个视频序列的分辨率为320*180,是指它在横向和纵向上的有效像素,窗口小时ppi值较高,看起来清晰,窗口放大时,由于没有那么多有效像素填充窗口,有效像素ppi值下降,就模糊了;码率是数据传输时单位时间传送的数据位数,单位是kbps即千位每秒,即取样率,单位时间内取样率越大,精度就越高,处理出来的文件就越接近原始文件;帧率是用于测量显示帧数的量度。所谓的测量单位为每秒显示帧数(Frames per Second,FPS)或“赫兹”(Hz),每秒的帧数(fps)或者说帧率表示图形处理器处理场时每秒钟能够更新的次数,高的帧率可以得到更流畅、更逼真的动画;编码格式是视频文件的存在形式,可以包括H264,VP8,AVS,RMVB,WMV,QuickTime(mov),H265,VP9,AV1等格式。The above execution subject can perform video analysis processing on each candidate video sequence in the video sequence set, detect the media information of each candidate video sequence, and obtain the video information of each candidate video sequence, and the video information represents the video of the candidate video sequence The complexity information may include information such as resolution, code rate, frame rate, and encoding format of the candidate video sequence, and the video information of different candidate video sequences may be different. Among them, the resolution is a parameter used to measure the amount of data in the image, usually expressed as ppi (Pixel per inch). For example, the resolution of a certain video sequence is 320*180, which means that it For the effective pixels in the vertical direction, the ppi value of the window is higher when the window is small, and it looks clear. When the window is enlarged, because there are not so many effective pixels to fill the window, the ppi value of the effective pixels decreases and becomes blurred; the code rate is transmitted per unit time during data transmission The number of data bits, the unit is kbps, that is, thousand bits per second, that is, the sampling rate. The larger the sampling rate per unit time, the higher the precision, and the closer the processed file is to the original file; the frame rate is used to measure the display frame number measure. The so-called unit of measurement is the number of frames per second (Frames per Second, FPS) or "Hertz" (Hz), the number of frames per second (fps) or the frame rate means that the graphics processor can update every second when processing the field. High frame rate can get smoother and more realistic animation; encoding format is the existence form of video files, which can include H264, VP8, AVS, RMVB, WMV, QuickTime (mov), H265, VP9, AV1 and other formats.

步骤220,基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。Step 220, based on the video information of the multiple candidate video sequences, calculate the expected screenshot load corresponding to the multiple candidate video sequences.

在本步骤中,由于不同的视频信息可以引起视频序列在截图任务中所使用负载的不同,视频信息越复杂的视频序列在截图任务中所使用负载越高,上述执行主体获取到多个候选视频序列的视频信息后,可以根据每个候选视频序列的视频信息和每个候选视频序列对应的截图任务,分别对每个候选视频序列进行负载计算,获取每个候选视频序列针对截图任务时对应的预计截图负载,该预计截图负载可以表征候选视频序列在执行截图任务过程中可能需要的负载值。In this step, since different video information can cause different loads used by the video sequence in the screenshot task, the video sequence with more complex video information has a higher load used in the screenshot task, and the above-mentioned execution subject obtains multiple candidate videos After the video information of each candidate video sequence, the load calculation can be performed on each candidate video sequence according to the video information of each candidate video sequence and the screenshot task corresponding to each candidate video sequence, and the corresponding An estimated screenshot load, which may represent a load value that may be required by the candidate video sequence during the execution of the screenshot task.

上述执行主体可以将每个候选视频序列对应的预计截图负载与候选视频序列进行关联标记,从而获取到多个候选视频序列对应的预计截图负载。The execution subject may associate and mark the expected screenshot load corresponding to each candidate video sequence with the candidate video sequence, so as to obtain the expected screenshot load corresponding to multiple candidate video sequences.

步骤230,基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列。Step 230: Select a target video sequence from the video sequence set based on the locally available resources and the expected screenshot loads corresponding to the plurality of candidate video sequences.

在本步骤中,上述执行主体获取到多个候选视频序列对应的预计截图负载后,可以获取本地可用资源,该本地可用资源可以表征本地供截图任务使用的资源值,例如可以使用的cpu的数值。In this step, after the execution subject obtains the expected screenshot loads corresponding to multiple candidate video sequences, it can obtain local available resources, which can represent the local resource values used for screenshot tasks, such as the value of available cpu .

上述执行主体可以根据本地可用资源和多个候选视频序列对应的预计截图负载,确定出本地可用资源可以为多少个候选视频序列提供使用资源,即可以从多个候选视频序列对应的预计截图负载中,计算出预计截图负载相加不大于本地可用资源对应的候选视频序列,将确定出的候选视频序列确定为目标视频序列,从而可以从视频序列集合中选取出预计截图负载相加不大于本地可用资源对应的目标视频序列,且使得预计截图负载相加之和尽可能等于本地可用资源,该目标视频序列可以包括一个或多个,对此不做具体限定。The above execution subject can determine how many candidate video sequences can be provided by locally available resources according to the expected screenshot load corresponding to the local available resources and multiple candidate video sequences, that is, from the estimated screenshot load corresponding to the multiple candidate video sequences , calculate the expected screenshot load sum is not greater than the candidate video sequence corresponding to the local available resources, determine the determined candidate video sequence as the target video sequence, so that the estimated screenshot load sum can be selected from the video sequence set is not greater than the locally available resources The resource corresponds to the target video sequence, and the sum of the expected screenshot loads is equal to the local available resources as much as possible. The target video sequence may include one or more, which is not specifically limited.

作为示例,上述本地可用资源的数值为100,多个候选视频序列包括候选视频序列A,候选视频序列B,候选视频序列C,候选视频序列D和候选视频序列E,候选视频序列A对应的预计截图负载30,候选视频序列B对应的预计截图负载50,候选视频序列C对应的预计截图负载60,候选视频序列D对应的预计截图负载70,候选视频序列E对应的预计截图负载60,上述执行主体可以将本地可用资源与每个预计截图负载进行比较,计算每个预计截图负载之间的负载之和,确定出候选视频序列A对应的预计截图负载30和候选视频序列D对应的预计截图负载70之和等于本地可用资源的数值,可以将候选视频序列A和候选视频序列D作为目标视频序列。As an example, the value of the above-mentioned locally available resources is 100, and the multiple candidate video sequences include candidate video sequence A, candidate video sequence B, candidate video sequence C, candidate video sequence D, and candidate video sequence E, and candidate video sequence A corresponds to the expected The screenshot load is 30, the estimated screenshot load corresponding to candidate video sequence B is 50, the estimated screenshot load corresponding to candidate video sequence C is 60, the estimated screenshot load corresponding to candidate video sequence D is 70, and the estimated screenshot load corresponding to candidate video sequence E is 60. The above execution The subject can compare the local available resources with each expected screenshot load, calculate the sum of the loads between each expected screenshot load, and determine the estimated screenshot load 30 corresponding to candidate video sequence A and the estimated screenshot load corresponding to candidate video sequence D The sum of 70 is equal to the value of local available resources, and candidate video sequence A and candidate video sequence D can be used as target video sequences.

步骤240,执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。Step 240, execute the screenshot task of the target video sequence, and obtain the video screenshot corresponding to the target video sequence.

在本步骤中,上述执行主体选取出目标视频序列后,可以开始执行目标视频序列的截图任务,对目标视频序列开始执行媒体资源下载、媒体资源中的视频部分解码、图片编码、上传图片成品等步骤,获取到目标视频序列对应的视频截图。In this step, after the above-mentioned executive body selects the target video sequence, it can start to execute the screenshot task of the target video sequence, and start to execute the download of media resources, decoding of video parts in media resources, picture encoding, and uploading finished pictures of the target video sequence, etc. step, obtaining a video screenshot corresponding to the target video sequence.

若目标视频序列包括多个视频序列,上述执行主体可以分别对每个视频序列执行媒体资源下载、媒体资源中的视频部分解码、图片编码、上传图片成品等步骤,获取到每个视频序列对应的视频截图。If the target video sequence includes multiple video sequences, the above execution subject can perform steps such as downloading media resources, decoding video parts in media resources, encoding pictures, uploading finished pictures, etc. for each video sequence, and obtains the corresponding Video screenshot.

继续参见图3,图3是根据本实施例的获取视频截图的方法的应用场景的一个示意图。该方法可以应用于图3的应用场景中,终端可以301可以向服务器302发送用于执行截图任务的视频序列集合。服务器302接收到视频序列集合后,可以对多个候选视频序列进行视频分析,获取视频序列集合中多个候选视频序列的视频信息,然后服务器302基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。之后服务器302可以基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,并开始执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。服务器302将视频截图发送给终端301,终端301可以将视频截图通过屏幕展示给用户。Continue to refer to FIG. 3 , which is a schematic diagram of an application scenario of the method for obtaining video screenshots according to this embodiment. This method can be applied to the application scenario in FIG. 3 , and the terminal 301 can send to the server 302 a video sequence set for executing a screenshot task. After the server 302 receives the video sequence set, it can perform video analysis on multiple candidate video sequences to obtain the video information of multiple candidate video sequences in the video sequence set, and then the server 302 calculates multiple candidate video sequences based on the video information of the multiple candidate video sequences. Estimated screenshot payloads for candidate video sequences. Afterwards, the server 302 can select the target video sequence from the video sequence set based on the local available resources and the expected screenshot load corresponding to multiple candidate video sequences, and start to execute the screenshot task of the target video sequence, and obtain the video screenshot corresponding to the target video sequence. The server 302 sends the video screenshot to the terminal 301, and the terminal 301 can display the video screenshot to the user through a screen.

本公开的实施例提供的获取视频截图的方法,上述执行主体首先响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息,然后基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,并基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,最后执行目标视频序列的截图任务,得到目标视频序列对应的视频截图,在执行截图任务之前可以预先确定每个视频序列的截图任务对应的预计截图负载,可以预先准确地分配截图任务的数量,不需要通过设置任务的线程数,限制任务所能使用的机器资源,基于准确计算的预计截图负载为截图任务分配资源配额即可,能够基于预计截图负载分配更多的截图任务,充分利用服务器的本地可用资源,提高了负载均衡和资源利用率。In the method for obtaining video screenshots provided by the embodiments of the present disclosure, the execution subject first acquires the video information of multiple candidate video sequences in the video sequence collection in response to the acquisition of the video sequence set used to perform the screenshot task, and then based on the multiple candidate The video information of the video sequence calculates the estimated screenshot load corresponding to multiple candidate video sequences, and based on the local available resources and the estimated screenshot load corresponding to multiple candidate video sequences, selects the target video sequence from the video sequence set, and finally executes the target video sequence Screenshot task, to get the video screenshot corresponding to the target video sequence. Before executing the screenshot task, the expected screenshot load corresponding to the screenshot task of each video sequence can be determined in advance, and the number of screenshot tasks can be accurately allocated in advance. No need to set the task The number of threads limits the machine resources that can be used by the task. Just assign resource quotas to the screenshot task based on the accurately calculated expected screenshot load. More screenshot tasks can be allocated based on the estimated screenshot load, making full use of the local available resources of the server and improving the performance of the screenshot. Load balancing and resource utilization.

参考图4,图4示出了计算多个候选视频序列对应的预计截图负载的一个实施例的流程图400,即上述步骤220,基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,可以包括以下步骤:Referring to FIG. 4, FIG. 4 shows a flow chart 400 of an embodiment of calculating the expected screenshot load corresponding to multiple candidate video sequences, that is, the above-mentioned step 220, based on the video information of multiple candidate video sequences, calculating multiple candidate video sequences The corresponding expected screenshot load may include the following steps:

步骤410,获取用于计算截图负载的负载计算公式。Step 410, obtaining a load calculation formula used to calculate the screenshot load.

在本步骤中,上述执行主体在获取到多个候选视频序列的视频信息后,可以在本地读取用于计算截图负载的负载计算公式,该负载计算公式与视频序列的视频信息成正相关的计算关系。负载计算公式可以表示为(x)*视频信息,其中,(x)可以是计算参数,可以是利用多个测试样本经过拟合得出的参数。In this step, after obtaining the video information of multiple candidate video sequences, the execution subject can locally read the load calculation formula used to calculate the screenshot load, and the load calculation formula is positively correlated with the video information of the video sequence. relation. The load calculation formula may be expressed as (x)*video information, where (x) may be a calculation parameter, and may be a parameter obtained through fitting using multiple test samples.

其中,视频信息可以包括视频序列的分辨率、码率、帧率和编码格式,则负载计算公式可以表现为以下形式:预计截图负载=(x1)*分辨率+(x2)*码率+(x3)*帧率+(x4)*编码格式。Wherein, the video information may include the resolution, bit rate, frame rate and encoding format of the video sequence, and the load calculation formula may be expressed in the following form: expected screenshot load=(x1)*resolution+(x2)*bit rate+( x3)*frame rate+(x4)*coding format.

步骤420,基于负载计算公式和多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。Step 420, based on the load calculation formula and the video information of the multiple candidate video sequences, calculate the expected screenshot load corresponding to the multiple candidate video sequences.

在本步骤中,上述执行主体获取到负载计算公式和多个候选视频序列的视频信息后,可以分别将每个候选视频序列的视频信息带入到负载计算公式中,计算出每个候选视频序列对应的预计截图负载。In this step, after the execution subject obtains the load calculation formula and the video information of multiple candidate video sequences, it can respectively bring the video information of each candidate video sequence into the load calculation formula to calculate the load calculation formula of each candidate video sequence Corresponding estimated screenshot load.

作为示例,上述执行主体获取到候选视频序列A的视频信息包括分辨率a1、码率a2、帧率a3和编码格式a4,候选视频序列B的视频信息包括分辨率b1、码率b2、帧率b3和编码格式b4,上述执行主体可以将候选视频序列A的分辨率a1、码率a2、帧率a3和编码格式a4带入到负载计算公式中,得到候选视频序列A的预计截图负载=(x1)*a1+(x2)*a2+(x3)*a3+(x4)*a4,还可以将候选视频序列B的分辨率b1、码率b2、帧率b3和编码格式b4带入到负载计算公式中,得到候选视频序列B的预计截图负载=(x1)*b1+(x2)*b2+(x3)*b3+(x4)*b4。As an example, the video information of the candidate video sequence A acquired by the above execution subject includes resolution a1, code rate a2, frame rate a3 and encoding format a4, and the video information of the candidate video sequence B includes resolution b1, code rate b2, frame rate b3 and encoding format b4, the above execution subject can bring the resolution a1, code rate a2, frame rate a3 and encoding format a4 of the candidate video sequence A into the load calculation formula to obtain the expected screenshot load of the candidate video sequence A=( x1)*a1+(x2)*a2+(x3)*a3+(x4)*a4, the resolution b1, code rate b2, frame rate b3 and encoding format b4 of the candidate video sequence B can also be brought into the load calculation formula , to obtain the expected screenshot load of the candidate video sequence B=(x1)*b1+(x2)*b2+(x3)*b3+(x4)*b4.

在本实现方式中,通过利用与视频序列的视频信息成正相关计算关系的负载计算公式,计算多个候选视频序列对应的预计截图负载,可以更准确地计算出预计截图负载,实现了对截图负载的预先估计,从而可以提高截图任务的负载均衡和资源利用率。In this implementation, by using the load calculation formula that is positively correlated with the video information of the video sequence to calculate the expected screenshot load corresponding to multiple candidate video sequences, the expected screenshot load can be calculated more accurately, and the screenshot load is realized. The pre-estimation of , which can improve the load balancing and resource utilization of the screenshot task.

参考图5,图5示出了获取负载计算公式的一个实施例的流程图500,即上述步骤410,获取用于计算截图负载的负载计算公式,可以包括以下步骤:Referring to FIG. 5, FIG. 5 shows a flow chart 500 of an embodiment of obtaining a load calculation formula, that is, the above-mentioned step 410, obtaining a load calculation formula for calculating the screenshot load may include the following steps:

步骤510,获取样本视频序列集合。Step 510, acquiring a set of sample video sequences.

在本步骤中,上述执行主体可以预先获取多个样本视频序列,并分别对每个样本视频序列进行视频解析处理,探测每个样本视频序列的媒体信息,获取到每个样本视频序列的样本视频信息,样本视频信息表征样本视频序列的视频复杂度信息,可以包括样本视频序列的分辨率、码率、帧率和编码格式等信息。上述执行主体还可以获取每个样本视频序列对应的样本截图负载,该样本截图负载可以是每个样本视频序列针对截图任务时对应的截图负载。上述执行主体可以将多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载对应组成样本视频序列集合。In this step, the above-mentioned executive body can obtain multiple sample video sequences in advance, and perform video analysis processing on each sample video sequence, detect the media information of each sample video sequence, and obtain the sample video of each sample video sequence Information, the sample video information represents the video complexity information of the sample video sequence, and may include information such as resolution, bit rate, frame rate, and encoding format of the sample video sequence. The execution subject may also acquire a sample screenshot load corresponding to each sample video sequence, and the sample screenshot load may be a screenshot load corresponding to each sample video sequence for a screenshot task. The above-mentioned execution subject may form a sample video sequence set by correspondingly combining multiple sample video sequences, sample video information of the multiple sample video sequences, and sample screenshot payloads corresponding to the multiple sample video sequences.

步骤520,利用回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,获取与样本视频信息和样本截图负载关联的负载计算公式。Step 520: Perform data analysis on the multiple sample video sequences, the sample video information of the multiple sample video sequences, and the sample screenshot loads corresponding to the multiple sample video sequences by using the regression statistics method, and obtain the load associated with the sample video information and the sample screenshot load calculation formula.

在本步骤中,上述执行主体获取到样本视频序列集合后,可以分别对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,利用数据分析法中的回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据拟合,得到与样本视频信息和样本截图负载关联的负载计算公式。In this step, after the execution subject obtains the set of sample video sequences, data analysis can be performed on multiple sample video sequences, sample video information of multiple sample video sequences, and sample screenshot loads corresponding to multiple sample video sequences. The regression statistical method in the data analysis method performs data fitting on multiple sample video sequences, sample video information of multiple sample video sequences, and sample screenshot loads corresponding to multiple sample video sequences, and obtains the correlation between sample video information and sample screenshot loads The load calculation formula.

在本实现方式中,通过样本视频序列集合获取与样本视频信息和样本截图负载关联的负载计算公式,可以根据目前的测试样本经过拟合得出负载计算公式,以利用该负载计算公式更准确地计算出预计截图负载,实现了对截图负载的预先估计,从而可以提高截图任务的负载均衡和资源利用率。In this implementation, the load calculation formula associated with the sample video information and sample screenshot load is obtained through the sample video sequence set, and the load calculation formula can be obtained through fitting according to the current test samples, so as to use the load calculation formula to more accurately The estimated screenshot load is calculated, and the pre-estimation of the screenshot load is realized, so that the load balance and resource utilization of the screenshot task can be improved.

参考图6,图6示出了获取视频截图的方法的另一个实施例的流程图600,可以包括以下步骤:Referring to FIG. 6, FIG. 6 shows a flow chart 600 of another embodiment of a method for obtaining video screenshots, which may include the following steps:

步骤610,响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息。Step 610, in response to acquiring a video sequence set for executing a screenshot task, acquire video information of multiple candidate video sequences in the video sequence set.

本实施例的步骤610可以按照与图2所示实施例中的步骤210类似的方式执行,此处不赘述。Step 610 of this embodiment may be performed in a manner similar to step 210 in the embodiment shown in FIG. 2 , and details are not described here.

步骤620,基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。Step 620, based on the video information of the multiple candidate video sequences, calculate the expected screenshot load corresponding to the multiple candidate video sequences.

本实施例的步骤620可以按照与图2所示实施例中的步骤220类似的方式执行,此处不赘述。Step 620 of this embodiment may be performed in a manner similar to step 220 in the embodiment shown in FIG. 2 , and details are not described here.

步骤630,基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列。Step 630: Select a target video sequence from the video sequence set based on the locally available resources and the expected screenshot loads corresponding to the plurality of candidate video sequences.

本实施例的步骤630可以按照与图2所示实施例中的步骤230类似的方式执行,此处不赘述。Step 630 of this embodiment may be performed in a manner similar to step 230 in the embodiment shown in FIG. 2 , and details are not described here.

步骤640,执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。Step 640, execute the screenshot task of the target video sequence, and obtain the video screenshot corresponding to the target video sequence.

本实施例的步骤640可以按照与图2所示实施例中的步骤240类似的方式执行,此处不赘述。Step 640 of this embodiment may be performed in a manner similar to step 240 in the embodiment shown in FIG. 2 , and details are not described here.

步骤650,响应于执行目标视频序列的截图任务,获取目标视频序列对应的实时截图负载。Step 650, in response to executing the screenshot task of the target video sequence, acquire the real-time screenshot load corresponding to the target video sequence.

在本步骤中,上述执行主体在开执行目标视频序列的截图任务时,还可以启动截图任务对应的定时器,每隔预设时间对截图任务执行过程中的负载值进行读取,并根据该时间段内的负载值计算截图任务进程所占用的累计平均值,获取到目标视频序列对应的实时截图负载,该实时截图负载可以表征一段时间内的截图负载的平均值。In this step, when the execution subject executes the screenshot task of the target video sequence, it can also start the timer corresponding to the screenshot task, and read the load value during the execution of the screenshot task every preset time, and according to the The load value in the time period calculates the cumulative average value occupied by the screenshot task process, and obtains the real-time screenshot load corresponding to the target video sequence. The real-time screenshot load can represent the average value of the screenshot load within a period of time.

步骤640,基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式。Step 640: Based on the real-time screenshot load corresponding to the target video sequence and the estimated screenshot load corresponding to the target video sequence, the load calculation formula is updated to obtain a new load calculation formula.

在本步骤中,上述执行主体获取到目标视频序列对应的实时截图负载后,可以将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,并根据目标视频序列对应的实时截图负载对负载计算公式进行更新,调整负载计算公式中的计算参数,得到新的负载计算公式。In this step, after the above execution subject obtains the real-time screenshot load corresponding to the target video sequence, it can compare the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and based on the real-time screenshot load corresponding to the target video sequence The screenshot load updates the load calculation formula, adjusts the calculation parameters in the load calculation formula, and obtains a new load calculation formula.

上述执行主体可以利用新的负载计算公式替换之前的负载计算公式,后续的候选视频序列则可以通过新的负载计算公式计算预计截图负载。The above execution subject can use the new load calculation formula to replace the previous load calculation formula, and the subsequent candidate video sequences can use the new load calculation formula to calculate the expected screenshot load.

作为一个可选实现方式,参考图7,图7示出了对负载计算公式进行更新的一个实施例的流程图700,即上述步骤640,基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式,可以包括以下步骤:As an optional implementation, refer to FIG. 7, which shows a flow chart 700 of an embodiment of updating the load calculation formula, that is, the above step 640, based on the real-time screenshot load corresponding to the target video sequence corresponding to the target video sequence The expected screenshot load, update the load calculation formula, and obtain a new load calculation formula, which may include the following steps:

步骤710,将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,判断目标视频序列对应的实时截图负载是否符合负载条件。Step 710: Compare the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and determine whether the real-time screenshot load corresponding to the target video sequence meets the load condition.

在本步骤中,上述执行主体获取到目标视频序列对应的实时截图负载后,可以将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,判断目标视频序列对应的实时截图负载是否符合负载条件,该负载条件可以包括实时截图负载在预设范围内,预设范围可以为[最小负载值,最大负载值],其中,最小负载值为预计截图负载*0.3,最大负载值为预计截图负载*1.3。In this step, after the execution subject obtains the real-time screenshot load corresponding to the target video sequence, it can compare the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and determine the real-time screenshot corresponding to the target video sequence Whether the load meets the load condition. The load condition can include that the real-time screenshot load is within the preset range. The preset range can be [minimum load value, maximum load value], where the minimum load value is the estimated screenshot load*0.3, and the maximum load value *1.3 for estimated screenshot load.

上述执行主体可以将目标视频序列对应的实时截图负载与预设范围进行比较,判断实时截图负载是否在预设范围内,以确定目标视频序列对应的实时截图负载是否符合负载条件。The execution subject can compare the real-time screenshot load corresponding to the target video sequence with a preset range, and judge whether the real-time screenshot load is within the preset range, so as to determine whether the real-time screenshot load corresponding to the target video sequence meets the load condition.

步骤720,响应于确定目标视频序列对应的实时截图负载符合负载条件,将目标视频序列对应的实时截图负载和目标视频序列的视频信息存储至样本视频序列集合,得到新的样本视频序列集合。Step 720: In response to determining that the real-time screenshot load corresponding to the target video sequence meets the load condition, store the real-time screenshot load corresponding to the target video sequence and the video information of the target video sequence in the sample video sequence set to obtain a new sample video sequence set.

在本步骤中,上述执行主体经判断确定目标视频序列对应的实时截图负载符合负载条件,可以将目标视频序列对应的实时截图负载与目标视频序列进行关联标记,并确定目标视频序列对应的视频信息。上述执行主体将目标视频序列对应的实时截图负载和目标视频序列的视频信息存储至样本视频序列集合,对样本视频序列集合进行更新,获取到新的样本视频序列集合。In this step, the execution subject determines that the real-time screenshot load corresponding to the target video sequence meets the load condition after judging, can associate the real-time screenshot load corresponding to the target video sequence with the target video sequence, and determine the video information corresponding to the target video sequence . The execution subject stores the real-time screenshot load corresponding to the target video sequence and the video information of the target video sequence in the sample video sequence set, updates the sample video sequence set, and obtains a new sample video sequence set.

步骤710,基于新的样本视频序列集合,对负载计算公式进行更新,得到新的负载计算公式。Step 710, based on the new sample video sequence set, update the load calculation formula to obtain a new load calculation formula.

在本步骤中,上述执行主体获取到新的样本视频序列集合后,可以分别对新的样本视频序列集合中的多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,利用数据分析法中的回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据拟合,得到与新的样本视频序列集合对应的负载计算公式。然后上述执行主体还可以利用方差分析对得到的负载计算公式与实时截图负载进行误差计算和公式参数微调,得到新的负载计算公式。In this step, after the above-mentioned execution subject obtains the new set of sample video sequences, the multiple sample video sequences in the new set of sample video sequences, the sample video information of the multiple sample video sequences, and the multiple sample video sequences Perform data analysis on the corresponding sample screenshot load, and use the regression statistical method in the data analysis method to perform data fitting on multiple sample video sequences, sample video information of multiple sample video sequences, and sample screenshot loads corresponding to multiple sample video sequences, A load calculation formula corresponding to the new set of sample video sequences is obtained. Then, the executive body can also use variance analysis to perform error calculation and fine-tuning of formula parameters on the obtained load calculation formula and real-time screenshot load to obtain a new load calculation formula.

上述执行主体可以利用新的负载计算公式替换之前的负载计算公式,后续的候选视频序列则可以通过新的负载计算公式计算预计截图负载。The above execution subject can use the new load calculation formula to replace the previous load calculation formula, and the subsequent candidate video sequences can use the new load calculation formula to calculate the expected screenshot load.

在本实现方式中,通过实时负载反馈机制对负载计算公式进行实时更新和调整,能够保证负载计算公式的准确性,更准确地计算视频序列对应的预计截图负载。In this implementation, the load calculation formula is updated and adjusted in real time through the real-time load feedback mechanism, which can ensure the accuracy of the load calculation formula and more accurately calculate the expected screenshot load corresponding to the video sequence.

以及,若上述执行主体经判断确定目标视频序列对应的实时截图负载不符合负载条件,可以将该实时截图负载丢弃,不作为新的样本视频序列集合中的新数据。And, if the execution subject determines that the real-time screenshot payload corresponding to the target video sequence does not meet the load condition, the real-time screenshot payload can be discarded as new data in the new sample video sequence set.

在本实施例中,通过增加实时负载反馈机制对实时截图负载进行获取,并能够对负载计算公式进行实时更新和调整,保证负载计算公式的准确性,从而可以更准确地计算视频序列对应的预计截图负载。In this embodiment, the real-time screenshot load is obtained by adding a real-time load feedback mechanism, and the load calculation formula can be updated and adjusted in real time to ensure the accuracy of the load calculation formula, so that the estimated video sequence can be calculated more accurately. screenshot load.

继续参考图6,上述获取视频截图的方法还可以包括以下步骤:Continuing to refer to FIG. 6, the above-mentioned method for obtaining video screenshots may also include the following steps:

步骤670,基于新的负载计算公式和目标视频序列的视频信息,计算目标视频序列对应的新的预计截图负载。Step 670, based on the new load calculation formula and the video information of the target video sequence, calculate a new expected screenshot load corresponding to the target video sequence.

在本步骤中,上述执行主体获取到新的负载计算公式后,可以将目标视频序列的视频信息带入到新的负载计算公式中,计算目标视频序列对应的新的预计截图负载。In this step, after the execution subject obtains the new load calculation formula, the video information of the target video sequence can be brought into the new load calculation formula to calculate the new expected screenshot load corresponding to the target video sequence.

步骤680,根据本地可用资源和目标视频序列对应的新的预计截图负载,对目标视频序列执行预设调整操作。Step 680: Perform a preset adjustment operation on the target video sequence according to the local available resources and the new expected screenshot load corresponding to the target video sequence.

在本步骤中,上述执行主体获取到目标视频序列对应的新的预计截图负载后,可以将目标视频序列对应的新的预计截图负载与本地可用资源进行比较,并根据比较结果对目标视频序列执行预设调整操作,该预设调整操作可以包括调整目标视频序列的数量,或者调整目标视频序列的截图倍速。In this step, after the execution subject obtains the new expected screenshot load corresponding to the target video sequence, it can compare the new estimated screenshot load corresponding to the target video sequence with the local available resources, and execute the target video sequence according to the comparison result. A preset adjustment operation, where the preset adjustment operation may include adjusting the number of target video sequences, or adjusting the screenshot multiple of the target video sequence.

若目标视频序列对应的新的预计截图负载小于本地可用资源,则上述执行主体可以根据新的负载计算公式计算视频序列集合中其他候选视频序列的新的预计截图负载,并根据新的预计截图负载、目标视频序列对应的新的预计截图负载和本地可用资源,再添加新的目标视频序列,从而增加目标视频序列的数量,提高资源利用率。If the new estimated screenshot load corresponding to the target video sequence is less than the local available resources, the above execution subject can calculate the new estimated screenshot load of other candidate video sequences in the video sequence set according to the new load calculation formula, and calculate the new estimated screenshot load according to the new estimated screenshot load. , the new expected screenshot load and local available resources corresponding to the target video sequence, and then add a new target video sequence, thereby increasing the number of target video sequences and improving resource utilization.

若目标视频序列对应的新的预计截图负载大于本地可用资源,则上述执行主体可以确定当前目标视频序列对应的新的预计截图负载已超过本地可用资源,需要降低目标视频序列的截图倍速,以保证负载均衡。If the new expected screenshot load corresponding to the target video sequence is greater than the local available resources, then the above-mentioned executive body can determine that the new expected screenshot load corresponding to the current target video sequence has exceeded the local available resources, and the screenshot multiple speed of the target video sequence needs to be reduced to ensure Load balancing.

在本实施例中,通过根据本地可用资源和目标视频序列对应的新的预计截图负载,对目标视频序列执行预设调整操作,可以实时调整任务执行过程中目标视频序列的数量或者截图倍速,以保证资源的利用率和负载均衡。In this embodiment, by performing a preset adjustment operation on the target video sequence according to the local available resources and the new expected screenshot load corresponding to the target video sequence, the number of target video sequences or the screenshot multiplication speed during task execution can be adjusted in real time, so as to Ensure resource utilization and load balancing.

进一步参考图8,作为对上述各图所示方法的实现,本公开提供了一种获取视频截图的装置的一个实施例。该装置实施例与图2所示的方法实施例相对应。Further referring to FIG. 8 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for acquiring video screenshots. This device embodiment corresponds to the method embodiment shown in FIG. 2 .

如图8所示,本实施例的获取视频截图的装置800可以包括:获取模块810、计算模块820、选取模块830和执行模块840。As shown in FIG. 8 , the apparatus 800 for acquiring video screenshots in this embodiment may include: an acquisition module 810 , a calculation module 820 , a selection module 830 and an execution module 840 .

其中,获取模块810,被配置成响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息;Wherein, the acquiring module 810 is configured to acquire the video information of multiple candidate video sequences in the video sequence set in response to acquiring the video sequence set for performing the screenshot task;

计算模块820,被配置成基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载;The calculation module 820 is configured to calculate the expected screenshot load corresponding to the multiple candidate video sequences based on the video information of the multiple candidate video sequences;

选取模块830,被配置成基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列;The selection module 830 is configured to select a target video sequence from the video sequence set based on locally available resources and the expected screenshot load corresponding to the plurality of candidate video sequences;

执行模块840,被配置成执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。The execution module 840 is configured to execute the screenshot task of the target video sequence, and obtain a video screenshot corresponding to the target video sequence.

在本实施的一些可选的实现方式中,计算模块820,包括:获取单元,被配置成获取用于计算截图负载的负载计算公式;计算单元,被配置成基于负载计算公式和多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载。In some optional implementations of this embodiment, the calculation module 820 includes: an acquisition unit configured to acquire a load calculation formula used to calculate the screenshot load; a calculation unit configured to obtain a load calculation formula based on the load calculation formula and a plurality of candidate videos The video information of the sequence is used to calculate the expected screenshot load corresponding to multiple candidate video sequences.

在本实施的一些可选的实现方式中,计算单元,进一步被配置成:获取样本视频序列集合,其中,样本视频序列集合包括多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载;利用回归统计方法对多个样本视频序列、多个样本视频序列的样本视频信息和多个样本视频序列对应的样本截图负载进行数据分析,获取与样本视频信息和样本截图负载关联的负载计算公式。In some optional implementation manners of this embodiment, the computing unit is further configured to: acquire a set of sample video sequences, where the set of sample video sequences includes multiple sample video sequences, sample video information of multiple sample video sequences, and multiple A sample screenshot load corresponding to a sample video sequence; using a regression statistical method to perform data analysis on a plurality of sample video sequences, sample video information of a plurality of sample video sequences, and sample screenshot loads corresponding to a plurality of sample video sequences, to obtain information related to the sample video The load calculation formula associated with the sample screenshot load.

在本实施的一些可选的实现方式中,该装置还包括更新模块;获取模块810,进一步被配置成:响应于执行目标视频序列的截图任务,获取目标视频序列对应的实时截图负载;更新模块,被配置成:基于目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载,对负载计算公式进行更新,得到新的负载计算公式。In some optional implementations of this embodiment, the device also includes an update module; the acquisition module 810 is further configured to: in response to executing the screenshot task of the target video sequence, acquire the real-time screenshot load corresponding to the target video sequence; the update module , is configured to: update the load calculation formula based on the real-time screenshot load corresponding to the target video sequence and the estimated screenshot load corresponding to the target video sequence, to obtain a new load calculation formula.

在本实施的一些可选的实现方式中,更新模块,进一步被配置成:将目标视频序列对应的实时截图负载与目标视频序列对应的预计截图负载进行比较,判断目标视频序列对应的实时截图负载是否符合负载条件;响应于确定目标视频序列对应的实时截图负载符合负载条件,将目标视频序列对应的实时截图负载和目标视频序列的视频信息存储至样本视频序列集合,得到新的样本视频序列集合;基于新的样本视频序列集合,对负载计算公式进行更新,得到新的负载计算公式。In some optional implementations of this implementation, the update module is further configured to: compare the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and determine the real-time screenshot load corresponding to the target video sequence Whether it meets the load condition; in response to determining that the real-time screenshot load corresponding to the target video sequence meets the load condition, the real-time screenshot load corresponding to the target video sequence and the video information of the target video sequence are stored in the sample video sequence set to obtain a new sample video sequence set ; Based on the new sample video sequence set, the load calculation formula is updated to obtain a new load calculation formula.

在本实施的一些可选的实现方式中,计算模块820,进一步被配置成:基于新的负载计算公式和目标视频序列的视频信息,计算目标视频序列对应的新的预计截图负载;执行模块840,进一步被配置成:根据本地可用资源和目标视频序列对应的新的预计截图负载,对目标视频序列执行预设调整操作。In some optional implementations of this embodiment, the calculation module 820 is further configured to: calculate the new expected screenshot load corresponding to the target video sequence based on the new load calculation formula and the video information of the target video sequence; the execution module 840 , is further configured to: perform a preset adjustment operation on the target video sequence according to the local available resources and the new expected screenshot load corresponding to the target video sequence.

本公开的上述实施例提供的获取视频截图的装置,上述执行主体首先响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息,然后基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载,并基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列,最后执行目标视频序列的截图任务,得到目标视频序列对应的视频截图,在执行截图任务之前可以预先确定每个视频序列的截图任务对应的预计截图负载,可以预先准确地分配截图任务的数量,不需要通过设置任务的线程数,限制任务所能使用的机器资源,基于准确计算的预计截图负载为截图任务分配资源配额即可,能够基于预计截图负载分配更多的截图任务,充分利用服务器的本地可用资源,提高了负载均衡和资源利用率。In the device for acquiring video screenshots provided by the above-mentioned embodiments of the present disclosure, the execution subject first acquires the video information of multiple candidate video sequences in the video sequence set in response to acquiring the video sequence set used to execute the screenshot task, and then based on the multiple The video information of the candidate video sequences, calculate the estimated screenshot load corresponding to multiple candidate video sequences, and based on the local available resources and the estimated screenshot load corresponding to multiple candidate video sequences, select the target video sequence from the video sequence set, and finally execute the target video sequence Sequence screenshot task, get the video screenshot corresponding to the target video sequence, before executing the screenshot task, you can pre-determine the expected screenshot load corresponding to the screenshot task of each video sequence, you can accurately allocate the number of screenshot tasks in advance, no need to set the task The number of threads, limit the machine resources that can be used by the task, and allocate resource quotas for the screenshot task based on the accurately calculated expected screenshot load. More screenshot tasks can be allocated based on the estimated screenshot load, making full use of the local available resources of the server, and improving load balancing and resource utilization.

本领域技术人员可以理解,上述装置还包括一些其他公知结构,例如处理器、存储器等,为了不必要地模糊本公开的实施例,这些公知的结构在图8中未示出。Those skilled in the art can understand that the above-mentioned apparatus also includes some other known structures, such as a processor, a memory, etc., and these known structures are not shown in FIG. 8 in order to unnecessarily obscure the embodiments of the present disclosure.

下面参考图9,其示出了适于用来实现本公开的实施例的电子设备900的结构示意图。本公开的实施例中的终端设备可以包括但不限于诸如智能屏、笔记本电脑、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图9示出的终端设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。Referring now to FIG. 9 , it shows a schematic structural diagram of an electronic device 900 suitable for implementing an embodiment of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as smart screens, notebook computers, PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and mobile terminals such as Stationary terminal for digital TV, desktop computer, etc. The terminal device shown in FIG. 9 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.

如图9所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(ROM)902中的程序或者从存储装置908加载到随机访问存储器(RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。As shown in FIG. 9, an electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may be randomly accessed according to a program stored in a read-only memory (ROM) 902 or loaded from a storage device 908. Various appropriate actions and processes are executed by programs in the memory (RAM) 903 . In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored. The processing device 901, ROM 902, and RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904 .

通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图9示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图9中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices can be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration an output device 907 such as a computer; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device 900 to perform wireless or wired communication with other devices to exchange data. While FIG. 9 shows electronic device 900 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided. Each block shown in FIG. 9 may represent one device, or may represent multiple devices as required.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装,或者从ROM 902被安装。在该计算机程序被处理装置901执行时,执行本公开的实施例的方法中限定的上述功能。需要说明的是,本公开的实施例的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 909, or from storage means 908, or from ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed. It should be noted that the computer-readable medium in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the embodiments of the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的实施例的操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络包括局域网(LAN)或广域网(WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the embodiments of the present disclosure may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional A procedural programming language such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. Where a remote computer is involved, the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g. via the Internet using an Internet Service Provider). .

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取模块、计算模块、选取模块和执行模块,其中,这些模块的名称在某种情况下并不构成对该模块本身的限定。The units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware. The described unit can also be set in a processor, for example, it can be described as: a processor includes an acquisition module, a calculation module, a selection module and an execution module, wherein the names of these modules do not constitute a reference to The module itself is defined.

作为另一方面,本申请还提供了一种计算机可读介质,上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于获取到用于执行截图任务的视频序列集合,获取视频序列集合中多个候选视频序列的视频信息;基于多个候选视频序列的视频信息,计算多个候选视频序列对应的预计截图负载;基于本地可用资源和多个候选视频序列对应的预计截图负载,从视频序列集合中选取目标视频序列;执行目标视频序列的截图任务,得到目标视频序列对应的视频截图。As another aspect, the present application also provides a computer-readable medium. The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to acquiring the video sequence set for performing the screenshot task, acquires the video sequence set The video information of multiple candidate video sequences; based on the video information of multiple candidate video sequences, calculate the expected screenshot load corresponding to multiple candidate video sequences; based on the local available resources and the estimated screenshot load corresponding to multiple candidate video sequences, from the video The target video sequence is selected from the sequence set; the screenshot task of the target video sequence is executed to obtain a video screenshot corresponding to the target video sequence.

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principle. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the above-mentioned invention without departing from the above-mentioned inventive concept. Other technical solutions formed by any combination of technical features or equivalent features. For example, a technical solution formed by replacing the above-mentioned features with technical features with similar functions disclosed in (but not limited to) the embodiments of the present disclosure.

Claims (14)

1. A method of obtaining a video screenshot, the method comprising:
in response to acquiring a set of video sequences for performing a screenshot task, acquiring video information of a plurality of candidate video sequences in the set of video sequences;
calculating predicted screenshot loads corresponding to the plurality of candidate video sequences based on video information of the plurality of candidate video sequences;
selecting a target video sequence from the video sequence set based on locally available resources and expected screenshot loads corresponding to the plurality of candidate video sequences;
and executing the screenshot task of the target video sequence to obtain the video screenshot corresponding to the target video sequence.
2. The method of claim 1, wherein the calculating, based on video information of the plurality of candidate video sequences, an expected screenshot load for the plurality of candidate video sequences comprises:
acquiring a load calculation formula for calculating a screenshot load;
and calculating the expected screenshot loads corresponding to the candidate video sequences based on the load calculation formula and the video information of the candidate video sequences.
3. The method of claim 2, wherein the obtaining a load calculation formula for calculating a screenshot load comprises:
acquiring a sample video sequence set, wherein the sample video sequence set comprises a plurality of sample video sequences, sample video information of the plurality of sample video sequences and sample screenshot loads corresponding to the plurality of sample video sequences;
and carrying out data analysis on the plurality of sample video sequences, the sample video information of the plurality of sample video sequences and the sample screenshot loads corresponding to the plurality of sample video sequences by using a regression statistical method, and obtaining a load calculation formula associated with the sample video information and the sample screenshot loads.
4. A method according to any one of claims 1-3, the method further comprising:
Responding to the execution of the screenshot task of the target video sequence, and acquiring a real-time screenshot load corresponding to the target video sequence;
and updating the load calculation formula based on the real-time screenshot load corresponding to the target video sequence and the expected screenshot load corresponding to the target video sequence to obtain a new load calculation formula.
5. The method of claim 4, wherein updating the load calculation formula based on the real-time screenshot load corresponding to the target video sequence and the predicted screenshot load corresponding to the target video sequence to obtain a new load calculation formula comprises:
comparing the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and judging whether the real-time screenshot load corresponding to the target video sequence meets the load condition or not;
in response to determining that the real-time screenshot load corresponding to the target video sequence meets a load condition, storing the real-time screenshot load corresponding to the target video sequence and video information of the target video sequence into a sample video sequence set to obtain a new sample video sequence set;
And updating the load calculation formula based on the new sample video sequence set to obtain a new load calculation formula.
6. The method of claim 4, the method further comprising:
calculating a new expected screenshot load corresponding to the target video sequence based on the new load calculation formula and the video information of the target video sequence;
and executing preset adjustment operation on the target video sequence according to the locally available resources and the new expected screenshot load corresponding to the target video sequence.
7. An apparatus for obtaining a video screenshot, the apparatus comprising:
an acquisition module configured to acquire video information of a plurality of candidate video sequences in a set of video sequences in response to acquiring the set of video sequences for performing a screenshot task;
a calculation module configured to calculate predicted screenshot loads corresponding to the plurality of candidate video sequences based on video information of the plurality of candidate video sequences;
a selection module configured to select a target video sequence from the set of video sequences based on locally available resources and predicted screenshot loads corresponding to the plurality of candidate video sequences;
And the execution module is configured to execute the screenshot task of the target video sequence to obtain the video screenshot corresponding to the target video sequence.
8. The apparatus of claim 7, wherein the computing module comprises:
an acquisition unit configured to acquire a load calculation formula for calculating a screenshot load;
and a calculating unit configured to calculate predicted screenshot loads corresponding to the plurality of candidate video sequences based on the load calculation formula and video information of the plurality of candidate video sequences.
9. The apparatus of claim 8, wherein the computing unit is further configured to:
acquiring a sample video sequence set, wherein the sample video sequence set comprises a plurality of sample video sequences, sample video information of the plurality of sample video sequences and sample screenshot loads corresponding to the plurality of sample video sequences;
and carrying out data analysis on the plurality of sample video sequences, the sample video information of the plurality of sample video sequences and the sample screenshot loads corresponding to the plurality of sample video sequences by using a regression statistical method, and obtaining a load calculation formula associated with the sample video information and the sample screenshot loads.
10. The apparatus of any of claims 7-9, wherein the apparatus further comprises an update module;
the acquisition module is further configured to: responding to the execution of the screenshot task of the target video sequence, and acquiring a real-time screenshot load corresponding to the target video sequence;
the update module is configured to: and updating the load calculation formula based on the real-time screenshot load corresponding to the target video sequence and the expected screenshot load corresponding to the target video sequence to obtain a new load calculation formula.
11. The apparatus of claim 10, wherein the update module is further configured to:
comparing the real-time screenshot load corresponding to the target video sequence with the expected screenshot load corresponding to the target video sequence, and judging whether the real-time screenshot load corresponding to the target video sequence meets the load condition or not;
in response to determining that the real-time screenshot load corresponding to the target video sequence meets a load condition, storing the real-time screenshot load corresponding to the target video sequence and video information of the target video sequence into a sample video sequence set to obtain a new sample video sequence set;
And updating the load calculation formula based on the new sample video sequence set to obtain a new load calculation formula.
12. The apparatus of claim 10, wherein the computing module is further configured to: calculating a new expected screenshot load corresponding to the target video sequence based on the new load calculation formula and the video information of the target video sequence;
the execution module is further configured to: and executing preset adjustment operation on the target video sequence according to the locally available resources and the new expected screenshot load corresponding to the target video sequence.
13. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-6.
14. A computer readable medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any one of claims 1-6.
CN202211249420.4A 2022-10-12 2022-10-12 Method and device for obtaining video screenshots Active CN116095414B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211249420.4A CN116095414B (en) 2022-10-12 2022-10-12 Method and device for obtaining video screenshots
PCT/CN2023/089184 WO2024077916A1 (en) 2022-10-12 2023-04-19 Video screenshot acquiring method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211249420.4A CN116095414B (en) 2022-10-12 2022-10-12 Method and device for obtaining video screenshots

Publications (2)

Publication Number Publication Date
CN116095414A true CN116095414A (en) 2023-05-09
CN116095414B CN116095414B (en) 2025-05-16

Family

ID=86198021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211249420.4A Active CN116095414B (en) 2022-10-12 2022-10-12 Method and device for obtaining video screenshots

Country Status (2)

Country Link
CN (1) CN116095414B (en)
WO (1) WO2024077916A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015070754A1 (en) * 2013-11-14 2015-05-21 腾讯科技(深圳)有限公司 Video processing method, related device and communication system
US20170238000A1 (en) * 2016-02-16 2017-08-17 Gachon University Of Industry-Academic Cooperation Foundation Parallel video processing apparatus using multicore system and method thereof
CN107484018A (en) * 2017-07-31 2017-12-15 维沃移动通信有限公司 A video screenshot method, mobile terminal
CN108733821A (en) * 2018-05-22 2018-11-02 武汉微创光电股份有限公司 A kind of distribution of monitor video sectional drawing and methods of exhibiting and system
CN109325145A (en) * 2018-09-19 2019-02-12 上海哔哩哔哩科技有限公司 Acquisition methods, terminal and the computer readable storage medium of video thumbnails
CN111757046A (en) * 2019-03-28 2020-10-09 菜鸟智能物流控股有限公司 Data processing method, device, equipment and machine readable medium
CN112929745A (en) * 2018-12-18 2021-06-08 腾讯科技(深圳)有限公司 Video data processing method, device, computer readable storage medium and equipment
CN114244848A (en) * 2021-12-15 2022-03-25 中国电信股份有限公司 Candidate streaming media determination, load balancing method, apparatus, server and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015070754A1 (en) * 2013-11-14 2015-05-21 腾讯科技(深圳)有限公司 Video processing method, related device and communication system
US20170238000A1 (en) * 2016-02-16 2017-08-17 Gachon University Of Industry-Academic Cooperation Foundation Parallel video processing apparatus using multicore system and method thereof
CN107484018A (en) * 2017-07-31 2017-12-15 维沃移动通信有限公司 A video screenshot method, mobile terminal
CN108733821A (en) * 2018-05-22 2018-11-02 武汉微创光电股份有限公司 A kind of distribution of monitor video sectional drawing and methods of exhibiting and system
CN109325145A (en) * 2018-09-19 2019-02-12 上海哔哩哔哩科技有限公司 Acquisition methods, terminal and the computer readable storage medium of video thumbnails
CN112929745A (en) * 2018-12-18 2021-06-08 腾讯科技(深圳)有限公司 Video data processing method, device, computer readable storage medium and equipment
CN111757046A (en) * 2019-03-28 2020-10-09 菜鸟智能物流控股有限公司 Data processing method, device, equipment and machine readable medium
CN114244848A (en) * 2021-12-15 2022-03-25 中国电信股份有限公司 Candidate streaming media determination, load balancing method, apparatus, server and medium

Also Published As

Publication number Publication date
CN116095414B (en) 2025-05-16
WO2024077916A1 (en) 2024-04-18

Similar Documents

Publication Publication Date Title
US9106521B2 (en) Method and system for visualizing an adaptive screen according to a terminal
CN112272226B (en) Picture loading method and device and readable storage medium
CN110213614B (en) Method and device for extracting key frame from video file
CN108052615A (en) Access request processing method, device, medium and electronic equipment
CN113163002B (en) Server switching method and device and storage medium
CN113254105B (en) Resource processing method and device, storage medium and electronic equipment
CN111459364B (en) Icon updating method and device and electronic equipment
CN111246228B (en) Method, device, medium and electronic equipment for updating gift resources of live broadcast room
WO2024245140A1 (en) Video processing method and apparatus, and electronic device
CN115802078B (en) Video stream transmission method, device, electronic device and computer readable storage medium
WO2023197811A1 (en) Video downloading method and apparatus, video transmission method and apparatus, terminal device, server and medium
CN115834918B (en) Video live broadcast method and device, electronic equipment and readable storage medium
CN110768861B (en) Method, device, medium and electronic equipment for obtaining overtime threshold
CN110809166B (en) Video data processing method and device and electronic equipment
CN110418134B (en) Video coding method and device based on video quality and electronic equipment
CN111694629A (en) Information display method and device and electronic equipment
CN113726801A (en) AB experiment method, device, equipment and medium applied to server
CN116095414A (en) Method and device for obtaining video screenshots
CN117241092A (en) A video processing method, device, storage medium and electronic equipment
CN113792869B (en) Video processing method and device based on neural network chip and electronic equipment
CN116958857A (en) Model training method, video processing method, device, medium and equipment
CN111367592B (en) Information processing method and device
CN112148448A (en) Resource allocation method, device, equipment and computer readable medium
CN111399730A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
US20240147000A1 (en) Client transcoding of video segment

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