CN111970565A - Video data processing method and device, electronic equipment and storage medium - Google Patents
Video data processing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111970565A CN111970565A CN202010997869.3A CN202010997869A CN111970565A CN 111970565 A CN111970565 A CN 111970565A CN 202010997869 A CN202010997869 A CN 202010997869A CN 111970565 A CN111970565 A CN 111970565A
- Authority
- CN
- China
- Prior art keywords
- video
- threshold
- bit rate
- processed
- target bit
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4402—Processing 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 reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440218—Processing 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 reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/177—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
- H04N21/234309—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/266—Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
- H04N21/2662—Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请公开了一种视频数据处理方法、装置、电子设备以及存储介质,涉及数据处理技术领域。该方法包括:获取待处理视频以及与所述待处理视频对应的目标码率,所述目标码率低于所述待处理视频的初始码率;基于所述目标码率对所述待处理视频进行转码处理;获取与转码处理后的所述待处理视频对应的质量指标值;若所述质量指标值与质量阈值的差值大于第一阈值,对所述目标码率进行调整,并基于调整后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。本方法实现了在确保待处理视频的视频质量的前提下对其目标码率进行调整,进而实现节约码率,节约网络带宽。
The present application discloses a video data processing method, device, electronic device and storage medium, and relates to the technical field of data processing. The method includes: acquiring a video to be processed and a target bit rate corresponding to the video to be processed, where the target bit rate is lower than an initial bit rate of the video to be processed; Perform transcoding processing; obtain the quality index value corresponding to the video to be processed after the transcoding process; if the difference between the quality index value and the quality threshold value is greater than the first threshold, adjust the target bit rate, and The transcoding process is performed on the video to be processed based on the adjusted target bit rate until the difference is less than or equal to the first threshold. The method realizes that the target bit rate of the video to be processed is adjusted on the premise of ensuring the video quality of the video to be processed, thereby saving the bit rate and the network bandwidth.
Description
技术领域technical field
本申请涉及视频处理技术领域,更具体地,涉及一种视频数据处理方法、装置、电子设备及存储介质。The present application relates to the technical field of video processing, and more particularly, to a video data processing method, apparatus, electronic device and storage medium.
背景技术Background technique
随着网络技术的发展,视频业务得到了飞速发展,用户对所观看视频的质量需求也越来越高。在相关提高视频质量的方式中,可以对视频数据进行转码。然而,随着视频数据种类的增加以及视频业务流量的增加,为了确保视频质量,在对视频数据进行转码时,还存在码率浪费的问题,进而造成网络带宽的浪费。With the development of network technology, video services have developed rapidly, and users have higher and higher requirements for the quality of the videos they watch. In a related manner of improving video quality, video data may be transcoded. However, with the increase of types of video data and the increase of video service traffic, in order to ensure video quality, when transcoding video data, there is still a problem of wasted bit rate, which in turn results in wasted network bandwidth.
发明内容SUMMARY OF THE INVENTION
本申请提出了一种视频数据处理方法、装置、电子设备及存储介质,以改善上述问题。The present application proposes a video data processing method, device, electronic device and storage medium to improve the above problems.
第一方面,本申请实施例提供了一种视频数据处理方法,所述方法包括:获取待处理视频以及与所述待处理视频对应的目标码率,所述目标码率低于所述待处理视频的初始码率;基于所述目标码率对所述待处理视频进行转码处理;获取与转码处理后的所述待处理视频对应的质量指标值;若所述质量指标值与质量阈值的差值大于第一阈值,对所述目标码率进行调整,并基于调整后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。In a first aspect, an embodiment of the present application provides a video data processing method, the method includes: acquiring a video to be processed and a target bit rate corresponding to the video to be processed, where the target bit rate is lower than the to-be-processed video The initial bit rate of the video; the video to be processed is transcoded based on the target bit rate; the quality indicator value corresponding to the video to be processed after the transcoding process is obtained; if the quality indicator value and the quality threshold The difference is greater than the first threshold, adjust the target bit rate, and perform the transcoding process on the video to be processed based on the adjusted target bit rate, until the difference is less than or equal to the first threshold.
第二方面,本申请实施例提供了一种视频数据处理装置,所述装置包括:第一获取模块,用于获取待处理视频以及与所述待处理视频对应的目标码率,所述目标码率低于所述待处理视频的初始码率;第一处理模块,用于基于所述目标码率对所述待处理视频进行转码处理;第二获取模块,用于获取与转码处理后的所述待处理视频对应的质量指标值;第二处理模块,用于若所述质量指标值与质量阈值的差值大于第一阈值,对所述目标码率进行调整,并基于调整后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。In a second aspect, an embodiment of the present application provides a video data processing apparatus, the apparatus includes: a first acquisition module, configured to acquire a video to be processed and a target bit rate corresponding to the video to be processed, the target code The rate is lower than the initial bit rate of the video to be processed; the first processing module is used to transcode the video to be processed based on the target bit rate; the second acquisition module is used to acquire and transcode after processing The quality index value corresponding to the video to be processed; the second processing module is used to adjust the target bit rate if the difference between the quality index value and the quality threshold is greater than the first threshold, and based on the adjusted The target bit rate performs the transcoding process on the video to be processed until the difference is less than or equal to the first threshold.
第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行上述第一方面提供的视频数据处理方法。In a third aspect, embodiments of the present application provide an electronic device, comprising: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and Configured to be executed by the one or more processors, the one or more application programs are configured to execute the video data processing method provided by the first aspect.
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的视频数据处理方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be invoked by a processor to execute the video provided in the first aspect above data processing method.
本申请提供的一种视频数据处理方法、装置、电子设备以及存储介质,通过获取待处理视频以及与待处理视频对应的目标码率,继而基于目标码率对待处理视频进行转码处理,再获取与转码处理后的待处理视频对应的质量指标值,然后若质量指标值与质量阈值的差值大于第一阈值,对目标码率进行调整,并基于调整后的目标码率对待处理视频进行所述转码处理,直至差值小于或等于第一阈值。从而通过上述方式实现了基于相较于待处理视频的初始码率更低的目标码率对待处理视频进行转码处理,并且在转码处理后的待处理视频对应的质量指标值与质量阈值的差值大于第一阈值时,再对目标码率进行调整,并基于调整后的目标码率再次对待处理视频进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保待处理视频的视频质量的前提下对其目标码率进行调整,进而实现节约码率,节约网络带宽。A video data processing method, device, electronic device and storage medium provided by the present application, by acquiring the video to be processed and the target bit rate corresponding to the video to be processed, and then performing transcoding processing on the video to be processed based on the target bit rate, and then acquiring The quality index value corresponding to the video to be processed after the transcoding process, and then if the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate, and based on the adjusted target bit rate The video to be processed is processed. The transcoding process is performed until the difference is less than or equal to the first threshold. Thus, the above-mentioned method realizes that the video to be processed is transcoded based on a target bit rate lower than the initial bit rate of the video to be processed, and the quality index value corresponding to the video to be processed after the transcoding process is different from the quality threshold value. When the difference is greater than the first threshold, the target code rate is adjusted again, and the video to be processed is transcoded again based on the adjusted target code rate until the difference is less than or equal to the first threshold, so that it can be The target bit rate of the video is adjusted on the premise of the video quality, so as to save the bit rate and network bandwidth.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1示出了本申请实施例提供的应用环境示意图。FIG. 1 shows a schematic diagram of an application environment provided by an embodiment of the present application.
图2示出了本申请一实施例提供的一种视频数据处理方法的流程图。FIG. 2 shows a flowchart of a video data processing method provided by an embodiment of the present application.
图3示出了本申请另一实施例提供的一种视频数据处理方法的流程图。FIG. 3 shows a flowchart of a video data processing method provided by another embodiment of the present application.
图4示出了本实施例提供的对待转码视频进行切分的切分方式示意图。FIG. 4 shows a schematic diagram of a splitting manner for splitting a video to be transcoded according to this embodiment.
图5示出了本申请实施例提供的一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。FIG. 5 shows a flowchart of a method corresponding to a manner of determining a quality threshold corresponding to a plurality of video clips according to an embodiment of the present application.
图6示出了本申请实施例提供的根据多个视频片段各自对应的内容复杂度确定与多个视频片段分别对应的质量阈值的确定方式示意图。FIG. 6 shows a schematic diagram of a manner for determining a quality threshold corresponding to a plurality of video clips according to the content complexity corresponding to each of the plurality of video clips according to an embodiment of the present application.
图7示出了本申请实施例提供的另一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。FIG. 7 shows a flow chart of a method corresponding to another manner of determining quality thresholds corresponding to multiple video clips according to an embodiment of the present application.
图8示出了本申请实施例提供的根据多个视频片段各自对应的片段位置确定与多个视频片段分别对应的质量阈值的确定方式示意图。FIG. 8 shows a schematic diagram of a manner for determining a quality threshold corresponding to a plurality of video clips according to respective clip positions corresponding to the plurality of video clips according to an embodiment of the present application.
图9示出了本申请实施例提供的又一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。FIG. 9 shows a flowchart of a method corresponding to yet another manner of determining quality thresholds corresponding to multiple video clips according to an embodiment of the present application.
图10示出了本申请又一实施例提供的一种视频数据处理方法的流程图。FIG. 10 shows a flowchart of a video data processing method provided by another embodiment of the present application.
图11示出了本申请再一实施例提供的一种视频数据处理方法的流程图。FIG. 11 shows a flowchart of a video data processing method provided by still another embodiment of the present application.
图12示出了本申请实施例提供的一种视频数据处理装置的结构框图。FIG. 12 shows a structural block diagram of a video data processing apparatus provided by an embodiment of the present application.
图13示出了本申请实施例提供的一种电子设备的结构框图。FIG. 13 shows a structural block diagram of an electronic device provided by an embodiment of the present application.
图14示出了本申请实施例的用于保存或者携带实现根据本申请实施例的视频数据处理方法的程序代码的存储单元。FIG. 14 shows a storage unit for storing or carrying a program code for implementing the video data processing method according to the embodiment of the present application according to the embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
随着人们生活水平的提高,智能终端在日常生活使用中的普及率已近乎全民覆盖,使得短视频或网络直播等视频业务的观看用户数量以及观看频率均呈现出极高的增长趋势,与此同时,用户对所观看视频的质量需求也越来越高。With the improvement of people's living standards, the penetration rate of smart terminals in daily use has almost reached universal coverage, resulting in an extremely high growth trend in the number and frequency of viewing users of video services such as short videos or webcasts. At the same time, users have higher and higher demands on the quality of the videos they watch.
作为一种提升视频质量的方式,可以通过对视频数据进行转码来提高视频质量,具体的,可以通过优化转码模型,借助优化后的转码模型来实现提升视频质量。然而,训练转码模型需要大量的数据源,且不同的训练模型,对不同规模的数据或是不同类型的数据的训练速度以及准确度都各不相同,单纯依靠优化转码模型来提升视频质量,不一定能获得最优的转码结果;并且为了确保转码效率,需要按照统一的转码格式对视频数据进行转码,而随着视频数据的增多,将加大服务器对视频数据的存储成本,在这种方式下,对于一些视频内容较为单一的视频数据,若仍按照统一的转码格式对其进行转码,将可能会导致码率的浪费,进而造成网络带宽资源的浪费。As a way to improve the video quality, the video quality can be improved by transcoding the video data. Specifically, the video quality can be improved by optimizing the transcoding model and using the optimized transcoding model. However, training the transcoding model requires a large amount of data sources, and different training models have different training speeds and accuracy for different scales of data or different types of data. Simply relying on optimizing the transcoding model can improve video quality. , the optimal transcoding result may not be obtained; and in order to ensure the transcoding efficiency, the video data needs to be transcoded according to a unified transcoding format, and as the video data increases, the server will increase the storage of the video data. In this way, for some video data with relatively simple video content, if it is still transcoded in a unified transcoding format, it may lead to a waste of bit rate, and thus a waste of network bandwidth resources.
发明人经过长期的研究发现,可以通过获取待处理视频以及与待处理视频对应的目标码率,继而基于目标码率对待处理视频进行转码处理,再获取与转码处理后的待处理视频对应的质量指标值,然后若质量指标值与质量阈值的差值大于第一阈值,对目标码率进行调整,并基于调整后的目标码率对待处理视频进行所述转码处理,直至差值小于或等于第一阈值。从而通过上述方式实现了基于相较于待处理视频的初始码率更低的目标码率对待处理视频进行转码处理,并且在转码处理后的待处理视频对应的质量指标值与质量阈值的差值大于第一阈值时,再对目标码率进行调整,并基于调整后的目标码率再次对待处理视频进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保待处理视频的视频质量的前提下对其目标码率进行调整,进而实现节约码率,节约网络带宽。After long-term research, the inventor found that the video to be processed and the target bit rate corresponding to the video to be processed can be obtained, and then the video to be processed can be transcoded based on the target bit rate, and then the video corresponding to the video to be processed after the transcoding process can be obtained. and then if the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate, and perform the transcoding process on the video to be processed based on the adjusted target bit rate until the difference is less than or equal to the first threshold. Thus, the above-mentioned method realizes that the video to be processed is transcoded based on a target bit rate lower than the initial bit rate of the video to be processed, and the quality index value corresponding to the video to be processed after the transcoding process is different from the quality threshold value. When the difference is greater than the first threshold, the target code rate is adjusted again, and the video to be processed is transcoded again based on the adjusted target code rate until the difference is less than or equal to the first threshold, so that it can be The target bit rate of the video is adjusted on the premise of the video quality, so as to save the bit rate and network bandwidth.
因此,为了改善上述问题,发明人提出了本申请提供的可以在确保待处理视频的视频质量的前提下对其目标码率进行调整,进而实现节约码率,节约网络带宽的视频数据处理方法、装置、电子设备以及存储介质。Therefore, in order to improve the above-mentioned problems, the inventor proposes a video data processing method provided by the present application that can adjust the target bit rate of the video to be processed under the premise of ensuring the video quality of the video to be processed, thereby saving the bit rate and network bandwidth, Apparatus, electronic equipment, and storage medium.
下面先对本申请实施例所涉及的应用环境进行介绍。The application environment involved in the embodiments of the present application is first introduced below.
请参阅图1,为本申请实施例提供的一种视频数据处理方法的应用环境示意图,如图1所示,该应用环境可以理解为本申请实施例提供的一种网络系统10,该网络系统10包括:移动终端11以及服务器12,可选的,移动终端11可以是任何具备通信和存储功能的设备,包括但不限于PC(Personal Computer,个人计算机)、PDA(平板电脑)、智能电视、智能手机、智能可穿戴设备或其他具有网络连接功能的智能通信设备,服务器12可以是一台服务器(网络接入服务器),也可以是由若干台服务器组成的服务器集群(云服务器),或者可以是一个云计算中心(数据库服务器)。Please refer to FIG. 1 , which is a schematic diagram of an application environment of a video data processing method provided by an embodiment of the present application. As shown in FIG. 1 , the application environment can be understood as a
本申请实施例中,用户通过移动终端11所拍摄的视频可以通过网络发送至服务器12进行存储,随着视频数量的增多,服务器12可以对所要存储的视频进行切分处理,得到多个视频分段,再对多个视频分段中的部分视频片段的码率进行调整,或者对多个视频分段中的每一个视频分段的码率进行调整,以实现在保持视频的质量的前提下,尽可能调低其码率,进行实现节约码率,从而实现节约网络带宽资源。In the embodiment of the present application, the video shot by the user through the
需要说明的是,作为一种提升转码效率的方式,本申请实施例在对所要存储的视频进行切分处理时,可以由一些服务器负责切分视频,而由另一些不同的服务器负责对切分后的视频进行转码处理,使得可以并行处理视频分段与视频转码,从而实现提升转码效率。其中,一些服务器以及另一些服务器的具体数量均可以不作限定。It should be noted that, as a way to improve the transcoding efficiency, in the embodiment of the present application, when the video to be stored is segmented, some servers may be responsible for segmenting the video, while other different servers are responsible for segmenting the video. The divided video is transcoded, so that the video segmentation and video transcoding can be processed in parallel, thereby improving the transcoding efficiency. The specific numbers of some servers and other servers may not be limited.
下面将结合附图具体描述本申请的各实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
请参阅图2,示出了本申请一实施例提供的一种视频数据处理方法的流程图,本实施例提供一种视频数据处理方法,可应用于服务器,该方法包括:Please refer to FIG. 2 , which shows a flowchart of a video data processing method provided by an embodiment of the present application. This embodiment provides a video data processing method, which can be applied to a server. The method includes:
步骤S110:获取待处理视频以及与所述待处理视频对应的目标码率。Step S110: Obtain the video to be processed and a target bit rate corresponding to the video to be processed.
本实施例中,待处理视频可以为文件大小大于或者等于目标阈值的待存储视频。例如,待处理视频可以为文件大小大于等于10M的视频,其中,目标阈值的具体数值可以不做限定,除了为该10M外,还可以为其他数值,例如,20M或者30M等。In this embodiment, the video to be processed may be a video to be stored whose file size is greater than or equal to the target threshold. For example, the video to be processed may be a video with a file size greater than or equal to 10M, wherein the specific value of the target threshold may not be limited. In addition to the 10M, other values, such as 20M or 30M, may also be used.
作为一种减小待处理视频所占用存储空间的方式,可以获取与待处理视频对应的目标码率,进而可以基于该目标码率对待处理视频进行转码处理,以实现节约码率。As a way to reduce the storage space occupied by the video to be processed, a target bit rate corresponding to the video to be processed can be obtained, and then the video to be processed can be transcoded based on the target bit rate to save the bit rate.
本实施例中,可以设定与待处理视频对应的目标码率低于待处理视频的初始码率,例如,假设待处理视频的初始码率为2048kbps,目标码率则可以设定为1024kbps(此处仅作为示例,具体数值可以不作限定)。In this embodiment, the target bit rate corresponding to the video to be processed can be set lower than the initial bit rate of the video to be processed. For example, if the initial bit rate of the video to be processed is 2048kbps, the target bit rate can be set to 1024kbps ( This is only an example, and the specific value may not be limited).
可选的,为了尽可能的维持待处理视频的质量,在设定目标码率时,作为一种实现方式,可以先确定待处理视频是否属于重要等级的视频文件,其中,可以根据视频文件的命名区分待处理视频是否属于重要等级。可选的,属于重要等级的视频文件可以携带特殊标识,例如,该特殊标识可以为“imp”。Optionally, in order to maintain the quality of the video to be processed as much as possible, when setting the target bit rate, as an implementation method, it may be determined whether the video to be processed belongs to a video file of an important level. The naming distinguishes whether the video to be processed belongs to the importance level. Optionally, a video file belonging to an important level may carry a special identifier, for example, the special identifier may be "imp".
在一种实施方式中,若待处理视频为属于重要等级的视频文件,可以设定目标码率与初始码率的差值的最大值不大于第三阈值,使得目标码率在低于初始码率的基础上,可以尽可能的趋近于初始码率,从而实现最大程度上的保真视频质量。在另一种实施方式中,若待处理视频为不属于重要等级的视频文件,可以设定目标码率与初始码率的差值的最大值不大于第四阈值,使得尽可能的降低待处理视频的码率,从而实现尽可能的减小对待处理视频的存储空间,进而节约在传输待处理视频过程的网络带宽资源。其中,第四阈值大于第三阈值,且第四阈值与第三阈值的具体数值可以不作限定。需要说明的是,通过上述两种方式设定的目标码率均低于初始码率。In one embodiment, if the video to be processed is a video file belonging to an important level, the maximum value of the difference between the target bit rate and the initial bit rate can be set to be no greater than a third threshold, so that the target bit rate is lower than the initial bit rate. On the basis of the rate, it can be as close to the initial bit rate as possible, so as to achieve the highest fidelity video quality. In another embodiment, if the video to be processed is a video file that does not belong to the important level, the maximum value of the difference between the target bit rate and the initial bit rate can be set to be no greater than the fourth threshold, so that the to-be-processed video file can be reduced as much as possible. The bit rate of the video can be reduced as much as possible to reduce the storage space of the video to be processed, thereby saving network bandwidth resources in the process of transmitting the video to be processed. The fourth threshold is greater than the third threshold, and the specific values of the fourth threshold and the third threshold may not be limited. It should be noted that the target code rate set by the above two methods is lower than the initial code rate.
例如,在一个具体的应用场景中,假设初始码率为2048kbps,第三阈值为200kbps,第四阈值为500kbps,那么若待处理视频为属于重要等级的视频文件,那么目标码率可以设定为1900kbps;若待处理视频为不属于重要等级的视频文件,那么目标码率可以设定为1600kbps。需要说明的是,以上数值仅作为示例进行说明,不构成对本方案的限定,实际实现时可根据技术需求进行设定。For example, in a specific application scenario, assuming that the initial bit rate is 2048kbps, the third threshold is 200kbps, and the fourth threshold is 500kbps, if the video to be processed is a video file belonging to an important level, then the target bit rate can be set to 1900kbps; if the video to be processed is a video file that does not belong to the important level, the target bit rate can be set to 1600kbps. It should be noted that the above numerical values are only described as examples, and do not constitute a limitation to this solution, and can be set according to technical requirements during actual implementation.
步骤S120:基于所述目标码率对所述待处理视频进行转码处理。Step S120: Transcode the to-be-processed video based on the target bit rate.
可选的,在获取了目标码率之后,还可以获取与待处理视频对应的转码参数,以便于可以基于目标码率以及转码参数对待处理视频进行转码处理,以使得转码后的待处理视频的码率为目标码率。例如,假设待处理视频对应的初始码率为2048kbps,待处理视频对应的目标码率为1024kbps,那么转码后的待处理视频的码率为1024kbps。其中,转码参数可以包括待处理视频的图像宽高、转码类型以及转码帧率等参数。Optionally, after obtaining the target bit rate, you can also obtain transcoding parameters corresponding to the video to be processed, so that the video to be processed can be transcoded based on the target bit rate and the transcoding parameters, so that the transcoded video can be transcoded. The bitrate of the video to be processed is the target bitrate. For example, assuming that the initial bit rate corresponding to the video to be processed is 2048kbps, and the target bit rate corresponding to the video to be processed is 1024kbps, then the bit rate of the transcoded video to be processed is 1024kbps. The transcoding parameters may include parameters such as the image width and height of the video to be processed, the transcoding type, and the transcoding frame rate.
步骤S130:获取与转码处理后的所述待处理视频对应的质量指标值。Step S130: Obtain a quality index value corresponding to the video to be processed after the transcoding process.
作为一种方式,可以将转码后的待处理视频与转码前的待处理视频进行比较,以获取与转码处理后的待处理视频对应的质量指标值(即VMAF值)。其中,VMAF(VideoMultimethod Assessment Fusion,视频质量多方法评估融合)是一种将人类视觉模型与机器学习相结合的视频质量评价指标,可使用VMAF指标来比较各种转码技术的质量和效率。可选的,在计算的过程中,可以通过比较转码后的待处理视频图像与转码前的待处理视频图像的每个像素点的值等方式计算质量指标值。As a method, the transcoded video to be processed may be compared with the video to be processed before transcoding to obtain a quality index value (ie a VMAF value) corresponding to the transcoded video to be processed. Among them, VMAF (Video Multimethod Assessment Fusion, video quality multi-method assessment fusion) is a video quality evaluation index that combines human vision model and machine learning. The VMAF index can be used to compare the quality and efficiency of various transcoding technologies. Optionally, in the calculation process, the quality index value may be calculated by comparing the value of each pixel of the video image to be processed after transcoding and the video image to be processed before transcoding.
步骤S140:若所述质量指标值与质量阈值的差值大于第一阈值,对所述目标码率进行调整,并基于调整后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。Step S140: if the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate, and perform the transcoding process on the video to be processed based on the adjusted target bit rate, until the difference is less than or equal to the first threshold.
其中,质量阈值(本实施例中可以为VMAF质量阈值)可以预先设定。可选的,可以根据待处理视频的初始码率设定质量阈值,初始码率较高的待处理视频对应的质量阈值可以大于初始码率较低的待处理视频对应的质量阈值。本实施例中,质量阈值所对应的视频画面质量接近于待处理视频的画面质量。Wherein, the quality threshold (may be the VMAF quality threshold in this embodiment) may be preset. Optionally, the quality threshold may be set according to the initial bit rate of the video to be processed, and the quality threshold corresponding to the video to be processed with a higher initial bit rate may be greater than the quality threshold corresponding to the video to be processed with a lower initial bit rate. In this embodiment, the video picture quality corresponding to the quality threshold is close to the picture quality of the video to be processed.
作为一种方式,在获取了与转码处理后的待处理视频对应的质量指标值的情况下,可以获取质量指标值与质量阈值的差值,继而判断该差值是否小于或等于第一阈值,以便于可以根据判断结果灵活的对目标码率进行调整。可选的,第一阈值可以理解为一个门槛值。其中,在一些实施方式中,第一阈值可以为0,在该种情况下,若质量指标值与质量阈值不相等,则需要对目标码率进行调整。在另一些实施方式中,第一阈值可以为较小的范围,例如,可以为0~5(具体数值可以根据实际需求进行调整)等。As a method, when the quality index value corresponding to the video to be processed after the transcoding process is obtained, the difference between the quality index value and the quality threshold value can be obtained, and then it is determined whether the difference value is less than or equal to the first threshold value , so that the target bit rate can be flexibly adjusted according to the judgment result. Optionally, the first threshold may be understood as a threshold. Wherein, in some embodiments, the first threshold may be 0. In this case, if the quality index value is not equal to the quality threshold, the target bit rate needs to be adjusted. In other embodiments, the first threshold value may be in a relatively small range, for example, may be 0 to 5 (the specific value may be adjusted according to actual needs) and the like.
作为一种实施方式,若质量指标值与质量阈值的差值大于第一阈值,且质量指标值大于质量阈值时,则该种情况下的待处理视频的画面质量相对于质量阈值所对应的画面质量更加接近于待处理视频的画面质量,而当前的待处理视频(即前述的转码后的视频)的码率为目标码率,为了降低待处理视频对存储空间的占用,可以降低目标码率,进而实现降低待处理视频的文件大小,从而可以实现节约网络传输带宽。其中,关于目标码率的降低幅度可以根据实际需要进行设定,在此不作限定。在这种方式下,为了实现在保证待处理视频的视频质量的情况下尽可能的减小视频文件的大小,可以继续基于降低后的目标码率再次对待处理视频进行前述的转码处理过程,直至质量指标值与质量阈值的差值小于或等于第一阈值。As an embodiment, if the difference between the quality index value and the quality threshold value is greater than the first threshold, and the quality index value is greater than the quality threshold value, the picture quality of the video to be processed in this case is relative to the picture corresponding to the quality threshold value The quality is closer to the picture quality of the video to be processed, and the code rate of the current video to be processed (that is, the aforementioned transcoded video) is the target code rate. In order to reduce the occupation of the storage space of the video to be processed, the target code can be reduced. rate, thereby reducing the file size of the video to be processed, thereby saving network transmission bandwidth. Wherein, the reduction range of the target code rate can be set according to actual needs, which is not limited here. In this way, in order to reduce the size of the video file as much as possible while ensuring the video quality of the video to be processed, the above-mentioned transcoding process can be performed again on the video to be processed based on the reduced target bit rate. Until the difference between the quality index value and the quality threshold is less than or equal to the first threshold.
作为另一种实施方式,若质量指标值与质量阈值的差值大于第一阈值,且质量指标值小于质量阈值时,则说明该种情况下的待处理视频的文件大小较小,即该种情况下的待处理视频的画面质量相对于质量阈值所对应的画面质量较弱,可选的,为了确保待处理视频的画面质量,可以增大目标码率,以实现提升(或维持)待处理视频的画面质量。其中,对目标码率进行增大的具体幅度可以不受限制。在这种方式下,为了在确保待处理视频的文件大小尽可能小的情况下提升(或维持)待处理视频的画面质量,可以继续基于增大后的目标码率再次对待处理视频进行前述的转码处理过程,直至质量指标值与质量阈值的差值小于或等于第一阈值。As another implementation, if the difference between the quality index value and the quality threshold value is greater than the first threshold, and the quality index value is less than the quality threshold value, it means that the file size of the video to be processed in this case is small, that is, the file size of the video to be processed is small. In this case, the picture quality of the video to be processed is weaker than the picture quality corresponding to the quality threshold. Optionally, in order to ensure the picture quality of the video to be processed, the target bit rate can be increased to improve (or maintain) the to-be-processed The picture quality of the video. The specific range of increasing the target code rate may not be limited. In this way, in order to improve (or maintain) the picture quality of the to-be-processed video while ensuring the file size of the to-be-processed video is as small as possible, it is possible to continue to perform the aforesaid steps on the to-be-processed video again based on the increased target bit rate. The transcoding process is performed until the difference between the quality index value and the quality threshold is less than or equal to the first threshold.
可选的,通过上述两种实施方式对目标码率进行调整后,与待处理视频对应的质量指标值可以等于前述质量阈值,或者与待处理视频对应的质量指标值可以无限趋近(或逼近)质量阈值,即质量指标值与质量阈值的差值小于或等于第一阈值。Optionally, after the target bit rate is adjusted by the above two implementations, the quality index value corresponding to the video to be processed can be equal to the aforementioned quality threshold, or the quality index value corresponding to the video to be processed can be infinitely approached (or approximated). ) quality threshold, that is, the difference between the quality index value and the quality threshold is less than or equal to the first threshold.
本实施例提供的视频数据处理方法,通过获取待处理视频以及与待处理视频对应的目标码率,继而基于目标码率对待处理视频进行转码处理,再获取与转码处理后的待处理视频对应的质量指标值,然后若质量指标值与质量阈值的差值大于第一阈值,对目标码率进行调整,并基于调整后的目标码率对待处理视频进行所述转码处理,直至差值小于或等于第一阈值。从而通过上述方式实现了基于相较于待处理视频的初始码率更低的目标码率对待处理视频进行转码处理,并且在转码处理后的待处理视频对应的质量指标值与质量阈值的差值大于第一阈值时,再对目标码率进行调整,并基于调整后的目标码率再次对待处理视频进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保待处理视频的视频质量的前提下对其目标码率进行调整,且调整后的待处理视频的文件大小相对于调整前有所减小,实现了节约码率,进而节约网络带宽资源。In the video data processing method provided in this embodiment, the video to be processed and the target bit rate corresponding to the video to be processed are acquired, then the video to be processed is transcoded based on the target bit rate, and then the video to be processed after the transcoding process is acquired and processed Corresponding quality index value, and then if the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate, and perform the transcoding process on the video to be processed based on the adjusted target bit rate, until the difference less than or equal to the first threshold. Thus, the above-mentioned method realizes that the video to be processed is transcoded based on a target bit rate lower than the initial bit rate of the video to be processed, and the quality index value corresponding to the video to be processed after the transcoding process is different from the quality threshold value. When the difference is greater than the first threshold, the target code rate is adjusted again, and the video to be processed is transcoded again based on the adjusted target code rate until the difference is less than or equal to the first threshold, so that it can be The target bit rate of the video is adjusted on the premise of the video quality, and the file size of the video to be processed after adjustment is reduced compared to before the adjustment, which saves the bit rate and thus saves network bandwidth resources.
请参阅图3,示出了本申请另一实施例提供的一种视频数据处理方法的流程图,本实施例提供一种视频数据处理方法,可应用于服务器,该方法包括:Please refer to FIG. 3 , which shows a flowchart of a video data processing method provided by another embodiment of the present application. This embodiment provides a video data processing method, which can be applied to a server. The method includes:
步骤S210:获取待处理视频以及与所述多个视频片段各自对应的目标码率。Step S210: Acquire the video to be processed and the target bit rate corresponding to each of the plurality of video segments.
本实施例中,待处理视频可以包括多个视频片段,该多个视频片段为基于待转码视频切分得到。可选的,服务器可以配置有自动压缩功能,在该自动压缩功能处于开启状态时,可以将需要存储的视频(即接收到存储指令时,对应所要存储的视频)默认为待转码视频。在该种方式下,为了提升对待处理视频的转码效率,可以对待转码视频进行切分。示例性的,服务器可以以GOP(Group of Pictures,画面组)或者GOP的倍数为单位对待转码视频进行切分,得到多个视频片段,将该视频片段作为待处理视频。其中,一个GOP可以是一组连续的画面,一个GOP所包括的画面帧的数量本实施例可以不作限定。In this embodiment, the video to be processed may include multiple video clips, and the multiple video clips are obtained by dividing the video to be transcoded. Optionally, the server may be configured with an automatic compression function. When the automatic compression function is enabled, the video that needs to be stored (that is, corresponding to the video to be stored when a storage instruction is received) may be the video to be transcoded by default. In this manner, in order to improve the transcoding efficiency of the video to be processed, the video to be transcoded may be segmented. Exemplarily, the server may divide the video to be transcoded in units of GOP (Group of Pictures, group of pictures) or a multiple of GOP to obtain multiple video segments, and use the video segments as the video to be processed. One GOP may be a group of continuous pictures, and the number of picture frames included in one GOP may not be limited in this embodiment.
可选的,在实际的切分过程中,对于一段待转码视频,可以有多种切分方式。示例性的,请参阅图4,示出了本实施例提供的对待转码视频进行切分的切分方式示意图。如图4所示,可以以单个GOP为单位对待转码视频进行切分,该种切分方式切分出的每个视频片段所包括的画面帧的数量相同。单个GOP所包括的画面帧的数量可以根据实际需要进行设定,例如,若待转码视频的画面内容较少,可以以包括较少数量画面帧的GOP为单位对待转码视频进行切分,得到如图4所示的“方式一”中的多个视频片段(即图4中的方式一对应的视频片段1、视频片段2、视频片段3、视频片段4、视频片段5、视频片段6、视频片段7、视频片段8)。同理,若待转码视频的画面内容较多,可以以包括较多数量画面帧的GOP为单位对待转码视频进行切分,或以包括较少数量画面帧的GOP的倍数为单位对待转码视频进行切分,得到如图4所示的“方式二”中的多个视频片段(即图4中的方式二对应的视频片段1、视频片段2、视频片段3、视频片段4)。不难看出,图4中所示的“方式二”中的单个视频片段所包括的画面帧数量要多于“方式一”中的单个视频片段所包括的画面帧数量。Optionally, in the actual segmentation process, there may be multiple segmentation methods for a video to be transcoded. Exemplarily, please refer to FIG. 4 , which shows a schematic diagram of a segmentation manner for segmentation of the video to be transcoded provided in this embodiment. As shown in FIG. 4 , the video to be transcoded may be segmented by a single GOP as a unit, and each video segment segmented by this segmentation method includes the same number of picture frames. The number of picture frames included in a single GOP can be set according to actual needs. For example, if the picture content of the video to be transcoded is small, the video to be transcoded can be segmented in units of GOPs including a smaller number of picture frames. Obtain a plurality of video clips in "
可选的,还可以分别以包括较少数量画面帧的GOP为单位和以包括较多数量画面帧的GOP为单位交替对待转码视频进行切分,在这种方式下,切分后可以得到如图4所示的“方式三”中的多个视频片段(图4中的方式三对应的视频片段1、视频片段2、视频片段3、视频片段4、视频片段5、视频片段6)。可选的,可以根据服务器的性能以及核数确定切分方式,例如,支持单核的服务器对应切分方式一,支持双核的服务器对应切分方式二,支持多核的服务器对应切分方式三等,具体切分方式的选择可以根据实际情况进行调整,以上仅作为示例。Optionally, the video to be transcoded can also be divided alternately in units of GOPs that include a smaller number of picture frames and GOPs that include a larger number of picture frames. As shown in FIG. 4 , there are multiple video clips in “
在本实施例的方式下,可以分别设定与多个视频片段各自对应的目标码率,可选的,多个视频片段各自对应的目标码率可以相同,也可以不同。在一些实施方式中,每个视频片段对应的目标码率可以低于该视频片段的初始码率;在另一些实施方式中,每个视频片段对应的目标码率可以低于待处理视频的整体初始码率(可选的,该整体初始码率可以为多个视频片段各自对应的初始码率的平均值)。In the manner of this embodiment, target bit rates corresponding to each of the multiple video clips may be set respectively. Optionally, the target bit rates corresponding to each of the multiple video clips may be the same or different. In some embodiments, the target bit rate corresponding to each video clip may be lower than the initial bit rate of the video clip; in other embodiments, the target bit rate corresponding to each video clip may be lower than the entire video to be processed The initial code rate (optionally, the overall initial code rate may be the average value of the corresponding initial code rates of multiple video segments).
步骤S220:基于各自对应的目标码率对所述多个视频片段分别进行转码处理。Step S220: Perform transcoding processing on the plurality of video segments based on the respective corresponding target bit rates.
作为一种方式,若多个视频片段各自对应的目标码率不同,可以基于多个视频片段各自对应的目标码率对多个视频片段分别进行转码处理,在这种方式下,转码后的各个视频片段各自对应的码率即为其各自对应的目标码率。其中,关于对多个视频片段分别进行转码处理的具体流程可以参照前述实施例中的描述,在此不再赘述。As a method, if the target bit rates corresponding to the multiple video clips are different, the multiple video clips can be transcoded based on the target bit rates corresponding to each of the multiple video clips. The corresponding bit rate of each video clip is its corresponding target bit rate. For the specific flow of transcoding processing for multiple video clips respectively, reference may be made to the descriptions in the foregoing embodiments, which will not be repeated here.
步骤S230:获取与转码处理后的所述多个视频片段分别对应的质量指标值。Step S230: Acquire quality index values corresponding to the plurality of video clips after the transcoding process.
其中,每个视频片段对应的质量指标值可以结合转码后的视频片段与转码前的视频片段计算得到,具体计算原理可以参照前述实施例中的描述,在此不再赘述。The quality index value corresponding to each video clip can be calculated by combining the transcoded video clip and the pre-transcoded video clip, and the specific calculation principle can be referred to the description in the foregoing embodiment, which will not be repeated here.
可选的,目标码率较高的视频片段对应的质量指标值可以较高,而目标码率较低的视频片段对应的质量指标值可以较低,在这种方式下,为了在确保视频质量的前提下尽可能的减少视频文件的存储大小,需要对视频片段对应的目标码率进行调整。作为一种方式,可以设定质量阈值,将质量指标值与质量阈值进行比较,根据比较结果对目标码率进行调整。然而,若采用统一的质量阈值与多个视频片段分别对应的质量指标值进行比较,可能会在将与某个视频片段对应的目标码率进行调高时,误将其他视频片段对应的目标码率也调高,进而造成码率的浪费。Optionally, the quality index value corresponding to the video clip with a higher target bit rate can be higher, and the quality index value corresponding to the video clip with a lower target bit rate can be lower. In this way, in order to ensure the video quality On the premise of reducing the storage size of the video file as much as possible, the target bit rate corresponding to the video clip needs to be adjusted. As a method, a quality threshold may be set, the quality index value and the quality threshold may be compared, and the target bit rate may be adjusted according to the comparison result. However, if a uniform quality threshold is used to compare the quality index values corresponding to multiple video clips, the target bit rate corresponding to a certain video clip may be incorrectly adjusted when the target bit rate corresponding to a certain video clip is increased. The rate is also increased, resulting in a waste of code rate.
作为一种改善上述问题的方式,可以基于多个视频片段各自对应的质量特征确定各自对应的质量阈值,即若多个视频片段对应的质量特征不同,则多个视频片段各自对应的质量阈值可以不同,具体描述如下。As a way to improve the above problem, the quality thresholds corresponding to the multiple video clips can be determined based on the quality characteristics corresponding to each of them. That is, if the quality characteristics corresponding to the multiple video clips are different, the quality thresholds corresponding to the multiple video clips can be Different, the specific description is as follows.
作为一种实施方式,请参阅图5,示出了本申请实施例提供的一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。如图5所示,一种确定与多个视频片段分别对应的质量阈值的方式可以包括如下步骤:As an implementation manner, please refer to FIG. 5 , which shows a flowchart of a method corresponding to a manner of determining quality thresholds corresponding to multiple video clips according to an embodiment of the present application. As shown in FIG. 5 , a method for determining quality thresholds corresponding to multiple video clips may include the following steps:
步骤S231:获取各个所述视频片段的内容复杂度。Step S231: Obtain the content complexity of each of the video clips.
本实施方式中,视频片段对应的质量特征可以为视频片段的内容复杂度。内容复杂度用于表征视频片段的画面场景内容变化快慢、画面颜色种类和/或画面颜色的变化多少/变化快慢。例如,视频片段的内容复杂度越高,视频片段内的相邻画面帧之间的画面场景内容变化得越快;视频片段的内容复杂度越低,视频片段内的相邻画面帧之间的画面场景内容变化得越慢。又例如,视频片段的内容复杂度越高,视频片段内的相邻画面帧之间的画面颜色种类变化得越多/越快;视频片段的内容复杂度越低,视频片段内的相邻画面帧之间的画面颜色种类变化得越少/越慢。具体地,可以根据视频片段中相邻画面帧之间的差异程度获取视频片段的内容复杂度。可选的,该差异程度可以基于视频片段中相邻画面帧之间画面内容的相似度得到,或者该差异程度可以基于视频片段中相邻画面帧的像素的运动矢量的变化快慢得到。In this embodiment, the quality feature corresponding to the video clip may be the content complexity of the video clip. The content complexity is used to characterize how fast or slow the content of the picture scene of the video clip changes, the type of picture color, and/or how much or how fast the picture color changes. For example, the higher the content complexity of the video clip, the faster the content of the picture scene between adjacent picture frames in the video clip changes; the lower the content complexity of the video clip, the faster the content between adjacent picture frames in the video clip The screen scene content changes more slowly. For another example, the higher the content complexity of the video clip, the more/faster the picture color types between adjacent picture frames in the video clip change; the lower the content complexity of the video clip, the more adjacent pictures in the video clip change. The less/slower the variety of picture color changes between frames. Specifically, the content complexity of the video clip can be obtained according to the degree of difference between adjacent picture frames in the video clip. Optionally, the difference degree can be obtained based on the similarity of picture contents between adjacent picture frames in the video clip, or the difference degree can be obtained based on the speed of change of the motion vector of the pixels of the adjacent picture frames in the video clip.
其中,作为一种实现方式,可以获取相邻画面帧之间画面内容的相似度,根据相似度的值的大小确定画面场景内容变化的快慢,得到视频片段的内容复杂度。可选的,相邻画面帧之间画面内容的相似度越小,表征该相邻画面帧之间的画面场景内容变化得越快;相邻画面帧之间画面内容的相似度越大,表征该相邻画面帧之间的画面场景内容变化得越慢。在该种实现方式下,可以对相邻画面帧之间画面内容的相似度进行打分,再用目标分值(具体数值可以不作限定,例如可以为100)减去相似度的分值,得到差异程度的分值。可选的,差异程度的分值越大表征差异程度越大,差异程度的分值越小表征差异程度越小。Wherein, as an implementation manner, the similarity of the picture content between adjacent picture frames can be obtained, and the change speed of the content of the picture scene can be determined according to the value of the similarity, so as to obtain the content complexity of the video clip. Optionally, the smaller the similarity of the picture content between the adjacent picture frames, the faster the change of the picture scene content between the adjacent picture frames; the greater the similarity of the picture content between the adjacent picture frames, the greater the The content of the picture scene between the adjacent picture frames changes more slowly. In this implementation, the similarity of the picture content between adjacent picture frames can be scored, and then the target score (the specific value may not be limited, for example, it can be 100) minus the similarity score to obtain the difference degree score. Optionally, a larger difference degree score indicates a larger difference degree, and a smaller difference degree score indicates a smaller difference degree.
可选的,在获取了相邻画面帧之间画面内容的相似度的情况下,可以获取与视频片段的多个相邻画面帧分别对应的画面内容的相似度的变化幅度,可选的,变化幅度越大,对应的视频片段的画面场景内容变化得越快,变化幅度越小,对应的视频片段的画面场景内容变化得越慢。示例性的,假设视频片段A包括5帧画面帧,分别为画面帧1、画面帧2、画面帧3、画面帧4以及画面帧5,若画面帧1与画面帧2之间画面内容的相似度为8,画面帧2与画面帧3之间画面内容的相似度为15,画面帧3与画面帧4之间画面内容的相似度为23,画面帧4与画面帧5之间画面内容的相似度为40,则可以判定对应的视频片段的画面场景内容变化得较快。而若画面帧1与画面帧2之间画面内容的相似度为8,画面帧2与画面帧3之间画面内容的相似度为9,画面帧3与画面帧4之间画面内容的相似度为11,画面帧4与画面帧5之间画面内容的相似度为15,则可以判定对应的视频片段的画面场景内容变化得较慢。Optionally, in the case where the similarity of the picture content between adjacent picture frames is obtained, the variation range of the similarity of the picture content corresponding to the plurality of adjacent picture frames of the video clip may be obtained. Optionally, The larger the change range is, the faster the screen scene content of the corresponding video clip changes, and the smaller the change range is, the slower the screen scene content of the corresponding video clip changes. Exemplarily, it is assumed that the video clip A includes 5 picture frames, namely
作为另一种实现方式,可以获取相邻画面帧的像素的运动矢量的变化快慢,进而可以根据该运动矢量的变化快慢确定画面场景内容变化的快慢。可选的,若相邻画面帧的像素的运动矢量的变化越快,可以判定相邻画面帧之间的差异程度越大,表征该相邻画面帧之间的画面场景内容变化得越快;而若相邻画面帧的像素的运动矢量的变化越慢,可以判定相邻画面帧之间的差异程度越小,表征该相邻画面帧之间的画面场景内容变化得越慢。As another implementation manner, the change speed of the motion vector of the pixels of adjacent picture frames can be obtained, and then the change speed of the picture scene content can be determined according to the change speed of the motion vector. Optionally, if the change of the motion vector of the pixels of the adjacent picture frames is faster, it can be determined that the degree of difference between the adjacent picture frames is greater, indicating that the content of the picture scene between the adjacent picture frames changes faster; However, if the change of the motion vector of the pixels of the adjacent picture frames is slower, it can be determined that the degree of difference between the adjacent picture frames is smaller, indicating that the content of the picture scene between the adjacent picture frames changes more slowly.
可选的,或者可以是视频片段内的画面帧的颜色种类越多,对应的视频片段的内容复杂度越高;视频片段内的画面帧的颜色种类越少,对应的视频片段的内容复杂度越低。或者视频片段内的相邻画面帧之间的画面颜色变化得越多,对应的视频片段的内容复杂度越高;视频片段内的相邻画面帧之间的画面颜色变化得越少,对应的视频片段的内容复杂度越低。Optionally, or it may be that the more color types of picture frames in the video clip, the higher the content complexity of the corresponding video clip; the fewer the color types of the picture frames in the video clip, the higher the content complexity of the corresponding video clip. lower. Or the more the picture color changes between adjacent picture frames in the video clip, the higher the content complexity of the corresponding video clip; the less the picture color changes between adjacent picture frames in the video clip, the corresponding The less complex the content of the video clip.
步骤S232:基于各个所述视频片段的内容复杂度,确定与各个所述视频片段分别对应的质量阈值。Step S232: Determine a quality threshold corresponding to each of the video segments based on the content complexity of each of the video segments.
本实施例中,内容复杂度越高的视频片段对应的质量阈值越大。作为一种方式,可以基于多个视频片段中各个视频片段的内容复杂度,确定与各个视频片段分别对应的质量阈值。In this embodiment, a video clip with higher content complexity corresponds to a higher quality threshold. In one way, the quality threshold corresponding to each video clip may be determined based on the content complexity of each video clip in the plurality of video clips.
例如,在一个具体的应用场景中,请参阅图6,示出了本申请实施例提供的根据各个视频片段的内容复杂度,确定与各个视频片段分别对应的质量阈值的确定方式示意图。如图6所示,假设待处理视频包括4个视频片段,分别为如图6所示的视频片段1、视频片段2、视频片段3以及视频片段4,若该4个视频片段对应的内容复杂度的大小关系为:“视频片段3>视频片段2>视频片段1>视频片段4”,那么可以确定视频片段3对应的质量阈值为90,视频片段2对应的质量阈值为85,视频片段1对应的质量阈值为80,视频片段4对应的质量阈值为75。For example, in a specific application scenario, please refer to FIG. 6 , which shows a schematic diagram of a manner for determining a quality threshold corresponding to each video clip according to the content complexity of each video clip provided by an embodiment of the present application. As shown in FIG. 6 , it is assumed that the video to be processed includes 4 video clips, namely
通过根据内容复杂度确定与视频片段对应的质量阈值,可以使得后续当转码后的视频片段的质量指标值与质量阈值的差值小于或等于第一阈值时,可以使得内容较为复杂的视频片段的视频质量维持在较高的水平,提升用户的观看体验,而内容不太复杂的视频片段的视频质量较之内容较为复杂的视频片段的视频质量可以维持在相对较低的水平,从而可以实现减少视频片段的码率,进而实现减少视频片段所占用的存储空间。By determining the quality threshold corresponding to the video clip according to the content complexity, when the difference between the quality index value of the transcoded video clip and the quality threshold is less than or equal to the first threshold, the video clip with more complex content can be The video quality of the video clips with less complex content can be maintained at a relatively high level to improve the user’s viewing experience, while the video quality of video clips with less complex content can be maintained at a relatively lower level than that of video clips with more complex content, which can achieve The bit rate of the video clip is reduced, thereby reducing the storage space occupied by the video clip.
作为另一种实施方式,请参阅图7,示出了本申请实施例提供的另一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。如图7所示,另一种确定与多个视频片段分别对应的质量阈值的方式可以包括如下步骤:As another implementation manner, please refer to FIG. 7 , which shows a flowchart of a method corresponding to another manner of determining quality thresholds corresponding to multiple video clips according to an embodiment of the present application. As shown in FIG. 7 , another manner of determining the quality thresholds corresponding to the multiple video clips may include the following steps:
步骤S233:获取各个所述视频片段在所述待转码视频中的片段位置。Step S233: Obtain the segment positions of each of the video segments in the to-be-transcoded video.
本实施方式中,视频片段对应的质量特征可以为视频片段的片段位置。其中,片段位置可以理解为视频片段在多个视频片段中的相对排布位置,可选的,多个视频片段可以以待处理视频的播放时间为顺序从前往后排布。可以理解的是,每个视频片段包括多帧视频图像,可选的,可以以每个视频片段的第一帧视频图像的时间(例如可以是拍摄时间)确定该视频片段的所在位置(即片段位置),或者可以以每个视频片段的最后一帧视频图像的时间确定该视频片段的所在位置(即片段位置),或者满足相邻两个视频片段各自用于确定视频片段的片段位置的相邻起始帧的间隔相等即可。In this embodiment, the quality feature corresponding to the video clip may be the clip position of the video clip. The segment position may be understood as the relative arrangement position of the video segments among the multiple video segments. Optionally, the multiple video segments may be arranged from front to back in the order of the playback time of the video to be processed. It can be understood that each video clip includes multiple frames of video images. Optionally, the location of the video clip (that is, the clip) may be determined by the time of the first video frame of each video clip (for example, the shooting time). position), or the position of each video clip (ie, the clip position) can be determined by the time of the last video image of the video clip, or the two adjacent video clips can be used to determine the clip position of the video clip. The interval between adjacent start frames may be equal.
步骤S234:基于各个所述视频片段在所述待转码视频中的片段位置,确定与各个所述视频片段分别对应的质量阈值。Step S234: Determine a quality threshold corresponding to each of the video segments based on the segment position of each of the video segments in the to-be-transcoded video.
本实施例中,片段位置越居中的视频片段,对应的质量阈值可以越大。需要说明的是,本实施例中的居中位置为待处理视频的播放时序的中间位置。例如,假设待处理视频的播放时长为12分钟,可以将待处理视频的第4分钟至第8分钟的播放时长对应的视频片段所在的位置作为该待处理视频的居中位置。作为一种方式,可以基于各个视频片段在待转码视频中的片段位置,确定与各个视频片段分别对应的质量阈值。可选的,为了便于快速的确认视频片段的片段位置,可以对多个视频片段进行片段区域划分,以便于可以根据视频片段的所属片段区域所在的位置快速确认视频片段的片段位置。In this embodiment, the more centered the video segment is, the higher the corresponding quality threshold may be. It should be noted that the center position in this embodiment is the middle position of the playback sequence of the video to be processed. For example, assuming that the playback duration of the video to be processed is 12 minutes, the position of the video clip corresponding to the playback duration of the video to be processed from the 4th minute to the 8th minute can be used as the center position of the video to be processed. As a method, the quality threshold corresponding to each video segment may be determined based on the segment position of each video segment in the video to be transcoded. Optionally, in order to quickly confirm the segment positions of the video clips, multiple video clips can be divided into segment regions, so that the segment positions of the video clips can be quickly confirmed according to the location of the segment region to which the video clips belong.
其中,每个片段区域可以包括至少一个视频片段。例如,假设待处理视频包括10个视频片段,分别为视频片段1、视频片段2、视频片段3、视频片段4、视频片段5、视频片段6、视频片段7、视频片段8、视频片段9以及视频片段10,若将该待处理视频的片段区域划分为三个,分别为片段区域1、片段区域2以及片段区域3,那么片段区域1可以包括视频片段1、视频片段2、视频片段3以及视频片段4,片段区域2可以包括视频片段5、视频片段6、视频片段7以及视频片段8,片段区域3可以包括视频片段9以及视频片段10。可选的,上述划分仅作为示例进行说明,实际实现时每个待处理视频所包括的视频片段区域数量以及每个视频片段区域所包括的视频片段数量可以根据实际情况进行设定,在此不作限定。Wherein, each segment area may include at least one video segment. For example, suppose the video to be processed includes 10 video clips, namely
例如,在一个具体的应用场景中,请参阅图8,示出了本申请实施例提供的根据多个视频片段各自对应的片段位置确定与多个视频片段分别对应的质量阈值的确定方式示意图。如图8所示,假设待处理视频包括3个视频片段区域,分别为片段区域13、片段区域14(片段位置相对居中)以及片段区域15,假设片段区域13包括两个视频片段,片段区域14包括若干个视频片段,片段区域15包括两个视频片段。可选的,服务器可以根据待处理视频的视频内容情况划分视频片段区域,例如,对于一些前序或片头曲较长而片尾相对较短的电影,其第一个片段区域所包括的视频片段可以多于其最后一个片段区域所包括的视频片段。For example, in a specific application scenario, please refer to FIG. 8 , which shows a schematic diagram of a manner for determining quality thresholds corresponding to multiple video clips according to respective clip positions of multiple video clips according to an embodiment of the present application. As shown in FIG. 8 , it is assumed that the video to be processed includes three video segment areas, namely
可选的,可以设定片段位置相对居中的视频片段对应的质量阈值高于其他视频片段(即片段位置相对于不居中的视频片段)对应的质量阈值。如图8所示,片段区域14所包括的视频片段对应的质量阈值,均大于片段区域13以及片段区域15分别所包括的视频片段对应的质量阈值。可选的,属于居中片段区域的不同视频片段对应的质量阈值可以相同,也可以不同,例如,图8所示的片段区域14中,最右侧的两个视频片段各自对应的质量阈值均为90(即相同),而最左侧的两个视频片段各自对应的质量阈值分别为85与90(即不相同)。同理,属于非居中片段区域的不同视频片段对应的质量阈值可以相同,也可以不同,例如,图8所示的片段区域13中的两个视频片段各自对应的质量阈值均为80(即相同),而片段区域15中的两个视频片段各自对应的质量阈值分别为80与75(即不相同)。Optionally, a quality threshold corresponding to a video clip whose clip position is relatively centered may be set higher than the quality threshold corresponding to other video clips (that is, a video clip whose position is relatively non-centered). As shown in FIG. 8 , the quality thresholds corresponding to the video segments included in the
作为又一种实施方式,请参阅图9,示出了本申请实施例提供的又一种确定与多个视频片段分别对应的质量阈值的方式对应的方法流程图。如图9所示,又一种确定与多个视频片段分别对应的质量阈值的方式可以包括如下步骤:As another implementation manner, please refer to FIG. 9 , which shows a flowchart of a method corresponding to another manner of determining quality thresholds corresponding to multiple video clips according to an embodiment of the present application. As shown in FIG. 9 , another method for determining the quality thresholds corresponding to the multiple video clips may include the following steps:
步骤S235:将所述多个视频片段输入机器学习模型。Step S235: Input the multiple video clips into the machine learning model.
为了提升视频转码的准确性,作为一种方式,可以结合深度学习,将多个视频片段输入机器学习模型,可选的,该机器学习模型可以用于预测与视频片段对应的质量阈值,该机器学习模型可以预先用大量的视频片段训练得到。In order to improve the accuracy of video transcoding, as a method, deep learning can be combined to input multiple video clips into a machine learning model. Optionally, the machine learning model can be used to predict the quality threshold corresponding to the video clips. Machine learning models can be pre-trained with a large number of video clips.
步骤S236:获取所述机器学习模型输出的与所述多个视频片段分别对应的质量阈值。Step S236: Obtain the quality thresholds output by the machine learning model and corresponding to the multiple video clips respectively.
在本实施方式下,可以获取机器学习模型输出的与多个视频片段分别对应的质量阈值。通过借助机器学习模型获取与视频分段对应的质量阈值,可以减少服务器的计算压力,进而提升转码效率。同时可以提升视频转码的准确性。In this implementation manner, the quality thresholds output by the machine learning model and corresponding to the multiple video clips can be acquired. By using the machine learning model to obtain the quality threshold corresponding to the video segmentation, the computing pressure on the server can be reduced, thereby improving the transcoding efficiency. At the same time, it can improve the accuracy of video transcoding.
需要说明的是,在确定与多个视频片段分别对应的质量阈值的实际操作过程中,可以结合上述至少两种实施方式共同确认,例如,可以结合机器学习与内容复杂度共同确认与多个视频片段分别对应的质量阈值,也可以结合机器学习与片段位置共同确认与多个视频片段分别对应的质量阈值,或者可以结合内容复杂度与片段位置(二者的判断顺序可以不受限制)共同确认与多个视频片段分别对应的质量阈值,或者还可以结合机器学习、内容复杂度以及片段位置共同确认与多个视频片段分别对应的质量阈值,具体实现过程此处不再赘述,所有包括上述实施方式的质量阈值确定方案均在本申请的保护范围内。It should be noted that, in the actual operation process of determining the quality thresholds corresponding to the multiple video clips, it can be confirmed in combination with at least two of the above-mentioned embodiments. The quality thresholds corresponding to the clips can also be combined with machine learning and clip positions to confirm the quality thresholds corresponding to multiple video clips, or can be combined with content complexity and clip positions (the order of judgment between the two can be unrestricted). The quality thresholds corresponding to multiple video clips, or the quality thresholds corresponding to multiple video clips can also be confirmed in combination with machine learning, content complexity, and clip location. The specific implementation process will not be repeated here, all including the above implementation. The quality threshold determination scheme of the method is all within the protection scope of the present application.
步骤S240:若所述质量指标值与质量阈值的差值大于第一阈值,对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率对所述视频片段进行所述转码处理,直至所述差值小于或等于所述第一阈值。Step S240: If the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate corresponding to the video segment with the difference greater than the first threshold, and adjust the video based on the adjusted target bit rate. The segment undergoes the transcoding process until the difference is less than or equal to the first threshold.
本实施例中,若多个视频片段中,还存在质量指标值与质量阈值的差值大于第一阈值的视频片段,可以对差值大于第一阈值的视频片段对应的目标码率进行调整,并可以基于调整后的目标码率再次对相应的视频片段进行前述转码处理过程,直至其质量指标值与质量阈值的差值小于或等于第一阈值。具体码率调整原理以及转码处理过程可以参照前述实施例中的描述,在此不再赘述。In this embodiment, if there are still video clips in which the difference between the quality index value and the quality threshold value is greater than the first threshold value among the multiple video clips, the target bit rate corresponding to the video clips whose difference value is greater than the first threshold value can be adjusted, And based on the adjusted target bit rate, the foregoing transcoding process may be performed again on the corresponding video segment until the difference between the quality index value and the quality threshold value is less than or equal to the first threshold value. For the specific code rate adjustment principle and the transcoding process, reference may be made to the descriptions in the foregoing embodiments, which will not be repeated here.
本实施例提供的视频数据处理方法,实现了基于相较于待处理视频的各个视频片段的初始码率分别更低的目标码率,对待处理视频的多个视频片段分别进行转码处理,并且在转码处理后的多个视频片段各自对应的质量指标值与相应的质量阈值的差值大于第一阈值时,再对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率再次对相应的视频片段进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保视频片段的视频质量的前提下对其对应的目标码率进行调整,进而实现节约码率,节约网络带宽。同时基于多个视频片段各自对应的内容复杂度、片段位置等质量特征确定其各自对应的质量阈值,提升了质量阈值的可靠性与准确性。The video data processing method provided in this embodiment realizes that, based on a target bit rate that is lower than the initial bit rate of each video clip of the video to be processed, transcoding processing is performed on multiple video clips of the video to be processed respectively, and When the difference between the quality index values corresponding to the multiple video clips after the transcoding process and the corresponding quality threshold is greater than the first threshold, the target bit rate corresponding to the video clips whose difference is greater than the first threshold is adjusted, and Based on the adjusted target bit rate, the corresponding video clip is transcoded again until the difference is less than or equal to the first threshold, so that the corresponding target bit rate of the video clip can be adjusted on the premise of ensuring the video quality of the video clip , so as to save the bit rate and save the network bandwidth. At the same time, the corresponding quality thresholds of multiple video clips are determined based on their respective quality characteristics such as content complexity and clip location, which improves the reliability and accuracy of the quality thresholds.
请参阅图10,示出了本申请又一实施例提供的一种视频数据处理方法的流程图,本实施例提供一种视频数据处理方法,可应用于服务器,该方法包括:Please refer to FIG. 10 , which shows a flowchart of a video data processing method provided by another embodiment of the present application. This embodiment provides a video data processing method, which can be applied to a server. The method includes:
步骤S310:获取待处理视频以及与所述多个视频片段各自对应的目标码率。Step S310: Acquire the video to be processed and the target bit rate corresponding to each of the plurality of video segments.
步骤S320:调用多个线程,基于各自对应的目标码率对所述多个视频片段分别进行转码处理。Step S320: Invoke multiple threads to perform transcoding processing on the multiple video clips based on their corresponding target bit rates.
可选的,为了便于提升转码效率,本实施例可以调用多个线程基于多个视频片段各自对应的目标码率,对多个视频片段分别进行转码处理。其中,该多个线程可以为预先创建好的线程,也可以为实时创建的线程。可选的,服务器可以根据其处理性能或运行性能自动确定调用线程的数量。Optionally, in order to facilitate the improvement of transcoding efficiency, in this embodiment, multiple threads may be invoked to perform transcoding processing on the multiple video segments based on respective target bit rates corresponding to the multiple video segments. The multiple threads may be pre-created threads or threads created in real time. Optionally, the server can automatically determine the number of calling threads according to its processing performance or running performance.
可以理解的是,若服务器的处理性能或运行性能较弱时,其所调用的线程的数量可能小于视频片段的数量,即此种情况下的线程与视频片段可能不会一一对应支持。作为一种实现方式,若多个线程的数量小于视频片段的数量,可以获取多个视频片段中满足指定条件的视频片段作为目标视频片段(可以为多个视频片段);然后先调用多个线程基于目标视频片段中的各个视频片段各自对应的目标码率分别对对应的视频片段进行转码处理;待目标视频片段中的各个视频片段转码完成后,再调用多个线程基于多个视频片段中除目标视频片段以外的其他视频片段各自对应的目标码率,对多个视频片段中除目标视频片段以外的其他视频片段进行转码处理。It can be understood that, if the processing performance or running performance of the server is weak, the number of threads it calls may be less than the number of video clips, that is, the threads and video clips in this case may not be supported in a one-to-one correspondence. As an implementation method, if the number of multiple threads is less than the number of video clips, the video clips that meet the specified conditions among the multiple video clips can be obtained as the target video clips (which can be multiple video clips); then multiple threads are called first. The corresponding video clips are transcoded based on their corresponding target bit rates in the target video clips; after each video clip in the target video clips is transcoded, multiple threads are called based on the multiple video clips. Transcoding is performed on the other video clips except the target video clip in the multiple video clips with the corresponding target bit rates of the other video clips except the target video clip.
其中,指定条件可以包括:视频片段的内容复杂度高于第二阈值(可选的,本实施例中的第二阈值可以理解为复杂度的阈值);或视频片段为待处理视频的居中位置的片段,该居中位置为待处理视频的播放时序的中间位置。可选的,第二阈值的具体数值可以不做限定,例如,第二阈值可以为80、85或90等。The specified conditions may include: the content complexity of the video clip is higher than the second threshold (optionally, the second threshold in this embodiment can be understood as the complexity threshold); or the video clip is the center position of the video to be processed , the center position is the middle position of the playback sequence of the video to be processed. Optionally, the specific value of the second threshold may not be limited, for example, the second threshold may be 80, 85, or 90.
需要说明的是,在转码处理阶段选取目标视频片段时,若指定条件为视频片段的内容复杂度高于第二阈值,在该种情况下,在后续确定与视频片段对应的质量阈值时,作为一种实施方式,可以直接根据视频片段的内容复杂度是否高于第二阈值的判断结果,快速的确定与视频片段对应的质量阈值,例如,若判定视频片段的内容复杂度高于第二阈值,可以设定视频片段对应的质量阈值较大;而若判定视频片段的内容复杂度低于第二阈值,可以设定视频片段对应的质量阈值较小。其中,内容复杂度越高的视频片段对应的质量阈值可以越大。It should be noted that, when the target video clip is selected in the transcoding processing stage, if the specified condition is that the content complexity of the video clip is higher than the second threshold, in this case, when the quality threshold corresponding to the video clip is subsequently determined, As an embodiment, the quality threshold corresponding to the video clip can be quickly determined according to the judgment result of whether the content complexity of the video clip is higher than the second threshold. For example, if it is determined that the content complexity of the video clip is higher than the second threshold If the content complexity of the video clip is determined to be lower than the second threshold, the quality threshold corresponding to the video clip can be set to be smaller. The quality threshold corresponding to the video clip with higher content complexity may be larger.
作为另一种实施方式,也可以在判定视频片段的内容复杂度高于第二阈值时,进一步获取该视频片段的片段位置,若该视频片段的内容复杂度高于第二阈值且该视频片段为待处理视频的居中位置的片段,那么可以设定视频片段对应的质量阈值较大;若该视频片段的内容复杂度高于第二阈值,而该视频片段不为待处理视频的居中位置的片段,那么可以设定视频片段对应的质量阈值相对较小。As another implementation manner, when it is determined that the content complexity of the video clip is higher than the second threshold, the clip position of the video clip may be further obtained, if the content complexity of the video clip is higher than the second threshold and the video clip For the segment in the center of the video to be processed, the quality threshold corresponding to the video segment can be set to be larger; if the content complexity of the video segment is higher than the second threshold, and the video segment is not in the center of the video to be processed. clips, then the quality threshold corresponding to the video clips can be set to be relatively small.
通过在判定视频片段的内容复杂度高于第二阈值时,进一步获取该视频片段是否为待处理视频的居中位置的片段,进而根据获取结果确定与视频片段对应的质量阈值的方式,可以确保待处理视频的核心画面内容可以保持较高的视频播放质量,提升质量阈值设定的准确性,从而可以提升用户的观看体验。When it is determined that the content complexity of the video clip is higher than the second threshold, the method of further obtaining whether the video clip is a clip in the center of the video to be processed, and then determining the quality threshold corresponding to the video clip according to the obtaining result, can ensure that the video clip is to be processed. Processing the core image content of the video can maintain a high video playback quality and improve the accuracy of the quality threshold setting, thereby improving the user's viewing experience.
同理,若指定条件为视频片段为待处理视频的居中位置的片段,在该种情况下,在后续确定与视频片段对应的质量阈值时,作为一种实施方式,可以直接根据视频片段是否为待处理视频的居中位置的片段的判断结果,快速的确定与视频片段对应的质量阈值,例如,若判定视频片段为待处理视频的居中位置的片段,可以设定视频片段对应的质量阈值较大;而若判定视频片段不为待处理视频的居中位置的片段,可以设定视频片段对应的质量阈值较小。Similarly, if the specified condition is that the video segment is the segment in the center of the video to be processed, in this case, when the quality threshold corresponding to the video segment is subsequently determined, as an implementation, it can be directly determined according to whether the video segment is a The judgment result of the segment in the center of the video to be processed can quickly determine the quality threshold corresponding to the video segment. For example, if it is determined that the video segment is the segment in the center of the video to be processed, the quality threshold corresponding to the video segment can be set to be larger. ; and if it is determined that the video clip is not a clip in the center of the video to be processed, the quality threshold corresponding to the video clip can be set to be smaller.
作为另一种实施方式,也可以在判定视频片段为待处理视频的居中位置的片段时,进一步获取该视频片段的内容复杂度,若该视频片段为待处理视频的居中位置的片段且该视频片段的内容复杂度高于第二阈值,那么可以设定视频片段对应的质量阈值较大;若该视频片段为待处理视频的居中位置的片段,而该视频片段的内容复杂度低于第二阈值,那么可以设定视频片段对应的质量阈值相对较小。As another implementation, when it is determined that the video segment is a segment in the center of the video to be processed, the content complexity of the video segment can be further obtained. If the video segment is a segment in the center of the video to be processed and the video If the content complexity of the clip is higher than the second threshold, the quality threshold corresponding to the video clip can be set to be larger; if the video clip is a clip in the center of the video to be processed, and the content complexity of the video clip is lower than the second threshold, then the quality threshold corresponding to the video clip can be set to be relatively small.
通过在判定视频片段为待处理视频的居中位置的片段时,进一步获取该视频片段的内容复杂度,可以确保对处于待处理视频的播放时序的中间位置的内容复杂度较高的视频片段,以较高的码率进行播放,以提升视频播放质量以及用户观看体验,而对处于待处理视频的播放时序的中间位置的内容复杂度相对较低的视频片段,以相对较低的码率进行播放,可以实现节约码率,从而可以减少带宽资源的浪费。By further acquiring the content complexity of the video clip when it is determined that the video clip is the clip in the middle position of the video to be processed, it can be ensured that the video clip with higher content complexity in the middle position of the playback sequence of the video to be processed can be Play at a higher bit rate to improve the video playback quality and user viewing experience, while the video clips with relatively low content complexity in the middle of the playback timing of the video to be processed are played at a relatively low bit rate , the bit rate can be saved, thereby reducing the waste of bandwidth resources.
步骤S330:获取与转码处理后的所述多个视频片段分别对应的质量指标值。Step S330: Obtain quality index values corresponding to the plurality of video clips after the transcoding process.
步骤S340:若所述质量指标值与质量阈值的差值大于第一阈值,对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率对所述视频片段进行所述转码处理,直至所述差值小于或等于所述第一阈值。Step S340: If the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate corresponding to the video segment with the difference greater than the first threshold, and adjust the video based on the adjusted target bit rate. The segment undergoes the transcoding process until the difference is less than or equal to the first threshold.
本实施例提供的视频数据处理方法,实现了基于相较于待处理视频的各个视频片段的初始码率分别更低的目标码率,对待处理视频的多个视频片段分别进行转码处理,并且在转码处理后的多个视频片段各自对应的质量指标值与相应的质量阈值的差值大于第一阈值时,再对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率再次对相应的视频片段进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保视频片段的视频质量的前提下对其对应的目标码率进行调整,进而实现节约码率,节约网络带宽。通过调用多个线程基于多个视频片段各自对应的目标码率,对多个视频片段分别进行转码处理,提升了转码效率。The video data processing method provided in this embodiment realizes that, based on a target bit rate that is lower than the initial bit rate of each video clip of the video to be processed, transcoding processing is performed on multiple video clips of the video to be processed respectively, and When the difference between the quality index values corresponding to the multiple video clips after the transcoding process and the corresponding quality threshold is greater than the first threshold, the target bit rate corresponding to the video clips whose difference is greater than the first threshold is adjusted, and Based on the adjusted target bit rate, the corresponding video clip is transcoded again until the difference is less than or equal to the first threshold, so that the corresponding target bit rate of the video clip can be adjusted on the premise of ensuring the video quality of the video clip , so as to save the bit rate and save the network bandwidth. The transcoding efficiency is improved by invoking multiple threads to perform transcoding processing on the multiple video segments based on their respective target bit rates corresponding to the multiple video segments.
请参阅图11,示出了本申请再一实施例提供的一种视频数据处理方法的流程图,本实施例提供一种视频数据处理方法,可应用于服务器,该方法包括:Please refer to FIG. 11 , which shows a flowchart of a video data processing method provided by another embodiment of the present application. This embodiment provides a video data processing method, which can be applied to a server. The method includes:
步骤S410:获取待处理视频以及与所述多个视频片段各自对应的目标码率。Step S410: Acquire the video to be processed and the target bit rate corresponding to each of the plurality of video segments.
步骤S420:基于各自对应的目标码率对所述多个视频片段分别进行转码处理。Step S420: Perform transcoding processing on the plurality of video clips based on their corresponding target bit rates.
步骤S430:获取与转码处理后的所述多个视频片段分别对应的质量指标值。Step S430: Acquire quality index values corresponding to the plurality of video clips after the transcoding process.
步骤S440:若所述质量指标值与质量阈值的差值大于第一阈值,对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率对所述视频片段进行所述转码处理,直至所述差值小于或等于所述第一阈值。Step S440: If the difference between the quality index value and the quality threshold is greater than the first threshold, adjust the target bit rate corresponding to the video clip whose difference is greater than the first threshold, and adjust the video based on the adjusted target bit rate. The segment undergoes the transcoding process until the difference is less than or equal to the first threshold.
步骤S450:判断所述多个视频片段中每个视频片段分别对应的质量指标值与各自对应的质量阈值的差值是否均小于或等于所述第一阈值。Step S450: Determine whether the difference between the quality index value corresponding to each video clip and the corresponding quality threshold value of each of the plurality of video clips is both less than or equal to the first threshold value.
可选的,为了确保转码处理后的待处理视频可以正常播放,可以判断多个视频片段中每个视频片段分别对应的质量指标值与各自对应的质量阈值的差值是否均小于或等于第一阈值,以便于可以根据判断结果确定是否开始进行视频拼接。Optionally, in order to ensure that the video to be processed after the transcoding process can be played normally, it can be determined whether the difference between the quality index value corresponding to each video clip in the multiple video clips and the corresponding quality threshold value is both less than or equal to the first A threshold value, so that whether to start video splicing can be determined according to the judgment result.
可选的,为了便于基于DASH(Dynamic Adaptive Streaming over HTTP,基于HTTP的动态自适应流),HLS(HTTP Live Streaming,动态码率自适应技术)等自适应分辨率协议进行自适应媒体流的内容生成,可以对转码后质量指标值与质量阈值的差值大于第一阈值的视频片段进行存储;以及对转码后质量指标值与质量阈值的差值小于或等于第一阈值的视频片段进行存储,以减少二次开发流程,提升开发效率。Optionally, in order to facilitate the content of adaptive media stream based on adaptive resolution protocols such as DASH (Dynamic Adaptive Streaming over HTTP, HTTP-based dynamic adaptive streaming), HLS (HTTP Live Streaming, dynamic bit rate adaptive technology) Generate, can store the video clip whose difference between the quality index value after transcoding and the quality threshold value is greater than the first threshold value; Storage to reduce the secondary development process and improve development efficiency.
可选的,在某些实施方式中,本实施例中的质量阈值也可以为基于其他视频质量评价标准确定得到的阈值。其中,其他视频质量评价标准可以包括PSNR(Peak Signal toNoise Ratio,峰值信噪比)方法,以及SSIM(Structural SIMilarity,结构相似性)方法等。或者可以结合使用VMAF、PSNR以及SSIM中的至少两种方法共同确认与视频片段对应的质量阈值。例如,在以VMAF方法确定视频片段对应的质量阈值时,可以同时计算视频片段的PSNR值和/或SSIM值,再根据计算结果确定与视频片段对应的质量阈值。Optionally, in some implementation manners, the quality threshold in this embodiment may also be a threshold determined based on other video quality evaluation standards. Wherein, other video quality evaluation criteria may include a PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio) method, an SSIM (Structural SIMilarity, structural similarity) method, and the like. Alternatively, at least two methods among VMAF, PSNR and SSIM may be used in combination to jointly confirm the quality threshold corresponding to the video segment. For example, when the quality threshold corresponding to the video clip is determined by the VMAF method, the PSNR value and/or the SSIM value of the video clip can be calculated at the same time, and then the quality threshold corresponding to the video clip can be determined according to the calculation result.
步骤S460:对所述多个视频片段进行拼接,得到目标视频。Step S460: Splicing the multiple video clips to obtain a target video.
作为一种方式,若多个视频片段中每个视频片段分别对应的质量指标值与各自对应的质量阈值的差值均小于或等于第一阈值,可以开始对多个视频片段进行拼接,得到目标视频。本实施例中,目标视频的码率低于待处理视频的初始码率。在用户视觉上,目标视频的视频质量与待处理视频的视频质量相当。As a method, if the difference between the quality index value corresponding to each of the multiple video clips and the corresponding quality threshold is less than or equal to the first threshold, the multiple video clips can be spliced to obtain the target video. In this embodiment, the bit rate of the target video is lower than the initial bit rate of the video to be processed. Visually, the video quality of the target video is comparable to that of the video to be processed.
作为另一种方式,若多个视频片段中存在质量指标值与对应的质量阈值的差值大于第一阈值的视频片段,可以继续等待所有视频片段的质量指标值与对应的质量阈值的差值均小于或等于第一阈值时,再开始拼接。As another way, if there are video clips in which the difference between the quality index value and the corresponding quality threshold value is greater than the first threshold in the multiple video clips, you can continue to wait for the difference between the quality index value of all the video clips and the corresponding quality threshold value. When both are less than or equal to the first threshold, start splicing.
可选的,本实施例中,若转码后的视频片段对应的质量指标值与其对应的质量阈值的差值小于或等于第一阈值,可以结束对应的线程,或者指示该对应的线程开始对其他差值未小于或等于第一阈值的视频片段进行转码。Optionally, in this embodiment, if the difference between the quality index value corresponding to the transcoded video clip and the corresponding quality threshold value is less than or equal to the first threshold value, the corresponding thread may be terminated, or the corresponding thread may be instructed to start pairing Other video segments whose difference is not less than or equal to the first threshold are transcoded.
可选的,在一些实施方式中,若多次转码处理之后,视频片段对应的质量指标值与其对应的质量阈值的差值均大于第一阈值,可以对与视频片段对应的质量阈值进行调整,具体调整数值可以根据实际情况进行选择,在此不一一例举。Optionally, in some embodiments, if the difference between the quality index value corresponding to the video clip and the quality threshold value corresponding to the video clip is greater than the first threshold after multiple transcoding processing, the quality threshold value corresponding to the video clip can be adjusted. , and the specific adjustment value can be selected according to the actual situation, which is not listed here.
本实施例提供的视频数据处理方法,实现了基于相较于待处理视频的各个视频片段的初始码率分别更低的目标码率,对待处理视频的多个视频片段分别进行转码处理,并且在转码处理后的多个视频片段各自对应的质量指标值与相应的质量阈值的差值大于第一阈值时,再对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率再次对相应的视频片段进行转码处理,直至其差值小于或等于第一阈值,使得可以在确保视频片段的视频质量的前提下对其对应的目标码率进行调整,进而实现节约码率,节约网络带宽。通过对质量指标值与质量阈值的差值小于或等于第一阈值的多个视频片段进行拼接,可以实现降低待处理视频的整体存储空间,进而降低存储成本。The video data processing method provided in this embodiment realizes that, based on a target bit rate that is lower than the initial bit rate of each video clip of the video to be processed, transcoding processing is performed on multiple video clips of the video to be processed respectively, and When the difference between the quality index values corresponding to the multiple video clips after the transcoding process and the corresponding quality threshold is greater than the first threshold, the target bit rate corresponding to the video clips whose difference is greater than the first threshold is adjusted, and Based on the adjusted target bit rate, the corresponding video clip is transcoded again until the difference is less than or equal to the first threshold, so that the corresponding target bit rate of the video clip can be adjusted on the premise of ensuring the video quality of the video clip , so as to save the bit rate and save the network bandwidth. By splicing multiple video segments whose difference between the quality index value and the quality threshold is less than or equal to the first threshold, it is possible to reduce the overall storage space of the video to be processed, thereby reducing the storage cost.
请参阅图12,为本申请实施例提供的一种视频数据处理装置的结构框图,本实施例提供一种视频数据处理装置500,可以运行于服务器,所述装置500包括:第一获取模块510、第一处理模块520、第二获取模块530以及第二处理模块540:Please refer to FIG. 12 , which is a structural block diagram of a video data processing apparatus provided by an embodiment of the present application. This embodiment provides a video data processing apparatus 500 that can run on a server. The apparatus 500 includes: a
第一获取模块510,用于获取待处理视频以及与所述待处理视频对应的目标码率,所述目标码率低于所述待处理视频的初始码率。The first acquiring
第一处理模块520,用于基于所述目标码率对所述待处理视频进行转码处理。The
第二获取模块530,用于获取与转码处理后的所述待处理视频对应的质量指标值。The second obtaining
第二处理模块540,用于若所述质量指标值与质量阈值的差值大于第一阈值,对所述目标码率进行调整,并基于调整后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。The
在一种实施方式中,第二处理模块540可以用于若所述差值大于第一阈值,且所述质量指标值大于所述质量阈值,降低所述码率。在这种方式下,可以基于降低后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。In one embodiment, the
在另一种实施方式中,第二处理模块540可以用于若所述差值大于第一阈值,且所述质量指标值小于所述质量阈值,增大所述码率。在这种方式下,可以基于增大后的目标码率对所述待处理视频进行所述转码处理,直至所述差值小于或等于所述第一阈值。In another implementation manner, the
可选的,装置500还可以包括视频分段模块,该视频分段模块可以用于对待转码视频进行切分,以得到包括多个视频片段的待处理视频。在该种情况下,第一获取模块510可以用于获取与所述多个视频片段各自对应的目标码率;第一处理模块520可以用于基于各自对应的目标码率对所述多个视频片段分别进行转码处理;第二获取模块530可以用于获取与转码处理后的所述多个视频片段分别对应的质量指标值;第二处理模块540可以用于若所述质量指标值与质量阈值的差值大于第一阈值,对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率对所述视频片段进行所述转码处理,直至所述差值小于或等于所述第一阈值。Optionally, the apparatus 500 may further include a video segmentation module, and the video segmentation module may be configured to segment the to-be-transcoded video to obtain the to-be-processed video including multiple video segments. In this case, the first obtaining
可选的,装置500还可以包括阈值设定模块,在待处理视频包括多个视频片段的情况下,若所述质量指标值与质量阈值的差值大于第一阈值,在对所述目标码率进行调整之前,作为一种实现方式,该阈值设定模块可以用于获取各个所述视频片段的内容复杂度;基于各个所述视频片段的内容复杂度,确定与各个所述视频片段分别对应的质量阈值,其中,所述内容复杂度越高的视频片段对应的质量阈值越大。Optionally, the apparatus 500 may further include a threshold setting module, in the case where the video to be processed includes multiple video clips, if the difference between the quality index value and the quality threshold is greater than the first threshold, the target code Before adjusting the rate, as an implementation manner, the threshold setting module can be used to obtain the content complexity of each of the video clips; based on the content complexity of each of the video clips, determine the corresponding , wherein the video clip with higher content complexity corresponds to a higher quality threshold.
作为另一种实现方式,该阈值设定模块可以用于获取各个所述视频片段在所述待转码视频中的片段位置;基于各个所述视频片段在所述待转码视频中的片段位置,确定与各个所述视频片段分别对应的质量阈值。As another implementation manner, the threshold setting module can be used to obtain the segment position of each of the video segments in the to-be-transcoded video; based on the segment position of each of the video segments in the to-be-transcoded video , and determine the quality threshold corresponding to each of the video segments.
作为又一种实现方式,该阈值设定模块可以用于将所述多个视频片段输入机器学习模型,所述机器学习模型用于预测与视频片段对应的质量阈值;获取所述机器学习模型输出的与所述多个视频片段分别对应的质量阈值。As another implementation manner, the threshold setting module can be used to input the multiple video clips into a machine learning model, and the machine learning model is used to predict the quality threshold corresponding to the video clips; obtain the output of the machine learning model The quality thresholds corresponding to the plurality of video segments respectively.
作为一种实施方式,第一处理模块520可以用于调用多个线程基于各自对应的目标码率对所述多个视频片段分别进行转码处理。其中,若所述多个线程的数量小于所述视频片段的数量,可以获取所述多个视频片段中满足指定条件的视频片段作为目标视频片段;继而调用所述多个线程先基于各自对应的目标码率对所述目标视频片段进行转码处理;再调用所述多个线程基于各自对应的转码参数对所述多个视频片段中除所述目标视频片段以外的视频片段进行转码处理。可选的,本实施例中的指定条件可以包括:视频片段的内容复杂度高于第二阈值;或视频片段为所述待处理视频的居中位置的片段,所述居中位置为所述待处理视频的播放时序的中间位置。As an implementation manner, the
可选的,装置500还可以包括拼接模块,用于在若所述质量指标值与质量阈值的差值大于第一阈值,对差值大于第一阈值的视频片段对应的目标码率进行调整,并基于调整后的目标码率对所述视频片段进行所述转码处理,直至所述差值小于或等于所述第一阈值之后,若所述多个视频片段中每个视频片段分别对应的质量指标值与各自对应的质量阈值的差值均小于或等于所述第一阈值,对所述多个视频片段进行拼接,得到目标视频。可选的,本实施例中目标视频的码率低于待处理视频的初始码率。Optionally, the apparatus 500 may further include a splicing module, configured to adjust the target bit rate corresponding to the video clip whose difference is greater than the first threshold if the difference between the quality index value and the quality threshold is greater than the first threshold, and perform the transcoding process on the video clips based on the adjusted target bit rate until the difference value is less than or equal to the first threshold, if each video clip in the plurality of video clips corresponds to The difference between the quality index value and the corresponding quality threshold is less than or equal to the first threshold, and the target video is obtained by splicing the plurality of video segments. Optionally, in this embodiment, the bit rate of the target video is lower than the initial bit rate of the video to be processed.
可选的,装置500还可以包括存储模块,用于对转码后所述质量指标值与质量阈值的差值大于第一阈值的视频片段进行存储;以及对转码后所述质量指标值与质量阈值的差值小于或等于所述第一阈值的视频片段进行存储。Optionally, the apparatus 500 may further include a storage module for storing the video clips whose difference between the quality index value and the quality threshold value after transcoding is greater than the first threshold; The video segments whose difference between the quality thresholds is less than or equal to the first threshold are stored.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in this application, the coupling between the modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
请参阅图13,基于上述的视频数据处理方法及装置,本申请实施例还提供了一种可以执行前述视频数据处理方法的电子设备100。该电子设备100可以是图1中所述的服务器12。电子设备100包括存储器102以及相互耦合的一个或多个(图中仅示出一个)处理器104,存储器102以及处理器104之间通信线路连接。存储器102中存储有可以执行前述实施例中内容的程序,而处理器104可以执行存储器102中存储的程序。Referring to FIG. 13 , based on the foregoing video data processing method and apparatus, an embodiment of the present application further provides an
其中,处理器104可以包括一个或者多个处理核。处理器104利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器102内的指令、程序、代码集或指令集,以及调用存储在存储器102内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器104可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(ProgrammableLogic Array,PLA)中的至少一种硬件形式来实现。处理器104可集成中央处理器(CentralProcessing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器104中,单独通过一块通信芯片进行实现。The
存储器102可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器102可用于存储指令、程序、代码、代码集或指令集。存储器102可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现前述各个实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The
请参考图14,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质600中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 14 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 600 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
计算机可读存储介质600可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质600包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质600具有执行上述方法中的任何方法步骤的程序代码610的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码610可以例如以适当形式进行压缩。The computer-readable storage medium 600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. Computer readable storage medium 600 has storage space for
综上所述,本申请实施例提供的一种视频数据处理方法、装置、电子设备以及存储介质,通过获取待处理视频以及与待处理视频对应的目标码率,继而基于目标码率对待处理视频进行转码处理,再获取与转码处理后的待处理视频对应的质量指标值,然后若质量指标值与质量阈值的差值大于第一阈值,对目标码率进行调整,并基于调整后的目标码率对待处理视频进行所述转码处理,直至差值小于或等于所述第一阈值。从而通过上述方式实现了基于相较于待处理视频的初始码率更低的目标码率对待处理视频进行转码处理,并且在转码处理后的待处理视频对应的质量指标值与质量阈值的差值大于第一阈值时,再对目标码率进行调整,并基于调整后的目标码率再次对待处理视频进行转码处理,直至其差值小于或等于所述第一阈值,使得可以在确保待处理视频的视频质量的前提下对其目标码率进行调整,进而实现节约码率,节约网络带宽。To sum up, a video data processing method, device, electronic device, and storage medium provided by the embodiments of the present application obtain the video to be processed and the target bit rate corresponding to the video to be processed, and then the video to be processed is based on the target bit rate. Perform transcoding processing, and then obtain the quality index value corresponding to the video to be processed after the transcoding process, and then if the difference between the quality index value and the quality threshold value is greater than the first threshold, adjust the target bit rate, and based on the adjusted The target bit rate is to perform the transcoding process on the video to be processed until the difference is less than or equal to the first threshold. Thus, the above-mentioned method realizes that the video to be processed is transcoded based on a target bit rate lower than the initial bit rate of the video to be processed, and the quality index value corresponding to the video to be processed after the transcoding process is different from the quality threshold value. When the difference is greater than the first threshold, the target bit rate is adjusted again, and based on the adjusted target bit rate, the video to be processed is transcoded again until the difference is less than or equal to the first threshold, so that it can be ensured The target bit rate of the video to be processed is adjusted under the premise of the video quality of the video to be processed, so as to save the bit rate and network bandwidth.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of the present application.
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010997869.3A CN111970565A (en) | 2020-09-21 | 2020-09-21 | Video data processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010997869.3A CN111970565A (en) | 2020-09-21 | 2020-09-21 | Video data processing method and device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111970565A true CN111970565A (en) | 2020-11-20 |
Family
ID=73387489
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010997869.3A Pending CN111970565A (en) | 2020-09-21 | 2020-09-21 | Video data processing method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111970565A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114390290A (en) * | 2022-01-26 | 2022-04-22 | 湖南快乐阳光互动娱乐传媒有限公司 | A video processing method, apparatus, device and storage medium |
| CN114430501A (en) * | 2021-12-28 | 2022-05-03 | 上海网达软件股份有限公司 | Content adaptive encoding method and system for file transcoding |
| CN114973612A (en) * | 2022-03-28 | 2022-08-30 | 深圳市揽讯科技有限公司 | Automatic alarm monitoring system and method for faults of LED display screen |
| CN115002520A (en) * | 2022-04-14 | 2022-09-02 | 百果园技术(新加坡)有限公司 | Video stream data processing method, device, equipment and storage medium |
| CN115361571A (en) * | 2022-08-04 | 2022-11-18 | 武汉依迅北斗时空技术股份有限公司 | Playing method and device for cloud storage video data |
| CN117615222A (en) * | 2023-11-14 | 2024-02-27 | 书行科技(北京)有限公司 | Image processing methods, video publishing methods and related products |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101578875A (en) * | 2007-01-04 | 2009-11-11 | 英国电讯有限公司 | Video signal encoding |
| CN102137258A (en) * | 2011-03-22 | 2011-07-27 | 宁波大学 | Method for controlling three-dimensional video code rates |
| CN105263066A (en) * | 2014-06-13 | 2016-01-20 | 珠海全志科技股份有限公司 | Mobile equipment video stream transmission control method and system |
| US20160212373A1 (en) * | 2015-01-16 | 2016-07-21 | Microsoft Technology Licensing, Llc | Dynamically updating quality to higher chroma sampling rate |
| WO2019037471A1 (en) * | 2017-08-24 | 2019-02-28 | 中兴通讯股份有限公司 | Video processing method, video processing device and terminal |
| CN110225340A (en) * | 2019-05-31 | 2019-09-10 | 北京猿力未来科技有限公司 | A kind of control method and device of Video coding calculate equipment and storage medium |
| CN111107395A (en) * | 2019-12-31 | 2020-05-05 | 广州市百果园网络科技有限公司 | Video transcoding method, device, server and storage medium |
| CN111263243A (en) * | 2020-02-17 | 2020-06-09 | 网易(杭州)网络有限公司 | Video coding method and device, computer readable medium and electronic equipment |
| CN111327950A (en) * | 2020-03-05 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Video transcoding method and device |
-
2020
- 2020-09-21 CN CN202010997869.3A patent/CN111970565A/en active Pending
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101578875A (en) * | 2007-01-04 | 2009-11-11 | 英国电讯有限公司 | Video signal encoding |
| CN102137258A (en) * | 2011-03-22 | 2011-07-27 | 宁波大学 | Method for controlling three-dimensional video code rates |
| CN105263066A (en) * | 2014-06-13 | 2016-01-20 | 珠海全志科技股份有限公司 | Mobile equipment video stream transmission control method and system |
| US20160212373A1 (en) * | 2015-01-16 | 2016-07-21 | Microsoft Technology Licensing, Llc | Dynamically updating quality to higher chroma sampling rate |
| WO2019037471A1 (en) * | 2017-08-24 | 2019-02-28 | 中兴通讯股份有限公司 | Video processing method, video processing device and terminal |
| CN110225340A (en) * | 2019-05-31 | 2019-09-10 | 北京猿力未来科技有限公司 | A kind of control method and device of Video coding calculate equipment and storage medium |
| CN111107395A (en) * | 2019-12-31 | 2020-05-05 | 广州市百果园网络科技有限公司 | Video transcoding method, device, server and storage medium |
| CN111263243A (en) * | 2020-02-17 | 2020-06-09 | 网易(杭州)网络有限公司 | Video coding method and device, computer readable medium and electronic equipment |
| CN111327950A (en) * | 2020-03-05 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Video transcoding method and device |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114430501A (en) * | 2021-12-28 | 2022-05-03 | 上海网达软件股份有限公司 | Content adaptive encoding method and system for file transcoding |
| CN114390290A (en) * | 2022-01-26 | 2022-04-22 | 湖南快乐阳光互动娱乐传媒有限公司 | A video processing method, apparatus, device and storage medium |
| CN114973612A (en) * | 2022-03-28 | 2022-08-30 | 深圳市揽讯科技有限公司 | Automatic alarm monitoring system and method for faults of LED display screen |
| CN115002520A (en) * | 2022-04-14 | 2022-09-02 | 百果园技术(新加坡)有限公司 | Video stream data processing method, device, equipment and storage medium |
| CN115002520B (en) * | 2022-04-14 | 2024-04-02 | 百果园技术(新加坡)有限公司 | Video stream data processing method, device, equipment and storage medium |
| CN115361571A (en) * | 2022-08-04 | 2022-11-18 | 武汉依迅北斗时空技术股份有限公司 | Playing method and device for cloud storage video data |
| CN117615222A (en) * | 2023-11-14 | 2024-02-27 | 书行科技(北京)有限公司 | Image processing methods, video publishing methods and related products |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111970565A (en) | Video data processing method and device, electronic equipment and storage medium | |
| CN111681167B (en) | Image quality adjusting method and device, storage medium and electronic equipment | |
| WO2023134523A1 (en) | Content adaptive video coding method and apparatus, device and storage medium | |
| CN102625147B (en) | Self-adapting display method for mobile video equipment | |
| CN109688465B (en) | Video enhancement control method, device and electronic device | |
| WO2021068598A1 (en) | Encoding method and device for screen sharing, and storage medium and electronic equipment | |
| US12155840B2 (en) | Video processing method, video processing apparatus, smart device, and storage medium | |
| US20220191574A1 (en) | Method for uploading video and client | |
| CN113490055B (en) | Data processing methods and devices | |
| US20230247069A1 (en) | Systems and Methods for Adaptive Video Conferencing | |
| CN115209189B (en) | Video stream transmission method, system, server and storage medium | |
| CN112866746A (en) | Multi-path streaming cloud game control method, device, equipment and storage medium | |
| CN103248682A (en) | Optimization method and device for bandwidth usage | |
| CN114071121B (en) | Image quality evaluation device and image quality evaluation method thereof | |
| WO2020244328A1 (en) | Image processing method and apparatus | |
| CN110740316A (en) | Data coding method and device | |
| CN115706829A (en) | Multi-window video communication method, device and system | |
| CN117221293A (en) | Data transmission method, device, electronic equipment and storage medium | |
| CN110784731A (en) | Data stream transcoding method, device, equipment and medium | |
| CN114007137A (en) | ROI-based video hierarchical coding method, device and medium | |
| CN113194276A (en) | Method, system and storage device for generating dynamic layout in video conference system | |
| WO2025001606A1 (en) | Method for transmitting screen image, and electronic device and computer-readable medium | |
| CN112533029B (en) | Video time-sharing transmission method, camera device, system and storage medium | |
| CN117615175A (en) | Video playback method, device, electronic equipment and computer-readable storage medium | |
| CN115942009A (en) | Method and device for handling remote video services based on hybrid coding |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201120 |
|
| RJ01 | Rejection of invention patent application after publication |