CN112087635A - Image coding control method, device, equipment and computer readable storage medium - Google Patents
Image coding control method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN112087635A CN112087635A CN202010771938.9A CN202010771938A CN112087635A CN 112087635 A CN112087635 A CN 112087635A CN 202010771938 A CN202010771938 A CN 202010771938A CN 112087635 A CN112087635 A CN 112087635A
- Authority
- CN
- China
- Prior art keywords
- network delay
- frame
- preset
- average value
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000001514 detection method Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- 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/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
- H04N19/423—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/28—Flow control; Congestion control in relation to timing considerations
- H04L47/283—Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/32—Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请提供一种图像编码控制方法、装置、设备及计算机可读存储介质,涉及图像处理技术领域,能够解决图像编码时延较长的问题。具体技术方案为:统计预设数量帧图像中每一帧图像的网络时延;根据每一帧图像的网络时延计算预设数量帧图像的网络时延的平均值;判断网络时延的平均值是否大于预设阈值;当网络时延的平均值大于预设阈值时,根据预设规则确定丢帧数M;将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。
The present application provides an image encoding control method, apparatus, device, and computer-readable storage medium, which relate to the technical field of image processing and can solve the problem of long image encoding delay. The specific technical scheme is as follows: count the network delay of each frame of images in a preset number of frame images; calculate the average value of the network delay of the preset number of frame images according to the network delay of each frame of image; determine the average network delay Whether the value is greater than the preset threshold; when the average value of the network delay is greater than the preset threshold, the number M of dropped frames is determined according to the preset rule; the consecutive M frames of images that are not currently encoded are discarded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
Description
技术领域technical field
本申请涉及图像处理领域,尤其涉及图像编码控制方法、装置、设备及计算机可读存储介质。The present application relates to the field of image processing, and in particular, to an image coding control method, apparatus, device, and computer-readable storage medium.
背景技术Background technique
目前,在图形图像的编解码过程中,通常是以固定帧率进行图像采集,对采集完成的图像进行编码后,在缓存中等待传输。在传输过程中,会根据网络时延来判断是否需要对缓存中的编码图像进行丢弃。At present, in the process of encoding and decoding a graphic image, image acquisition is usually performed at a fixed frame rate, and after the acquired image is encoded, it waits for transmission in a buffer. During the transmission process, it will be judged whether the encoded image in the cache needs to be discarded according to the network delay.
对于所有的图像,由于都是在编码完成后再判断是否需要进行丢弃,因此增加了图像编码时延,同时也浪费了CPU(Central Processing Unit,中央处理器)的编码资源。For all images, since it is determined whether or not to discard the images after the encoding is completed, the image encoding delay is increased, and the encoding resources of a CPU (Central Processing Unit, central processing unit) are also wasted.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种图像编码控制方法、装置、设备及计算机可读存储介质,能够解决图像编码时延较长的问题。所述技术方案如下:Embodiments of the present application provide an image encoding control method, apparatus, device, and computer-readable storage medium, which can solve the problem of long image encoding delay. The technical solution is as follows:
根据本申请实施例的第一方面,提供一种图像编码控制方法,该方法包括:According to a first aspect of the embodiments of the present application, an image coding control method is provided, the method comprising:
统计预设数量帧图像中每一帧图像的网络时延;Count the network delay of each frame in the preset number of frames;
根据所述每一帧图像的网络时延计算所述预设数量帧图像的网络时延的平均值;Calculate the average value of the network delay of the preset number of frame images according to the network delay of each frame of image;
判断所述网络时延的平均值是否大于预设阈值;judging whether the average value of the network delay is greater than a preset threshold;
当所述网络时延的平均值大于所述预设阈值时,根据预设规则确定丢帧数M,所述M为整数;When the average value of the network delay is greater than the preset threshold, determine the number of dropped frames M according to a preset rule, where M is an integer;
将当前未开始编码的连续M帧图像丢弃。Discard the consecutive M frames of images that are not currently encoded.
在一个实施例中,所述根据预设规则确定丢帧数M包括:In one embodiment, the determining the number M of dropped frames according to a preset rule includes:
根据所述网络时延的平均值和所述预设阈值之间的差值确定丢帧数M。The number M of dropped frames is determined according to the difference between the average value of the network delay and the preset threshold.
在一个实施例中,所述根据所述网络时延的平均值和所述预设阈值之间的差值确定丢帧数M包括:In one embodiment, the determining the number M of dropped frames according to the difference between the average value of the network delay and the preset threshold includes:
根据第一公式确定丢帧数M,所述第一公式为:M=[(T平均-A)/(t采集+t编码)];The number of dropped frames M is determined according to the first formula, and the first formula is: M=[(T average -A)/(t acquisition +t encoding )];
其中,所述T平均为网络时延的平均值,所述A为预设阈值,所述t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Wherein, the T average is the average value of the network delay, the A is a preset threshold, the t acquisition is the average time required to collect a frame of image, and the t code is the average time required to encode a frame of image.
在一个实施例中,所述根据所述网络时延的平均值和所述预设阈值之间的差值确定丢帧数M包括:In one embodiment, the determining the number M of dropped frames according to the difference between the average value of the network delay and the preset threshold includes:
根据第二公式确定丢帧数M,所述第二公式为:The number of dropped frames M is determined according to the second formula, and the second formula is:
M=[(T平均-A)/(t采集+t编码)]+1;M=[(T average -A)/(t acquisition +t encoding )]+1;
其中,所述T平均为网络时延的平均值,所述A为预设阈值,所述t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Wherein, the T average is the average value of the network delay, the A is a preset threshold, the t acquisition is the average time required to collect a frame of image, and the t code is the average time required to encode a frame of image.
在一个实施例中,该方法还包括:In one embodiment, the method further includes:
检测用于对预设数量进行设置的设置操作;Detecting a set operation for setting a preset number;
根据所述设置操作确定所述预设数量。The preset number is determined according to the setting operation.
本申请实施例提供的图像编码控制方法,在图像传输过程中实时统计预设数量帧图像中每一帧图像的网络时延并计算该预设数量帧图像的网络时延的平均值,当该平均值大于预设阈值时,根据预设规则确定丢帧数M,并将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。In the image coding control method provided by the embodiment of the present application, the network delay of each frame of images in a preset number of frame images is counted in real time during the image transmission process, and the average value of the network delay of the preset number of frame images is calculated. When the average value is greater than the preset threshold, the number M of dropped frames is determined according to the preset rule, and the consecutive M frames of images that are not currently encoded are discarded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
根据本申请实施例的第二方面,提供一种图像编码控制装置,包括:According to a second aspect of the embodiments of the present application, an image coding control device is provided, including:
统计模块,用于统计预设数量帧图像中每一帧图像的网络时延;The statistics module is used to count the network delay of each frame of images in the preset number of frame images;
计算模块,用于根据所述每一帧图像的网络时延计算所述预设数量帧图像的网络时延的平均值;a calculation module, configured to calculate the average value of the network delay of the preset number of frame images according to the network delay of each frame of image;
第一确定模块,用于判断所述网络时延的平均值是否大于预设阈值,当所述网络时延的平均值大于所述预设阈值时,根据预设规则确定丢帧数M,所述M为整数;A first determination module, configured to determine whether the average value of the network delay is greater than a preset threshold, and when the average value of the network delay is greater than the preset threshold, determine the number of lost frames M according to a preset rule, Said M is an integer;
弃帧模块,用于将当前未开始编码的连续M帧图像丢弃。The frame discarding module is used for discarding consecutive M frames of images that are not currently encoded.
在一个实施例中,所述第一确定模块具体用于根据所述网络时延的平均值和所述预设阈值之间的差值确定丢帧数M。In one embodiment, the first determining module is specifically configured to determine the number M of dropped frames according to the difference between the average value of the network delay and the preset threshold.
在一个实施例中,所述第一确定模块具体用于根据第一公式确定丢帧数M,所述第一公式为:M=[(T平均-A)/(t采集+t编码)];In one embodiment, the first determining module is specifically configured to determine the number M of dropped frames according to a first formula, and the first formula is: M=[(T average -A)/(t acquisition +t encoding )] ;
其中,所述T平均为网络时延的平均值,所述A为预设阈值,所述t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Wherein, the T average is the average value of the network delay, the A is a preset threshold, the t acquisition is the average time required to collect a frame of image, and the t code is the average time required to encode a frame of image.
在一个实施例中,所述第一确定模块具体用于根据第二公式确定丢帧数M,所述第二公式为:In one embodiment, the first determining module is specifically configured to determine the number of dropped frames M according to a second formula, and the second formula is:
M=[(T平均-A)/(t采集+t编码)]+1;M=[(T average -A)/(t acquisition +t encoding )]+1;
其中,所述T平均为网络时延的平均值,所述A为预设阈值,所述t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Wherein, the T average is the average value of the network delay, the A is a preset threshold, the t acquisition is the average time required to collect a frame of image, and the t code is the average time required to encode a frame of image.
在一个实施例中,该装置还包括:In one embodiment, the apparatus further includes:
检测模块,用于检测用于对预设数量进行设置的设置操作;a detection module for detecting a setting operation for setting a preset number;
第二确定模块,用于根据所述设置操作确定所述预设数量。A second determining module, configured to determine the preset number according to the setting operation.
本申请实施例提供的图像编码控制装置,通过统计模块统计预设数量帧图像中每一帧图像的网络时延,计算模块计算该预设数量帧图像的网络时延的平均值,第一确定模块在判断出该平均值大于预设阈值时,根据预设规则确定丢帧数M,弃帧模块将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。In the image coding control device provided by the embodiment of the present application, the statistics module counts the network delay of each frame of images in the preset number of frame images, the calculation module calculates the average value of the network delay of the preset number of frame images, and the first determines When judging that the average value is greater than the preset threshold, the module determines the number of dropped frames M according to the preset rule, and the frame discarding module discards consecutive M frames of images that are not currently encoded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
根据本申请实施例的第三方面,提供一种图像编码控制设备,该图像编码控制设备包括处理器和存储器,所述存储器中存储有至少一条计算机指令,所述指令由所述处理器加载并执行以实现如上所述的图像编码控制方法中所执行的步骤。According to a third aspect of the embodiments of the present application, an image encoding control device is provided, the image encoding control device includes a processor and a memory, the memory stores at least one computer instruction, the instruction is loaded by the processor and Executed to realize the steps executed in the image coding control method as described above.
根据本申请实施例的第四方面,提供一种计算机可读存储介质,所述存储介质中存储有至少一条计算机指令,所述指令由处理器加载并执行以实现如上所述的图像编码控制方法中所执行的步骤。According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, where at least one computer instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the above-mentioned image encoding control method steps performed in .
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
图1是本申请实施例提供的一种图像编码控制方法的流程图;1 is a flowchart of an image coding control method provided by an embodiment of the present application;
图2是本申请实施例提供的一种具体的图像编码控制方法的流程图;2 is a flowchart of a specific image coding control method provided by an embodiment of the present application;
图3是本申请实施例提供的一种图像编码控制装置的结构示意图;FIG. 3 is a schematic structural diagram of an image coding control apparatus provided by an embodiment of the present application;
图4是本申请实施例提供的另一种图像编码控制装置的结构示意图;4 is a schematic structural diagram of another image coding control apparatus provided by an embodiment of the present application;
图5是本申请实施例提供的一种图像编码控制设备的结构示意图。FIG. 5 is a schematic structural diagram of an image coding control device provided by an embodiment of the present application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.
本申请实施例提供一种图像编码控制方法,如图1所示,该图像编码控制方法可以包括以下步骤:An embodiment of the present application provides an image coding control method. As shown in FIG. 1 , the image coding control method may include the following steps:
步骤101:统计预设数量帧图像的网络时延。Step 101: Count network delays of a preset number of frames of images.
在图像传输过程中,实时统计最近完成传输的预设数量帧图像中每一帧图像的网络时延。具体的,一帧图像的网络时延等于接收端接收到该图像的时间戳和该图像在发送端发送时的时间戳的差值。During the image transmission process, the network delay of each frame of images in the preset number of frames of images that have been recently transmitted is counted in real time. Specifically, the network delay of one frame of image is equal to the difference between the time stamp when the image is received by the receiver and the time stamp when the image is sent by the sender.
步骤102:计算预设数量帧图像的网络时延的平均值。Step 102: Calculate the average value of the network delay of the preset number of frame images.
统计得到最近完成传输的预设数量帧图像中每一帧图像的网络时延之后,根据统计得到的每一帧图像的网络时延计算该预设数量帧图像的网络时延的平均值。比如预设数量为N,则连续统计N帧图像中每一帧图像的网络时延,然后计算这N帧图像的网络时延的平均值。After the network delay of each frame of images in the preset number of frame images that have been recently transmitted is obtained by statistics, the average value of the network delay of the preset number of frame images is calculated according to the network delay of each frame image obtained by statistics. For example, if the preset number is N, the network delay of each frame of the N frames of images is continuously counted, and then the average value of the network delay of the N frames of images is calculated.
步骤103:判断平均值是否大于预设阈值。Step 103: Determine whether the average value is greater than a preset threshold.
计算得到预设数量帧图像的网络时延的平均值之后,判断该网络时延的平均值是否大于预设阈值,若大于,则执行步骤104,否则转至步骤101继续进行统计。After calculating the average value of the network delay of the preset number of frame images, it is judged whether the average value of the network delay is greater than the preset threshold.
步骤104:根据预设规则确定丢帧数M。Step 104: Determine the number M of dropped frames according to a preset rule.
当预设数量帧图像的网络时延的平均值大于预设阈值时,根据预设规则确定丢帧数M,其中的M为整数。比如,可以根据网络时延的平均值和预设阈值之间的差值确定丢帧数M。一种实施例中,可以利用该差值以及采集一帧图像所需的平均时长与编码一帧图像所需的平均时长之和的比值得到丢帧数M。When the average value of the network delay of the preset number of frame images is greater than the preset threshold, the number M of dropped frames is determined according to the preset rule, where M is an integer. For example, the number M of dropped frames may be determined according to the difference between the average value of the network delay and the preset threshold. In one embodiment, the number M of dropped frames can be obtained by using the difference and the ratio of the average duration required to acquire one frame of image and the sum of the average duration required to encode one frame of image.
步骤105:将当前未开始编码的连续M帧图像丢弃。Step 105: Discard the consecutive M frames of images that are not currently encoded.
确定出丢帧数M之后,将当前未开始编码的连续M帧图像直接丢弃,然后,转至步骤101继续进行网络时延的统计。在本步骤中,对于已经开始传输或者编码的图像则不会进行丢弃,仍正常进行后续处理,所丢弃的仅是未开始编码的连续M帧图像。After the number M of lost frames is determined, the consecutive M frames of images that are not currently encoded are directly discarded, and then, go to step 101 to continue the statistics of the network delay. In this step, images that have already been transmitted or encoded are not discarded, and subsequent processing is still performed normally, and only consecutive M frames of images that have not been encoded are discarded.
本申请实施例提供的图像编码控制方法,在图像传输过程中实时统计预设数量帧图像中每一帧图像的网络时延并计算该预设数量帧图像的网络时延的平均值,当该平均值大于预设阈值时,根据预设规则确定丢帧数M,并将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。In the image coding control method provided by the embodiment of the present application, the network delay of each frame of images in a preset number of frame images is counted in real time during the image transmission process, and the average value of the network delay of the preset number of frame images is calculated. When the average value is greater than the preset threshold, the number M of dropped frames is determined according to the preset rule, and the consecutive M frames of images that are not currently encoded are discarded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
基于上述图1对应的实施例提供的图像编码控制方法,本申请另一实施例提供一种具体的图像编码控制方法,该方法可以应用于视频图像编码端设备,例如,视频图像编码端设备可以是终端设备或网络服务器等。参照图2所示,本实施例提供的图像编码控制方法可以包括以下步骤:Based on the image coding control method provided by the above-mentioned embodiment corresponding to FIG. 1 , another embodiment of the present application provides a specific image coding control method, which can be applied to a video image coding end device. For example, the video image coding end device may It is a terminal device or a network server, etc. Referring to FIG. 2 , the image coding control method provided by this embodiment may include the following steps:
步骤201:统计预设数量帧图像的网络时延。Step 201: Count the network delay of a preset number of frames of images.
在图像传输过程中,实时统计最近完成传输的预设数量帧图像中每一帧图像的网络时延平均值。其中的预设数量可以根据实际需要进行设置,比如,可以设置为10帧、20帧、30帧等等。一帧图像的网络时延是指接收端接收到该图像的时间戳和该图像在发送端发送时的时间戳的差值。During the image transmission process, the average network delay of each frame of images in the preset number of frames of images that have been recently transmitted is counted in real time. The preset number can be set according to actual needs, for example, it can be set to 10 frames, 20 frames, 30 frames and so on. The network delay of a frame of image refers to the difference between the time stamp when the image is received by the receiver and the time stamp when the image is sent by the sender.
一种实施例中,可以提供预设数量的设置功能,具体的,可以通过如下方法实现:检测用于对预设数量进行设置的设置操作;根据该设置操作确定预设数量。例如,可以为用户提供用于设置预设数量的设置界面,用户可以根据界面提示输入预设数量,比如设置为10帧、20帧、30帧等等;或者,也可以通过预设数量的快捷键进行预设数量的设置。In one embodiment, the function of setting a preset number may be provided, and specifically, it may be implemented by the following methods: detecting a setting operation for setting the preset number; and determining the preset number according to the setting operation. For example, a setting interface for setting a preset number can be provided for the user, and the user can input the preset number according to the interface prompts, such as setting 10 frames, 20 frames, 30 frames, etc.; or, through the shortcut of the preset number key to set the preset number.
步骤202:计算预设数量帧图像的网络时延的平均值。Step 202: Calculate the average value of the network delay of the preset number of frame images.
统计得到最近完成传输的预设数量帧图像中每一帧图像的网络时延之后,根据每一帧图像的网络时延计算该预设数量帧图像的网络时延的平均值。比如预设数量为N,则连续统计N帧图像中每一帧图像的网络时延,然后计算这N帧图像的网络时延的平均值。After the network delay of each frame of images of the preset number of frame images that have been recently transmitted is obtained by statistics, the average value of the network delay of the preset number of frame images is calculated according to the network delay of each frame of image. For example, if the preset number is N, the network delay of each frame of the N frames of images is continuously counted, and then the average value of the network delay of the N frames of images is calculated.
具体的,可以通过如下的计算公式计算得到连续N帧图像的网络时延平均值T平均:Specifically, the average network delay T average of consecutive N frames of images can be calculated by the following formula:
其中,▽tx为第x帧图像的网络时延,x为大于0且小于或等于N的整数,其中,Rtx表示第x帧图像传输到接收端的时间戳,Stx表示第x帧图像在发送端发送时的时间戳。Among them, ▽t x is the network delay of the xth frame image, x is an integer greater than 0 and less than or equal to N, Among them, Rt x represents the time stamp of the xth frame image transmitted to the receiving end, and St x represents the time stamp of the xth frame image sent by the sending end.
步骤203:判断平均值是否大于预设阈值。Step 203: Determine whether the average value is greater than a preset threshold.
判断统计得到的预设数量帧图像的网络时延的平均值是否大于预设阈值,如果大于,则执行步骤204,否则转至步骤201继续进行统计。It is judged whether the average value of the network delay of the preset number of frame images obtained by statistics is greater than the preset threshold, and if it is greater than the preset threshold, go to step 204, otherwise go to step 201 to continue the statistics.
在本步骤中,将计算得到的预设数量帧图像的网络时延的平均值与预设阈值进行比较,判断该平均值是否大于预设阈值。其中的预设阈值是一个预先设置的值,可以根据经验进行设置,比如可以设置为100ms、90ms、80ms等等,也可以设置为其它取值。所设置的预设阈值越高,则表示对时延的容忍度越高,因此,该预设阈值的设置可以视使用场景而定。In this step, the calculated average value of the network delay of the preset number of frame images is compared with the preset threshold, and it is determined whether the average value is greater than the preset threshold. The preset threshold is a preset value, which can be set according to experience, for example, can be set to 100ms, 90ms, 80ms, etc., or can be set to other values. The higher the preset threshold value is, the higher the tolerance for the delay is, therefore, the setting of the preset threshold value can be determined according to the usage scenario.
一种实施例中,可以提供预设阈值的设置功能,具体的,可以通过如下方法实现:检测用于对预设阈值进行设置的设置操作;根据该设置操作确定预设阈值。例如,可以为用户提供用于设置预设阈值的设置界面,用户可以根据界面提示输入预设阈值,比如设置为100ms、90ms、80ms等等;或者,也可以通过预设阈值的快捷键进行预设阈值的设置。In one embodiment, a function of setting a preset threshold may be provided, and specifically, it may be implemented by the following methods: detecting a setting operation for setting the preset threshold; and determining the preset threshold according to the setting operation. For example, a setting interface for setting a preset threshold value may be provided for the user, and the user may input the preset threshold value according to the interface prompts, such as setting to 100ms, 90ms, 80ms, etc.; Set threshold settings.
步骤204:根据网络时延的平均值和预设阈值之间的差值确定丢帧数M。Step 204: Determine the number M of dropped frames according to the difference between the average value of the network delay and the preset threshold.
假设统计得到的网络时延的平均值为T平均,则丢帧数量M可以通过下述第一公式进行计算,也可通过下述第二公式进行计算。Assuming that the average value of the network delay obtained by statistics is T average , the number M of dropped frames can be calculated by the following first formula, and can also be calculated by the following second formula.
其中,第一公式为:M=[(T平均-A)/(t采集+t编码)];Wherein, the first formula is: M=[(T average -A)/(t acquisition +t encoding )];
第二公式为:M=[(T平均-A)/(t采集+t编码)]+1;The second formula is: M=[(T average -A)/(t acquisition +t encoding )]+1;
在上述公式中,T平均代表网络时延的平均值,A代表预设阈值,t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长,t采集和t编码均可以根据经验值进行设置。其中的符号[]表示取整符号,也就是,[(T平均-A)/(t采集+t编码)]等于(T平均-A)/(t采集+t编码)所得结果的整数部分。In the above formula, T average represents the average value of the network delay, A represents the preset threshold, t acquisition is the average time required to collect a frame of image, t code is the average time required to encode a frame of image, t acquisition and The t code can be set according to the empirical value. where the symbol [ ] represents the rounding symbol, that is, [(T average - A)/(t acquisition + t encoding )] is equal to the integer part of the result obtained by (T average - A)/(t acquisition + t encoding ).
步骤205:将当前未开始编码的连续M帧图像丢弃。Step 205: Discard the consecutive M frames of images that are not currently encoded.
确定出丢帧数量M之后,将当前未开始编码的连续M帧图像直接丢弃,然后转至步骤101继续进行网络时延的统计。After the number M of lost frames is determined, the consecutive M frames of images that are not currently encoded are directly discarded, and then the process goes to step 101 to continue the statistics of the network delay.
在该步骤中,对于当前未开始编码的连续M帧图像直接丢弃,同时,对于已经开始传输或者编码的图像不会进行丢弃,仍正常进行后续处理,所丢弃的是未开始编码的连续M帧图像。In this step, the continuous M frames of images that have not been encoded at present are directly discarded, and at the same time, the images that have been transmitted or encoded will not be discarded, and subsequent processing is still performed normally, and the continuous M frames that have not been encoded are discarded. image.
本申请实施例提供的图像编码控制方法,在图像传输过程中实时统计预设数量帧图像中每一帧图像的网络时延并计算该预设数量帧图像的网络时延的平均值,当该平均值大于预设阈值时,根据网络时延的平均值和预设阈值之间的差值确定丢帧数M,然后将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。In the image coding control method provided by the embodiment of the present application, the network delay of each frame of images in a preset number of frame images is counted in real time during the image transmission process, and the average value of the network delay of the preset number of frame images is calculated. When the average value is greater than the preset threshold, the number M of dropped frames is determined according to the difference between the average value of the network delay and the preset threshold, and then M consecutive frames of images that are not currently encoded are discarded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
基于上述图1和图2对应的实施例中所描述的图像编码控制方法,下述为本申请装置实施例,可以用于执行本申请的方法实施例。Based on the image coding control methods described in the embodiments corresponding to FIG. 1 and FIG. 2 , the following are apparatus embodiments of the present application, which may be used to execute the method embodiments of the present application.
本申请实施例提供一种图像编码控制装置,如图3所示,该图像编码控制装置30包括:统计模块301、计算模块302、第一确定模块303和弃帧模块304。其中,An embodiment of the present application provides an image coding control apparatus. As shown in FIG. 3 , the image
统计模块301用于统计预设数量帧图像中每一帧图像的网络时延;The
计算模块302用于根据统计模块301得到的每一帧图像的网络时延计算预设数量帧图像的网络时延的平均值;The
第一确定模块303用于判断计算模块302计算出的网络时延的平均值是否大于预设阈值,当该网络时延的平均值大于预设阈值时,根据预设规则确定丢帧数M,其中的M为整数;The
弃帧模块304用于将当前未开始编码的连续M帧图像丢弃。The
在一个实施例中,第一确定模块303具体用于根据网络时延的平均值和所述预设阈值之间的差值确定丢帧数M。In one embodiment, the first determining
在一个实施例中,第一确定模块303具体用于根据第一公式确定丢帧数M,该第一公式为:M=[(T平均-A)/(t采集+t编码)];In one embodiment, the first determining
其中,T平均为网络时延的平均值,A为预设阈值,t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Among them, T average is the average value of network delay, A is a preset threshold, t acquisition is the average time required to collect a frame of image, and t code is the average time required to encode one frame of image.
在一个实施例中,第一确定模块303具体用于根据第二公式确定丢帧数M,该第二公式为:In one embodiment, the first determining
M=[(T平均-A)/(t采集+t编码)]+1;M=[(T average -A)/(t acquisition +t encoding )]+1;
其中,T平均为网络时延的平均值,A为预设阈值,t采集为采集一帧图像所需要的平均时长,t编码为编码一帧图像所需要的平均时长。Among them, T average is the average value of network delay, A is a preset threshold, t acquisition is the average time required to collect a frame of image, and t code is the average time required to encode one frame of image.
在一个实施例中,如图4所示,图像编码控制装置还包括检测模块305和第二确定模块306。其中,In one embodiment, as shown in FIG. 4 , the image coding control apparatus further includes a
检测模块305用于检测用于对预设数量进行设置的设置操作;The
第二确定模块306用于根据检测模块305检测到的设置操作确定预设数量。The
本申请实施例提供的图像编码控制装置,通过统计模块在图像传输过程中实时统计预设数量帧图像中每一帧图像的网络时延,计算模块计算该预设数量帧图像的网络时延的平均值,第一确定模块在判断出该平均值大于预设阈值时,根据预设规则确定丢帧数M,弃帧模块将当前未开始编码的连续M帧图像丢弃。能够在编码前确定出丢帧数量并在编码前丢弃相应数量的图像,从而可以缓解网络压力,缩短图像编码时延,也降低了CPU的编码负荷。In the image encoding control device provided by the embodiment of the present application, the statistics module calculates the network delay of each frame of images in a preset number of frame images in real time during the image transmission process, and the calculation module calculates the network delay of the preset number of frame images. The first determining module determines the number M of dropped frames according to a preset rule when judging that the average is greater than the preset threshold, and the frame discarding module discards M consecutive frames of images that are not currently encoded. The number of lost frames can be determined before encoding, and a corresponding number of images can be discarded before encoding, which can relieve network pressure, shorten image encoding delay, and reduce CPU encoding load.
参考图5所示,本申请实施例还提供了一种图像编码控制设备50,该图像编码控制设备50包括存储器501和处理器502,存储器501中存储有至少一条计算机指令,处理器502用于加载并执行至少一条计算机指令,以实现上述图1或图2对应的实施例中所描述的图像编码控制方法。Referring to FIG. 5 , an embodiment of the present application further provides an image
基于上述图1和图2对应的实施例中所描述的图像编码控制方法,本申请实施例还提供一种计算机可读存储介质,例如,非临时性计算机可读存储介质可以是只读存储器(英文:Read Only Memory,ROM)、随机存取存储器(英文:Random Access Memory,RAM)、CD-ROM、磁带、软盘和光数据存储装置等。该存储介质上存储有计算机指令,用于执行上述图1和图2对应的实施例中所描述的图像编码控制方法,此处不再赘述。Based on the image coding control methods described in the embodiments corresponding to FIG. 1 and FIG. 2, the embodiments of the present application further provide a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a read-only memory ( English: Read Only Memory, ROM), random access memory (English: Random Access Memory, RAM), CD-ROM, magnetic tape, floppy disk and optical data storage device, etc. The storage medium stores computer instructions for executing the image coding control methods described in the embodiments corresponding to FIG. 1 and FIG. 2 , and details are not described herein again.
本领域技术人员在考虑说明书及实践这里公开的内容后,将容易想到本申请的其它实施方案。本申请旨在涵盖本公开内容的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由所附的权利要求指出。Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of this application and include common knowledge or practice in the art not disclosed in this application means. The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the application being indicated by the appended claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It is to be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010771938.9A CN112087635B (en) | 2020-08-04 | 2020-08-04 | Image coding control method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010771938.9A CN112087635B (en) | 2020-08-04 | 2020-08-04 | Image coding control method, device, equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112087635A true CN112087635A (en) | 2020-12-15 |
CN112087635B CN112087635B (en) | 2024-11-19 |
Family
ID=73735765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010771938.9A Active CN112087635B (en) | 2020-08-04 | 2020-08-04 | Image coding control method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112087635B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114302140A (en) * | 2021-11-30 | 2022-04-08 | 山东云海国创云计算装备产业创新中心有限公司 | Pre-frame loss method, system, equipment and computer readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6031584A (en) * | 1997-09-26 | 2000-02-29 | Intel Corporation | Method for reducing digital video frame frequency while maintaining temporal smoothness |
US20050084237A1 (en) * | 2003-10-16 | 2005-04-21 | Kellner Charles R.Jr. | Systems and methods for managing frame rates during multimedia playback |
CN101715129A (en) * | 2009-12-24 | 2010-05-26 | 四川长虹电器股份有限公司 | Video decoding method |
CN102368823A (en) * | 2011-06-28 | 2012-03-07 | 上海盈方微电子有限公司 | Video framedropping strategy based on grading mechanism |
CN102724489A (en) * | 2012-04-20 | 2012-10-10 | 苏州汉辰数字科技有限公司 | Method for reducing video coding time delay |
CN103475902A (en) * | 2013-09-06 | 2013-12-25 | 同观科技(深圳)有限公司 | Video coding and network transmission method and video forwarding server |
CN110572695A (en) * | 2019-08-07 | 2019-12-13 | 苏州科达科技股份有限公司 | media data encoding and decoding methods and electronic equipment |
CN112087627A (en) * | 2020-08-04 | 2020-12-15 | 西安万像电子科技有限公司 | Image coding control method, device, equipment and storage medium |
-
2020
- 2020-08-04 CN CN202010771938.9A patent/CN112087635B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6031584A (en) * | 1997-09-26 | 2000-02-29 | Intel Corporation | Method for reducing digital video frame frequency while maintaining temporal smoothness |
US20050084237A1 (en) * | 2003-10-16 | 2005-04-21 | Kellner Charles R.Jr. | Systems and methods for managing frame rates during multimedia playback |
CN101715129A (en) * | 2009-12-24 | 2010-05-26 | 四川长虹电器股份有限公司 | Video decoding method |
CN102368823A (en) * | 2011-06-28 | 2012-03-07 | 上海盈方微电子有限公司 | Video framedropping strategy based on grading mechanism |
CN102724489A (en) * | 2012-04-20 | 2012-10-10 | 苏州汉辰数字科技有限公司 | Method for reducing video coding time delay |
CN103475902A (en) * | 2013-09-06 | 2013-12-25 | 同观科技(深圳)有限公司 | Video coding and network transmission method and video forwarding server |
CN110572695A (en) * | 2019-08-07 | 2019-12-13 | 苏州科达科技股份有限公司 | media data encoding and decoding methods and electronic equipment |
CN112087627A (en) * | 2020-08-04 | 2020-12-15 | 西安万像电子科技有限公司 | Image coding control method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
蔡倩等: ""基于主动丢帧的实时视频自适应传输"", 《成都大学学报(自然科学版)》, vol. 30, no. 2, 30 June 2011 (2011-06-30), pages 148 - 150 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114302140A (en) * | 2021-11-30 | 2022-04-08 | 山东云海国创云计算装备产业创新中心有限公司 | Pre-frame loss method, system, equipment and computer readable storage medium |
CN114302140B (en) * | 2021-11-30 | 2023-11-03 | 山东云海国创云计算装备产业创新中心有限公司 | Pre-frame-loss method, system, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112087635B (en) | 2024-11-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5970724B2 (en) | Method and apparatus for obtaining video encoding compression quality | |
US9030565B2 (en) | Method, apparatus, and system for evaluating video quality | |
CN106067847B (en) | A kind of voice data transmission method and device | |
CN107342848B (en) | Self-adaptive code stream transmission method, device and equipment | |
KR102025757B1 (en) | method and apparatus for transmitting and receiving data and medium thereof | |
CN113992967A (en) | Screen projection data transmission method and device, electronic equipment and storage medium | |
CN112087627B (en) | Image coding control method, device, equipment and storage medium | |
WO2020107972A1 (en) | Video decoding control method and apparatus, electronic device, and storage medium | |
CN109981482B (en) | Audio processing method and device | |
CN113038178A (en) | Video frame transmission control method and device | |
US10681400B2 (en) | Method and device for transmitting video | |
WO2017173817A1 (en) | Computing method and apparatus for video display quality | |
CN105208388B (en) | Dynamically adjustment encodes the method and system of frame per second in video communication | |
CN112087635A (en) | Image coding control method, device, equipment and computer readable storage medium | |
CN110233856B (en) | Message processing method and device and computer readable storage medium | |
CN113364698B (en) | Bandwidth estimation method, system, electronic device and storage medium | |
CN111953978A (en) | Frame rate control method, device and storage medium | |
TWI658715B (en) | Communication device, available bandwidth calculation system, available bandwidth calculation method, and program | |
CN114513651B (en) | Video equipment key frame collision detection method, data transmission method and related device | |
CN111447253B (en) | Buffer management method, system, device and storage medium | |
JP7400042B2 (en) | Communication terminal and program | |
KR101612312B1 (en) | DATA processing improvement device and method thereof | |
CN108574814B (en) | Data processing method and device | |
CN111432441B (en) | Audio data transmitting method and device and computer readable storage medium | |
CN111541897A (en) | Data transmission method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |