WO2010060376A1 - Video frame type identification method and device - Google Patents

Video frame type identification method and device Download PDF

Info

Publication number
WO2010060376A1
WO2010060376A1 PCT/CN2009/075123 CN2009075123W WO2010060376A1 WO 2010060376 A1 WO2010060376 A1 WO 2010060376A1 CN 2009075123 W CN2009075123 W CN 2009075123W WO 2010060376 A1 WO2010060376 A1 WO 2010060376A1
Authority
WO
WIPO (PCT)
Prior art keywords
threshold
frame
video frame
value
frames
Prior art date
Application number
PCT/CN2009/075123
Other languages
French (fr)
Chinese (zh)
Inventor
陈玉芳
李斌
谷安文
周素萍
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2010060376A1 publication Critical patent/WO2010060376A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing

Definitions

  • the invention relates to a Chinese patent application filed on November 25, 2008, the Chinese Patent Application No. 200810203702.4, entitled "A Method and Apparatus for Identifying Video Frame Types". Priority is hereby incorporated by reference in its entirety.
  • the present invention relates to the field of streaming media technologies, and in particular, to a video frame type identification method and apparatus.
  • 3G networks can provide rich streaming video on demand and video live broadcast services, and streaming video services. Has been favored by more and more users.
  • the video frame is the smallest unit of streaming media playback, and can be classified into an I frame, a P frame, and a B frame according to the type.
  • a set of consecutive video frames constitutes a GOP (Group of Pictures).
  • a GOP consists of a series of I frames, P frames and B frames with the I frame as the starting frame.
  • the I frame adopts the intra coding mode
  • the P frame and the B frame adopt the interframe coding mode. That is, the B frame refers to the I frame or P frame that is the most recent in the GOP and the nearest I frame or P frame in the GOP when encoding;
  • the P frame refers to the most recent in the GOP before the coding.
  • I frame or P frame When decoding is performed at the receiving end, I frames that are not referenced to B frames or P frames can be decoded independently, while B frames and P frames must be decoded after the reference frames referenced by them are decoded.
  • the wireless network can identify the type of each video frame, different types of video frames can be separately analyzed and processed according to their types, thereby ensuring that the wireless network better carries the streaming video service.
  • the header information of each video frame includes a type identifier indicating the type of the video frame
  • the type of the video frame can be accurately read by these types of identifiers, but for each video frame on the network side Parsing header information can take up very large network overhead.
  • Embodiments of the present invention provide a method and an apparatus for identifying a video frame type, which can save network overhead for identifying a type of a video frame.
  • the embodiment of the invention discloses a method for identifying a video frame type, including:
  • An embodiment of the present invention further discloses an apparatus for identifying a type of a video frame, including:
  • a receiving unit configured to receive a video frame to be identified
  • a first statistic unit configured to obtain a size of the received video frame to be identified
  • a determining unit configured to determine, according to a size of the video frame to be identified that is counted by the first statistical unit, a type of the video frame to be identified.
  • the network side uses the length of the video frame to identify the type of the video frame, and the type of the video frame is identified by parsing the header information. More network overhead.
  • FIG. 1 is a flowchart of a method for identifying a video frame type according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a method for identifying a video frame type according to Embodiment 2 of the present invention
  • FIG. 5 is a structural diagram of a video frame type identification apparatus according to Embodiment 3 of the present invention. detailed description
  • FIG. 1 is a flowchart of a method for identifying a video frame type according to an embodiment of the present invention, including the following steps:
  • Step 101 Receive a video frame to be identified and collect a length value of the to-be-identified video frame.
  • the video frame is decomposed on the network side into a service data unit SDU for transmission in the network, so its length value can be obtained by counting the length values of all SDUs of the video frame.
  • the service data unit SDU is received; the SDUs belonging to the same video frame are identified; and the length values of the SDUs belonging to the same video frame are added and summed.
  • Step 102 Identify a type of the to-be-identified video frame according to the length value of the to-be-identified video frame.
  • the embodiment of the present invention further provides a method for identifying a video frame type, which may include the following steps: (1) receiving a video frame to be identified;
  • the inventors have found that there are certain differences in the length values or sizes of different types of video frames, and the difference can be used to identify the type of video frames.
  • the maximum value of the B frame is generally smaller than the minimum value of the P frame
  • the maximum value of the P frame is generally smaller than the minimum value of the I frame. Therefore, the size of this video frame can be used to identify the type of video frame.
  • the value of the video frame is determined when the length value of the video frame is less than or equal to the first threshold, or when the length value of the video frame is less than or equal to the first threshold and less than the maximum value of the B frame.
  • the first threshold value remains unchanged when the jitter of the current code rate is relatively small or does not change, and is a value between the maximum value of the B frame and the minimum value of the P frame within the current period.
  • identifying the type of the B frame may be implemented by: determining a current period; counting a first average value of the length of the received video frame in the current period; comparing the first coefficient The value obtained by multiplying the first average value and the maximum value of the B frame are set to the first threshold value.
  • the length value of the video frame is smaller than the first threshold, determining that the video frame is a B frame, where 0 ⁇ first coefficient ⁇ 0.6, and in the encoding mode of H.263, MPEG4, H.264 Decrease in turn.
  • the second threshold is also constant when the jitter of the code rate is relatively small or does not change, and is a value between the minimum value of the I frame and the maximum value of the P frame within the current period.
  • identifying the type of the I frame may be implemented by: determining a current period; counting a first average of the length of the received video frame in the current period; comparing the second coefficient by the first average The value obtained by the value and the preset minimum threshold of the I frame, and the maximum value of the two is set as the second threshold.
  • determining the The video frame is an I frame, where 2 ⁇ the second coefficient ⁇ 4, and is sequentially incremented in the encoding modes of H.263, MPEG4, and H.264.
  • the current period is usually related to the change of the code rate.
  • the current period needs to be changed accordingly, so that the video frame type can be more accurately identified.
  • the start time of the current cycle can be set to the end time of the previous cycle, and the end time of the current cycle can be set to a time before the code rate is changed, or shorter.
  • the determining process of the current period includes, for example: setting an initial period value for the current period; estimating the number of consecutively received B frames and the number of consecutively received I frames in the initial period; if the tth third threshold
  • the number of continuously received B frames is greater than a third threshold, and the current period is updated to a frame rate of the video frame, where the t1 is from the initial period to the discovery that the number of consecutively received B frames is greater than a third threshold.
  • the duration of the time period, the third threshold is the maximum number of consecutive B frames when the code rate is unchanged; or, if the number of consecutively received I frames is greater than the fourth threshold, the current period is The update is n , where the t 2 is a time duration from when the initial period is counted until the number of frame rate frames of the I video frame that are continuously received is greater than the fourth threshold, and the fourth threshold is the same as the code rate. Continuous situation The maximum number of I frames appears.
  • the estimating the number of consecutively received B frames and the number of consecutively received I frames includes: calculating a second average value of video frame lengths received in the initial period; and counting in the initial period And continuously counting the number of video frames whose length is smaller than the product of the first coefficient and the second average is used as the number of B frames; in the initial period, the length of the continuous reception is greater than the second coefficient and The number of video frames of the product of the second average is taken as the number of I frames.
  • the size of the first coefficient and the second coefficient are related to the encoding mode. For different video files using the same encoding format, their first coefficients are generally equal, and the second coefficients are generally equal, therefore The first coefficient and the second coefficient corresponding to different coding modes may also be determined by parsing the header information of the video frame of the video file of different coding modes in advance.
  • the minimum threshold of the I frame is the minimum value of the length of the I frame in a video file
  • the maximum threshold of the B frame refers to the maximum value of the length of the B frame in a video file, which corresponds to the same coding mode.
  • the I frame minimum threshold and the B frame maximum threshold should be the same.
  • the first threshold and the second threshold may also be obtained by other embodiments in the embodiment of the present invention. For example, you can first obtain the maximum and minimum values of the P frame, the minimum value of the I frame, the maximum value of the B frame, and then select between the minimum value of the I frame and the maximum value of the P frame by parsing the header information. A value is used as the first threshold, and a value between the maximum value of the B frame and the minimum value of the P frame is taken as the second threshold, and then the first coefficient and the second coefficient are calculated.
  • FIG. 2 is a flowchart of a method for identifying a video frame type according to Embodiment 2 of the present invention, where the method includes the following steps:
  • Step 201 Determine the current period.
  • the current period is usually related to the change of the code rate. When the code rate changes, the current period needs to be changed accordingly, so that the video frame type can be identified more accurately.
  • FIG. 4 is a method for determining the current period, and specifically includes the following steps.
  • Step 401 Set an initial period value for the current period
  • the initial period value may be a previous period value, or a preset system default value.
  • the system default value is determined by combining a reference video file GOP length and a frame rate, and generally, Is is selected, but the present invention Embodiments are not limited to this value.
  • Step 402 Set parameter i and parameter j to 0 respectively, where parameter i is used to count the number of consecutive B frames, and parameter j is used to count the number of consecutive I frames;
  • Step 403 The average value of the received video frame length values in the initial period value is calculated.
  • the calculation formula of the average value of the received video frame length values in the initial period value is:
  • N me total length of the received SDU within the initial period value / total number of video frames received during the initial period.
  • Step 404 The length N /ram of the received video frame in the initial period is sequentially counted; this step is a loop process. Starting from the initial period, the length values of the received video frames are sequentially calculated. After processing one video frame, the next video frame continues to be received until all video frames in the initial period are processed. If the parameter i is greater than the third threshold or the parameter j is greater than the fourth threshold during the loop, indicating that the code rate changes, the value of the current period is updated, and the loop of this step is suspended.
  • the length value of the video frame can be found by adding the SDUs belonging to the same video frame.
  • the same RTP packet divided into the same video frame may be inserted into the same at the transmitting end.
  • the frame identifier of the timestamp, and the network side performs video frame combination according to the frame identifier.
  • Step 405 Determine whether the length of the received video frame in the initial period is less than the product of the first coefficient and the average of the length of the received video frame in the initial period, and if so, proceeds to step 406, and if no, proceeds to step 408;
  • Step 406 Add parameter i to 1, and j to 0;
  • Step 407 Determine whether the parameter i is greater than the third threshold. If yes, go to step 411. If no, return to step 404, calculate the length value of the next video frame, and continue to judge the next video frame until all the initial periods. The video frames are all judged;
  • the third threshold is determined by the file type and the coding quantization factor.
  • the preferred value of this embodiment is 6, but the present invention is not limited to this value.
  • Step 408 Determine whether the video frame is greater than a product of the second coefficient and an average value of the received video frame length values in the initial period. If yes, go to step 409; if no, return to step 404 to continue to determine the next video frame until All the video frames in the initial period are judged;
  • Step 409 Add parameter j to 1 and set i to 0;
  • Step 410 Determine whether the parameter j is greater than the fourth threshold, and if yes, proceed to step 412; if no, return to step 405 to continue to determine the next video frame until all video frames in the initial period are judged to be one-, value It is 6, but the invention is not limited to this value.
  • Step 411 End this cycle;
  • the frame rate of the video frame is the playback rate of the video frame, and the number of video frames played in a unit time is used to indicate that when the parameter i is greater than the third threshold, the code rate is considered to be jittered, and the length of the video frame after the code rate is changed. The value will change significantly. In this case, the value of the current period needs to be updated accordingly, and the initial period value cannot be used.
  • Step 412 The current period is the frame rate of the video frame, and the current loop is ended.
  • the parameter j is greater than the fourth threshold, the code rate is considered to be jittered, and the current period needs to be changed accordingly, and the initial period cannot be adopted. Period value.
  • step 202 is continued.
  • Step 202 The network side receives an SDU (Service Data Unit) in the determined current period.
  • SDU Service Data Unit
  • the transport protocols used by the streaming video service include RTP (Real-Time Transport Protocol), RTP (RTP Control Protocol), and Real-Time Streaming Protocol (RTSP).
  • the protocol for audio and video data is RTP.
  • the sender divides a video frame into several RTP packets.
  • the RTP packets of these application layers are transmitted on the network side by using the SDU as a carrier. Referring to FIG. 3, FIG. 3 is a schematic diagram of packetization and bearer of a video frame in the prior art.
  • Step 203 Count an average value of length values of video frames received in the current period
  • the total length value of the received SDU and the total number of video frames in the current period may be calculated according to the following:
  • Step 204 The length values of the respective video frames in the current period are sequentially counted.
  • the SDU adds the length values of the SDUs of the video frames to obtain the length values of the video frames.
  • N f the above step in addition to the method using the video frame boundary identification belonging to the identified SDU than the respective video frame received in the current cycle and the combined video frame, may also be segmented in the same video frame at the transmitting side RTP A frame identifier having the same time stamp is inserted into the packet, and the network side performs video frame combination according to the frame identifier.
  • This step is a cyclic process. After the type of a video frame is recognized, the length value of the next video frame is continuously calculated, and the type is identified until all the video frame types in the current period are recognized. Step 205: determining whether the average value of the length of a video frame received in the current period is less than or equal to the first threshold, and if so, proceeding to step 206, if no, proceeding to step 207;
  • Step 206 Determine that the video frame is a B frame, return to step 204, and continue to determine the next video frame received in the current period, until all the video frames received in the current period are judged;
  • step 201 After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
  • Step 207 Determine whether the video frame is greater than or equal to the second threshold, and if so, proceed to step 208, if no, proceed to step 209;
  • Step 208 Determine that the video frame is an I frame, return to step 204, and continue to determine the next video frame received in the current period, until all the video frames received in the current period are judged;
  • step 201 After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
  • Step 209 Determine that the video frame is a P frame, and return to step 204 to continue to determine the next video frame received in the current period until all video frames received in the current period are judged.
  • step 201 After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
  • the video frame with the higher priority can be preferentially processed according to the priority set for each type of video frame in advance, thereby ensuring the transmission of the video frame with the higher priority. quality.
  • the network side compares the lengths N of the video frames obtained in the current statistical period with the first threshold and the second threshold respectively, which is smaller than the first At the threshold value, it is determined that the video frame corresponding to the W from 6 is a B frame, and when N is greater than the second threshold, it is determined that the corresponding video frame is an I frame, and when the above two conditions are not satisfied, the determination is The video frame corresponding to the WTM is a P frame, thereby saving the network overhead.
  • the identification of the video frame type is implemented, and the network side can separately process the video frame according to the type of the video frame. At the same time, the network side performs analysis and processing on different types of video frames according to the type of the video frame to ensure that the wireless network better carries the streaming video service.
  • Embodiment 3 Embodiment 3
  • FIG. 5 is a structural diagram of a video type identification apparatus according to Embodiment 3 of the present invention, where the apparatus includes a first statistical unit 501 and an identification unit 502.
  • the internal structure and the relationship are further described below in conjunction with the working principle of the device.
  • a first statistic unit 501 configured to calculate a length value of the video frame to be identified
  • the first statistical unit 501 includes:
  • a receiving unit configured to receive a service data unit SDU; an identifying unit, configured to identify an SDU belonging to the same video frame;
  • the identifying unit 502 is configured to identify, according to the length value of the video frame to be identified that is counted by the first statistic unit 501, the type of the video frame to be identified.
  • the identification unit 502 further includes:
  • the first determining unit 5021, the second determining unit 5022, and the frame type determining unit 5023 are the first determining unit 5021, the second determining unit 5022, and the frame type determining unit 5023.
  • the first determining unit 5021 is configured to determine a first threshold, where the first threshold is a value between a B frame length value and a P frame length value;
  • the first determining unit 5021 may further include: a current period determining unit, configured to determine a current period; and a second statistic unit, configured to collect a current current determined by the current period determining unit The average value of the length of the received video frame is used as a first average value; the first setting unit is configured to compare the value obtained by multiplying the first coefficient by the first average value with the preset maximum threshold value of the B frame, and The minimum of the two is set to the first threshold.
  • a second determining unit 5022 configured to determine a second threshold, where the second threshold is a value between a P frame length value and an I frame length value;
  • the second determining unit 5022 may further include: a current period determining unit, configured to determine a current period; and a second statistic unit, configured to collect a current current determined by the current period determining unit, in a specific implementation scenario.
  • the average value of the length of the received video frame in the period is used as a first average; the second setting unit is configured to compare the value obtained by multiplying the second coefficient by the first average value with a preset minimum threshold value of the I frame, The maximum of the two is set to the second threshold.
  • the current period determining unit includes: a preset unit, configured to set an initial period value for the current period; and an estimating unit, configured to estimate a number of consecutively received B frames in the initial period and consecutively received I frames a first update unit, configured to determine a continuously received t third threshold if the estimating unit estimates
  • the number of B frames is greater than a third threshold, and the current period is updated to a frame rate of the video frame, where the t1 is continued from the initial period counting until the number of consecutively received B frames is greater than a third threshold.
  • the third threshold is the maximum number of consecutive B frames in the case where the third threshold is the same as the code rate; the second updating unit is configured to: if the estimating unit estimates the number of continuously received I frames is greater than the fourth threshold , will t the fourth threshold
  • the current period is updated to a frame rate of a video frame, where the t2 is a time period from when the initial period is counted to when the number of consecutively received I frames is greater than a fourth threshold, and the fourth threshold is a code rate.
  • the maximum number of consecutive I frames occurs without change.
  • the foregoing estimating unit may further include: a third statistic unit, configured to collect an average value of video frame lengths received in the initial period as a second average value; and a fourth statistic unit, configured to: Counting, in the initial period, the number of consecutively received video frames whose length is smaller than the product of the first coefficient and the second average is the number of B frames; the fifth statistical unit is used for statistics in the In the initial period, the number of consecutively received video frames whose length is greater than the product of the second coefficient and the second average value is taken as the number of I frames.
  • the frame type determining unit 5023 is configured to: when the video frame to be identified is less than or equal to the first threshold, determine that the to-be-identified video frame is a B frame; and when the to-be-identified video frame is greater than or equal to the second threshold Determining that the video frame to be identified is an I frame; when the video frame to be identified is larger than the When the first threshold is smaller than the second threshold, it is determined that the to-be-identified video frame is a P frame.
  • the embodiment of the invention further provides a video type identification device, which may include:
  • a receiving unit configured to receive a video frame to be identified
  • a first statistic unit configured to obtain a length value or a size of the received video frame to be identified
  • a determining unit configured to determine, according to a length value or a size of the video frame to be identified that is counted by the first statistic unit Identify the type of video frame.
  • the determining unit includes:
  • a first determining unit configured to determine a first threshold, where the first threshold is a value between a B frame maximum value and a P frame minimum value;
  • a second determining unit configured to determine a second threshold, where the second threshold is a value between a maximum value of the P frame and a minimum value of the I frame;
  • the first determining unit further includes:
  • a current period determining unit configured to determine a current period
  • a first setting unit configured to compare a value obtained by multiplying the first coefficient by the first average value and a maximum value of the B frame, and setting a minimum value of the two as the first threshold.
  • the second determining unit further includes:
  • a second statistic unit configured to collect an average value of lengths of video frames received in a current period determined by the current period determining unit, and use the average value as a first average value
  • a second setting unit configured to compare a value obtained by multiplying the second coefficient by the first average value with a minimum value of a preset I frame minimum value, and setting a maximum value of the two as the second threshold value.
  • the identification unit determines the type of the video frame by using the length of the video frame counted by the first statistic unit, when the video frame is less than or equal to Determining, by the first threshold, that the video frame is a B frame; when the video frame is greater than or equal to a second threshold, determining that the video frame is an I frame; when the video frame is greater than the first threshold and less than When the second threshold is described, it is determined that the video frame is a P frame. It avoids the wasted network overhead caused by the network parsing the header information of each video frame.
  • the network side performs analysis and processing on different types of video frames according to the type of the video frame to ensure that the wireless network better carries the streaming video service.
  • the embodiments of the present invention can also be applied to the fields of video quality assessment, video quality assurance, and the like.
  • the storage medium is, for example, a ROM/RAM, a magnetic disk, an optical disk, or the like.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

A video frame type identification method and device are provided, wherein, the method includes that: receiving the video frames to be identified; obtaining the size of the received video frames to be identified; and determining the types of the video frames to be identified based on the size of the video frames to be identified. The device includes: a receiving unit, for receiving the video frames to be identified; a first statistical unit, for obtaining the size of the received video frames to be identified; and a determining unit, for determining the types of the video frames to be identified based on the size of the video frames to be identified stated by the first statistical unit. The scheme uses the length of the video frames to identify the types of the video frames, without analyzing the head information of each video frame, thereby saving the network overhead.

Description

一种视频帧类型的识别方法和装置 本申请要求于 2008 年 11 月 25 日提交中国专利局、 申请号为 200810203702.4、 发明名称为"一种视频帧类型的识别方法和装置 "的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。  The invention relates to a Chinese patent application filed on November 25, 2008, the Chinese Patent Application No. 200810203702.4, entitled "A Method and Apparatus for Identifying Video Frame Types". Priority is hereby incorporated by reference in its entirety.
技术领域 Technical field
本发明涉及流媒体技术领域, 特别涉及一种视频帧类型的识别方法和装 置。  The present invention relates to the field of streaming media technologies, and in particular, to a video frame type identification method and apparatus.
背景技术 Background technique
目前, 随着无线通讯技术和流媒体技术的发展, 流媒体视频业务已成为 3G的一种重要应用, 商用的 3G网络已经可以提供丰富的流媒体视频点播和 视频直播业务, 流媒体视频业务也得到了越来越多的用户的青睐。  At present, with the development of wireless communication technology and streaming media technology, streaming video services have become an important application of 3G. Commercial 3G networks can provide rich streaming video on demand and video live broadcast services, and streaming video services. Has been favored by more and more users.
在流媒体视频业务中,视频帧是流媒体播放的最小单位,按照类型可分为 I帧、 P帧和 B帧。 一组连续的视频帧就构成了一个 GOP ( Group of Pictures , 画面组), 一个 GOP是由 I帧为起始帧的一串 I帧、 P帧和 B帧组成。 其中, I帧采用的是帧内编码方式, 而 P帧和 B帧采用的是帧间编码方式。 即, B帧 在编码时参考了 GOP中排在其前面最近的 I帧或 P帧和排在其后面最近的 I 帧或 P帧; P帧在编码时参考了 GOP中排在其前面最近的 I帧或者 P帧。 在 接收端进行解码时, 编码未参考 B帧或者 P帧的 I帧可以独立解码, 而 B帧 和 P帧则必须在它们编码时所参考的参考帧解码出来以后才能进行解码。  In the streaming video service, the video frame is the smallest unit of streaming media playback, and can be classified into an I frame, a P frame, and a B frame according to the type. A set of consecutive video frames constitutes a GOP (Group of Pictures). A GOP consists of a series of I frames, P frames and B frames with the I frame as the starting frame. Among them, the I frame adopts the intra coding mode, and the P frame and the B frame adopt the interframe coding mode. That is, the B frame refers to the I frame or P frame that is the most recent in the GOP and the nearest I frame or P frame in the GOP when encoding; the P frame refers to the most recent in the GOP before the coding. I frame or P frame. When decoding is performed at the receiving end, I frames that are not referenced to B frames or P frames can be decoded independently, while B frames and P frames must be decoded after the reference frames referenced by them are decoded.
不同类型的视频帧的重要性不同,从而对视频质量的影响程度也不同。 当 参考帧出现视频缺陷时,在编码时参考了该参考帧的视频帧就会相应地出现视 频缺陷。 只有当 B帧出现视频缺陷时, 不会引起其它视频帧的视频缺陷。  Different types of video frames have different importance, and thus have different effects on video quality. When a video defect occurs in a reference frame, a video frame that references the reference frame at the time of encoding will correspondingly cause a video defect. Only when a video defect occurs in a B frame does not cause a video defect of other video frames.
如果无线网络能够识别出每个视频帧的类型,就可以将不同类型的视频帧 分别进行与其类型相对应的分析及处理 ,从而保证无线网络更好的承载流媒体 视频业务。  If the wireless network can identify the type of each video frame, different types of video frames can be separately analyzed and processed according to their types, thereby ensuring that the wireless network better carries the streaming video service.
虽然每个视频帧的头部信息包含了指示该视频帧类型的类型标识, 通过 这些类型标识可以准确读取该视频帧的类型,但是, 在网络侧对每个视频帧的 头部信息进行解析会占用非常大的网络开销。 Although the header information of each video frame includes a type identifier indicating the type of the video frame, the type of the video frame can be accurately read by these types of identifiers, but for each video frame on the network side Parsing header information can take up very large network overhead.
发明内容 Summary of the invention
本发明实施例提供一种视频帧类型的识别方法和装置,可节省识别视频帧 的类型的网络开销。  Embodiments of the present invention provide a method and an apparatus for identifying a video frame type, which can save network overhead for identifying a type of a video frame.
本发明实施例公开了一种视频帧类型的识别方法, 包括:  The embodiment of the invention discloses a method for identifying a video frame type, including:
接收待识别的视频帧;  Receiving a video frame to be identified;
获得所述接收到的待识别视频帧的大小;  Obtaining a size of the received video frame to be identified;
根据所述待识别视频帧的大小确定所述待识别视频帧的类型。  Determining a type of the to-be-identified video frame according to a size of the to-be-identified video frame.
本发明实施例还公开了一种视频帧的类型的识别装置, 包括:  An embodiment of the present invention further discloses an apparatus for identifying a type of a video frame, including:
接收单元, 用于接收待识别的视频帧;  a receiving unit, configured to receive a video frame to be identified;
第一统计单元, 用于获得所述接收到的待识别视频帧的大小;  a first statistic unit, configured to obtain a size of the received video frame to be identified;
确定单元,用于根据所述第一统计单元统计的待识别视频帧的大小确定所 述待识别视频帧的类型。  And a determining unit, configured to determine, according to a size of the video frame to be identified that is counted by the first statistical unit, a type of the video frame to be identified.
由上述本发明的实施例可以看出, 由于不同类型的视频帧的长度是不同 的, 网络侧利用视频帧的长度来识别视频帧的类型, 比起解析头部信息来识别 视频帧的类型, 更节省网络开销。  As can be seen from the above embodiments of the present invention, since the lengths of different types of video frames are different, the network side uses the length of the video frame to identify the type of the video frame, and the type of the video frame is identified by parsing the header information. More network overhead.
附图说明 DRAWINGS
图 1为本发明实施例一揭示的一种视频帧类型的识别方法的流程图; 图 2为本发明实施例二揭示的一种视频帧类型的识别方法的流程图; 图 3为现有技术中视频帧的分包与承载示意图;  FIG. 1 is a flowchart of a method for identifying a video frame type according to a first embodiment of the present invention; FIG. 2 is a flowchart of a method for identifying a video frame type according to Embodiment 2 of the present invention; Schematic diagram of packetization and bearer of a medium video frame;
图 4为本发明中当前统计周期确定方法的流程图;  4 is a flowchart of a method for determining a current statistical period in the present invention;
图 5为本发明实施例三揭示的一种视频帧类型的识别装置的结构图。 具体实施方式  FIG. 5 is a structural diagram of a video frame type identification apparatus according to Embodiment 3 of the present invention. detailed description
下面结合附图对本发明实施例进行详细描述。  The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
实施例一  Embodiment 1
请参阅图 1 , 图 1为本发明实施例一揭示的一种视频帧类型的识别方法的 流程图, 包括以下步骤:  Referring to FIG. 1 , FIG. 1 is a flowchart of a method for identifying a video frame type according to an embodiment of the present invention, including the following steps:
步骤 101: 接收待识别的视频帧并统计所述待识别视频帧的长度值; 视频帧在网络侧被分解为服务数据单元 SDU在网络中进行传输, 因此其 长度值可以通过统计视频帧的所有的 SDU的长度值来获得。 Step 101: Receive a video frame to be identified and collect a length value of the to-be-identified video frame. The video frame is decomposed on the network side into a service data unit SDU for transmission in the network, so its length value can be obtained by counting the length values of all SDUs of the video frame.
具体实现方式, 例如: 接收服务数据单元 SDU; 识别出属于同一个视频 帧的 SDU; 将所述属于同一个视频帧的 SDU的长度值相加求和。  For example, the service data unit SDU is received; the SDUs belonging to the same video frame are identified; and the length values of the SDUs belonging to the same video frame are added and summed.
步骤 102: 根据所述待识别视频帧的长度值识别所述待识别视频帧的类 型。  Step 102: Identify a type of the to-be-identified video frame according to the length value of the to-be-identified video frame.
本发明实施例还提供了一种视频帧类型的识别方法, 可以包括以下步骤: ( 1 )接收待识别的视频帧;  The embodiment of the present invention further provides a method for identifying a video frame type, which may include the following steps: (1) receiving a video frame to be identified;
( 2 )获得所述接收到的待识别视频帧的长度值或者大小;  (2) obtaining a length value or a size of the received video frame to be identified;
( 3 )根据所述待识别视频帧的长度值或者大小确定所述待识别视频帧的 类型。  (3) determining a type of the to-be-identified video frame according to a length value or a size of the to-be-identified video frame.
发明人发现, 不同类型的视频帧的长度值或者大小存在一定的区别, 可以 利用这种区别识别视频帧的类型。 例如, 在帧率相同的情况下, B帧的最大值 一般小于 P帧的最小值, 而 P帧的最大值一般小于 I帧的最小值。 因此可以利 用这个视频帧的大小来识别视频帧的类型。  The inventors have found that there are certain differences in the length values or sizes of different types of video frames, and the difference can be used to identify the type of video frames. For example, in the case of the same frame rate, the maximum value of the B frame is generally smaller than the minimum value of the P frame, and the maximum value of the P frame is generally smaller than the minimum value of the I frame. Therefore, the size of this video frame can be used to identify the type of video frame.
其具体实施方式, 例如:  Specific embodiments thereof, for example:
确定第一阈值和第二阈值, 所述第一阈值为介于 B帧长度值和 P帧长度 值之间的数值, 所述第二阈值为介于 P帧长度值和 I帧长度值之间的数值; 当所述视频帧的长度值小于或等于第一阈值时,或者, 当所述视频帧的长 度值小于或等于第一阈值且小于 B帧的最大值时, 判定所述视频帧为 B帧; 当所述视频帧的长度值大于等于第二阈值时,或者, 当所述视频帧的长度值大 于或等于第二阈值且大于 I帧的最小值时, 判定所述视频帧为 I帧; 当所述视 频帧的长度值大于所述第一阈值且小于所述第二阈值时, 判定所述视频帧为 P 帧。  Determining a first threshold and a second threshold, where the first threshold is a value between a B frame length value and a P frame length value, and the second threshold is between a P frame length value and an I frame length value The value of the video frame is determined when the length value of the video frame is less than or equal to the first threshold, or when the length value of the video frame is less than or equal to the first threshold and less than the maximum value of the B frame. B frame; when the length value of the video frame is greater than or equal to the second threshold, or when the length value of the video frame is greater than or equal to the second threshold and greater than the minimum value of the I frame, determining that the video frame is I a frame; when the length value of the video frame is greater than the first threshold and less than the second threshold, determining that the video frame is a P frame.
第一阈值在当前码率的抖动比较小或者没有发生变动的情况下,是保持不 变的, 为介入本周期之内 B帧最大值和 P帧最小值之间的一个值。  The first threshold value remains unchanged when the jitter of the current code rate is relatively small or does not change, and is a value between the maximum value of the B frame and the minimum value of the P frame within the current period.
为了获取第一阈值, 识别 B 帧的类型, 可通过如下方法实现: 确定当前 周期; 统计所述当前周期内接收的视频帧长度的第一平均值; 将比较第一系数 乘以所述第一平均值所得到数值与 B 帧的最大值的大小, 将两者中的最小值 设为所述第一阈值。 当所述视频帧的长度值小于所述第一阈值时, 判定所述视 频帧为 B帧, 其中, 0< 第一系数<0.6, 并在 H.263、 MPEG4、 H.264的编码 方式中依次递减。 In order to obtain the first threshold, identifying the type of the B frame may be implemented by: determining a current period; counting a first average value of the length of the received video frame in the current period; comparing the first coefficient The value obtained by multiplying the first average value and the maximum value of the B frame are set to the first threshold value. When the length value of the video frame is smaller than the first threshold, determining that the video frame is a B frame, where 0<first coefficient <0.6, and in the encoding mode of H.263, MPEG4, H.264 Decrease in turn.
第二阈值在码率的抖动比较小或者没有发生变动的情况下,也是保持不变 的, 为介入本周期之内 I帧最小值和 P帧最大值之间的一个值。  The second threshold is also constant when the jitter of the code rate is relatively small or does not change, and is a value between the minimum value of the I frame and the maximum value of the P frame within the current period.
为了获取第二阈值, 识别 I帧的类型, 可通过如下方法实现: 确定当前周 期; 统计所述当前周期内接收的视频帧长度的第一平均值; 比较第二系数乘以 所述第一平均值所得到的数值与预设的 I帧最小阈值的大小,将两者中的最大 值设为所述第二阈值, 当所述视频帧的长度值大于所述第二阈值时, 判定所述 视频帧为 I帧, 其中, 2<第二系数<4, 并在 H.263、 MPEG4、 H.264的编码方 式中依次递增。  In order to obtain the second threshold, identifying the type of the I frame may be implemented by: determining a current period; counting a first average of the length of the received video frame in the current period; comparing the second coefficient by the first average The value obtained by the value and the preset minimum threshold of the I frame, and the maximum value of the two is set as the second threshold. When the length value of the video frame is greater than the second threshold, determining the The video frame is an I frame, where 2 <the second coefficient <4, and is sequentially incremented in the encoding modes of H.263, MPEG4, and H.264.
其中, 当前周期通常与码率的变化情况有关, 当码率的抖动比较严重或者 当码率发生变化时, 当前周期需要进行相应的变化, 以便能够更准确的进行视 频帧类型的识别。 当前周期的开始时刻可以设为上一个周期的结束时刻, 当前 周期的结束时刻可以设为码率发生变动之前的一个时刻, 或者更短。  The current period is usually related to the change of the code rate. When the jitter of the code rate is serious or when the code rate changes, the current period needs to be changed accordingly, so that the video frame type can be more accurately identified. The start time of the current cycle can be set to the end time of the previous cycle, and the end time of the current cycle can be set to a time before the code rate is changed, or shorter.
当前周期的确定过程包括, 例如: 为所述当前周期设置一个初始周期值; 估算在所述初始周期内连续接收的 B帧个数和连续接收的 I帧个数;如果所述 t 第三阈值  The determining process of the current period includes, for example: setting an initial period value for the current period; estimating the number of consecutively received B frames and the number of consecutively received I frames in the initial period; if the tth third threshold
连续接收的 B帧个数大于第三阈值, 将所述当前周期更新为 ~视频帧的帧率 , 所述 tl为从所述初始周期计时开始到发现连续接收的 B帧个数大于第三阈值 时所持续的时间, 所述第三阈值为码率不变的情况下连续出现 B 帧的最大个 数; 或者, 如果所述连续接收的 I帧个数大于第四阈值, 将所述当前周期更新 为 n , 其中, 所述 t2为从初始周期计时开始到发现连续接收的 I 视频帧的帧率 帧个数大于第四阈值时所持续的时间,所述第四阈值为码率不变的情况下连续 出现 I帧的最大个数。 其中,所述估算初始周期内连续接收的 B帧个数和连续接收的 I帧个数包 括: 统计在所述初始周期内接收的视频帧长度的第二平均值; 统计在所述初始 周期内,将连续接收的长度小于第一系数与所述第二平均值的乘积的视频帧的 个数作为 B 帧的个数; 统计在所述初始周期内, 将连续接收的长度大于第二 系数与所述第二平均值的乘积的视频帧的个数作为 I帧的个数。 The number of continuously received B frames is greater than a third threshold, and the current period is updated to a frame rate of the video frame, where the t1 is from the initial period to the discovery that the number of consecutively received B frames is greater than a third threshold. The duration of the time period, the third threshold is the maximum number of consecutive B frames when the code rate is unchanged; or, if the number of consecutively received I frames is greater than the fourth threshold, the current period is The update is n , where the t 2 is a time duration from when the initial period is counted until the number of frame rate frames of the I video frame that are continuously received is greater than the fourth threshold, and the fourth threshold is the same as the code rate. Continuous situation The maximum number of I frames appears. The estimating the number of consecutively received B frames and the number of consecutively received I frames includes: calculating a second average value of video frame lengths received in the initial period; and counting in the initial period And continuously counting the number of video frames whose length is smaller than the product of the first coefficient and the second average is used as the number of B frames; in the initial period, the length of the continuous reception is greater than the second coefficient and The number of video frames of the product of the second average is taken as the number of I frames.
对于第一系数和第二系数, 可以依据经验确定一个合适的值。 第一系数与 第二系数的大小与编码方式是相关的,对于采用同一种编码格式的不同视频文 件, 他们的第一系数一般情况下是相等的, 第二系数一般情况下也是相等的, 因此也可以事先通过解析不同编码方式的视频文件的视频帧的头部信息,来确 定不同编码方式所对应的第一系数和第二系数。 而 I帧最小阈值是在一个视频 文件中 I帧的长度所能够出现的最小值,而 B帧最大阈值指一个视频文件中 B 帧的长度能够出现的最大值, 对应于同一种编码方式的不同视频文件, 其 I帧 最小阈值和 B 帧最大阈值应该是相同的, 这两个值可以事先通过解析不同编 码方式的文件获得。  For the first coefficient and the second coefficient, an appropriate value can be determined empirically. The size of the first coefficient and the second coefficient are related to the encoding mode. For different video files using the same encoding format, their first coefficients are generally equal, and the second coefficients are generally equal, therefore The first coefficient and the second coefficient corresponding to different coding modes may also be determined by parsing the header information of the video frame of the video file of different coding modes in advance. The minimum threshold of the I frame is the minimum value of the length of the I frame in a video file, and the maximum threshold of the B frame refers to the maximum value of the length of the B frame in a video file, which corresponds to the same coding mode. For a video file, the I frame minimum threshold and the B frame maximum threshold should be the same. These two values can be obtained by parsing files of different encoding methods in advance.
本发明实施例还可以通过其它方式得到第一阈值和第二阈值。 比如, 可以 先通过解析头部信息的方式, 获取 P帧的最大值和最小值, I帧的最小值, B 帧的最大值,然后在 I帧的最小值和 P帧的最大值之间选择一个值作为第一阈 值, 取 B帧的最大值和 P帧的最小值之间的一个值作为第二阈值, 然后再计 算出第一系数和第二系数。  The first threshold and the second threshold may also be obtained by other embodiments in the embodiment of the present invention. For example, you can first obtain the maximum and minimum values of the P frame, the minimum value of the I frame, the maximum value of the B frame, and then select between the minimum value of the I frame and the maximum value of the P frame by parsing the header information. A value is used as the first threshold, and a value between the maximum value of the B frame and the minimum value of the P frame is taken as the second threshold, and then the first coefficient and the second coefficient are calculated.
由上述实施例可以看出, 由于不同类型的视频帧的长度是不同的, 网络侧 利用视频帧的长度来识别视频帧的类型,不需要对每个视频帧的头部信息进行 解析, 从而节省了网络开销。 实施例二  It can be seen from the foregoing embodiment that, since the lengths of different types of video frames are different, the network side uses the length of the video frame to identify the type of the video frame, and does not need to parse the header information of each video frame, thereby saving The network overhead. Embodiment 2
请参阅图 2, 图 2为本发明实施例二揭示的一种视频帧类型的识别方法的 流程图, 该方法包括以下步骤:  Referring to FIG. 2, FIG. 2 is a flowchart of a method for identifying a video frame type according to Embodiment 2 of the present invention, where the method includes the following steps:
步骤 201 : 确定当前周期。 其中, 当前周期通常与码率的变化情况有关, 当码率发生变化时, 当前周 期需要进行相应的变化, 以便能够更准确的进行视频帧类型的识别。 Step 201: Determine the current period. The current period is usually related to the change of the code rate. When the code rate changes, the current period needs to be changed accordingly, so that the video frame type can be identified more accurately.
请参见图 4, 为当前周期的确定方法, 具体包括以下步骤。  Please refer to FIG. 4, which is a method for determining the current period, and specifically includes the following steps.
步骤 401 : 为所述当前周期设置一个初始周期值;  Step 401: Set an initial period value for the current period;
其中,所述初始周期值可以是上一个周期值,或是预先设定的系统默认值, 该系统默认值是参考视频文件 GOP长度和帧率综合来确定的,一般选择 Is左 右, 但本发明实施例不限于该值。  The initial period value may be a previous period value, or a preset system default value. The system default value is determined by combining a reference video file GOP length and a frame rate, and generally, Is is selected, but the present invention Embodiments are not limited to this value.
步骤 402: 将参数 i和参数 j分别设为 0, 其中, 参数 i用于统计连续出现 B帧的数, 参数 j用于统计连续出现 I帧的个数;  Step 402: Set parameter i and parameter j to 0 respectively, where parameter i is used to count the number of consecutive B frames, and parameter j is used to count the number of consecutive I frames;
步骤 403: 统计初始周期值内所接收到的视频帧长度值的平均值; 其中, 在初始周期值内所接收到的视频帧长度值的平均值的计算公式为:  Step 403: The average value of the received video frame length values in the initial period value is calculated. The calculation formula of the average value of the received video frame length values in the initial period value is:
Nme =初始周期值内所接收到的 SDU的总长度值 /初始周期内所接收到的视频 帧的总数量。 N me = total length of the received SDU within the initial period value / total number of video frames received during the initial period.
步骤 404: 依次统计初始周期内所接收的视频帧的长度 N/ram ; 本步骤为一个循环过程。从初始周期开始,依次计算接受到的视频帧的长 度值, 一个视频帧处理完毕之后, 继续接收下一个视频帧, 直到初始周期内的 全部视频帧全部被处理完毕。 如果循环过程中, 参数 i大于第三阈值或者参数 j大于第四阈值, 说明码率发生变动, 则更新当前周期的值, 并中止本步骤的 循环。 Step 404: The length N /ram of the received video frame in the initial period is sequentially counted; this step is a loop process. Starting from the initial period, the length values of the received video frames are sequentially calculated. After processing one video frame, the next video frame continues to be received until all video frames in the initial period are processed. If the parameter i is greater than the third threshold or the parameter j is greater than the fourth threshold during the loop, indicating that the code rate changes, the value of the current period is updated, and the loop of this step is suspended.
视频帧的长度值可以通过将属于同一视频帧的 SDU相加求出来。 除了使 用视频帧边界识别的方法识别出属于当前统计周期内接收的各个视频帧的 SDU 并进行视频帧的组合之外, 还可以在发送端将同一个视频帧分割出来的 RTP 包中插入具有相同时间戳的帧标识, 网络侧根据帧标识进行视频帧的组 合。  The length value of the video frame can be found by adding the SDUs belonging to the same video frame. In addition to using the video frame boundary recognition method to identify the SDUs belonging to each video frame received in the current statistical period and combining the video frames, the same RTP packet divided into the same video frame may be inserted into the same at the transmitting end. The frame identifier of the timestamp, and the network side performs video frame combination according to the frame identifier.
步骤 405: 判断初始周期内所接收的视频帧的长度是否小于第一系数与初 始周期内接收的视频帧长度的平均值的乘积,如果是,进入步骤 406,如果否, 进入步骤 408; 步骤 406: 将参数 i加 1 , j设为 0; Step 405: Determine whether the length of the received video frame in the initial period is less than the product of the first coefficient and the average of the length of the received video frame in the initial period, and if so, proceeds to step 406, and if no, proceeds to step 408; Step 406: Add parameter i to 1, and j to 0;
步骤 407: 判断参数 i是否大于第三阈值, 如果是, 进入步骤 411 , 如果 否, 返回步骤 404, 计算下一个视频帧的长度值, 继续判断下一个视频帧, 直 到所述初始周期内的所有视频帧全部判断完毕;  Step 407: Determine whether the parameter i is greater than the third threshold. If yes, go to step 411. If no, return to step 404, calculate the length value of the next video frame, and continue to judge the next video frame until all the initial periods. The video frames are all judged;
其中, 第三阈值由文件类型以及编码量化因子综合确定, 本实施例的优选 值为 6, 但本发明不限于该值。  The third threshold is determined by the file type and the coding quantization factor. The preferred value of this embodiment is 6, but the present invention is not limited to this value.
步骤 408: 判断该视频帧是否大于第二系数与初始周期内接收的视频帧长 度值的平均值的乘积, 如果是, 进入步骤 409; 如果否, 返回步骤 404, 继续 判断下一个视频帧, 直到所述初始周期内的所有视频帧全部判断完毕;  Step 408: Determine whether the video frame is greater than a product of the second coefficient and an average value of the received video frame length values in the initial period. If yes, go to step 409; if no, return to step 404 to continue to determine the next video frame until All the video frames in the initial period are judged;
步骤 409: 将参数 j加 1 , i设为 0;  Step 409: Add parameter j to 1 and set i to 0;
步骤 410: 判断参数 j是否大于第四阈值, 如果是, 进入步骤 412; 如果 否, 返回步骤 405 , 继续判断下一个视频帧, 直到所述初始周期内的所有视频 帧全部判断完一 -, 值为 6, 但本发明不限于该值。 步骤 411: 结束本次循环; Step 410: Determine whether the parameter j is greater than the fourth threshold, and if yes, proceed to step 412; if no, return to step 405 to continue to determine the next video frame until all video frames in the initial period are judged to be one-, value It is 6, but the invention is not limited to this value. Step 411: End this cycle;
Figure imgf000009_0001
其中,视频帧的帧率为视频帧的播放速率,单位时间内播放的视频帧的数 目, 用 表示, 当参数 i大于第三阈值时, 认为码率发生抖动, 码率变动之 后视频帧的长度值会发生显著变化, 此时, 需要对当前周期的值进行相应的更 新, 而不能够采用初始周期值。 t 第四阈值
Figure imgf000009_0001
The frame rate of the video frame is the playback rate of the video frame, and the number of video frames played in a unit time is used to indicate that when the parameter i is greater than the third threshold, the code rate is considered to be jittered, and the length of the video frame after the code rate is changed. The value will change significantly. In this case, the value of the current period needs to be updated accordingly, and the initial period value cannot be used. t fourth threshold
步骤 412: 当前周期为 ^ _视频帧的帧率 , 结束本次循环; 其中, 当参数 j大于第四阈值时, 认为码率发生抖动, 需要对当前周期进 行相应的变化, 而不能够采用初始周期值。  Step 412: The current period is the frame rate of the video frame, and the current loop is ended. When the parameter j is greater than the fourth threshold, the code rate is considered to be jittered, and the current period needs to be changed accordingly, and the initial period cannot be adopted. Period value.
当在上述步骤 411、 412、 中的任意一个步骤确定了当前周期的值, 如果 步骤 411、 412没有执行则使用步骤 401所确定的当前周期值, 返回到识别视 频帧类型的流程中, 继续执行步骤 202。 When the value of the current period is determined in any of the above steps 411, 412, if the steps 411, 412 are not executed, the current period value determined in step 401 is used to return to the identification view. In the flow of the frequency frame type, step 202 is continued.
步骤 202: 网络侧在所确定的当前周期内接收 SDU ( Service Data Unit, 服务数据单元);  Step 202: The network side receives an SDU (Service Data Unit) in the determined current period.
其中, 流媒体视频业务使用的传输协议有 RTP ( Real-time Transport Protocol, 实时传输协议)、 RTCP ( RTP Control Protocol, RTP控制协议)和 RTSP ( Real-Time Streaming Protocol, 实时流媒体协议), 承载音频、 视频数据 的协议是 RTP。 发送端将一个视频帧分为若干个 RTP包, 这些应用层的 RTP 包以 SDU作为载体在网络侧进行传输, 请参阅图 3 , 图 3为现有技术中视频 帧的分包与承载示意图。  The transport protocols used by the streaming video service include RTP (Real-Time Transport Protocol), RTP (RTP Control Protocol), and Real-Time Streaming Protocol (RTSP). The protocol for audio and video data is RTP. The sender divides a video frame into several RTP packets. The RTP packets of these application layers are transmitted on the network side by using the SDU as a carrier. Referring to FIG. 3, FIG. 3 is a schematic diagram of packetization and bearer of a video frame in the prior art.
步骤 203: 统计当前周期内接收到的视频帧长度值的平均值;  Step 203: Count an average value of length values of video frames received in the current period;
可以根据当前周期内接收到的 SDU的总长度值和视频帧的总数量,其中, 当前周期内接收的视频帧长度的平均值的计算公式为: =当前周期内接收 到的 SDU的总长度值 /当前周期内接收到的视频帧的总数量。 例如,在当前周期内,网络侧接收到 2个视频帧, SDU的总长度为 lObyte, 则 Wme = 10/2=5byte。 步骤 204: 依次统计当前周期内各个视频帧的长度值。 The total length value of the received SDU and the total number of video frames in the current period may be calculated according to the following: The average value of the received video frame length in the current period is: = the total length of the received SDU in the current period / The total number of video frames received during the current period. For example, in the current period, the network side receives 2 video frames, and the total length of the SDU is 10 bytes, then W me = 10/2=5 bytes . Step 204: The length values of the respective video frames in the current period are sequentially counted.
通过视频帧边界识别的方法识别出属于当前周期内接收的各个视频帧的  Identifying each video frame that belongs to the current period by the method of video frame boundary recognition
SDU, 把各个视频帧的 SDU 的长度值进行相加, 获得各个视频帧的长度值The SDU adds the length values of the SDUs of the video frames to obtain the length values of the video frames.
Nf 上述步骤中,除了使用视频帧边界识别的方法识别出属于当前周期内接收 的各个视频帧的 SDU并进行视频帧的组合之外, 还可以在发送端将同一个视 频帧分割出来的 RTP 包中插入具有相同时间戳的帧标识, 网络侧根据帧标识 进行视频帧的组合。 N f the above step, in addition to the method using the video frame boundary identification belonging to the identified SDU than the respective video frame received in the current cycle and the combined video frame, may also be segmented in the same video frame at the transmitting side RTP A frame identifier having the same time stamp is inserted into the packet, and the network side performs video frame combination according to the frame identifier.
本步骤为一个循环的过程, 当一个视频帧的类型识别完毕之后, 继续计算 出下一个视频帧的长度值, 并识别类型, 直到当前周期内所有的视频帧类型都 识别完毕。 步骤 205: 判断当前周期内接收到的一个视频帧长度的平均值是否小于或 等于第一阈值, 如果是, 进入步骤 206, 如果否, 进入步骤 207; This step is a cyclic process. After the type of a video frame is recognized, the length value of the next video frame is continuously calculated, and the type is identified until all the video frame types in the current period are recognized. Step 205: determining whether the average value of the length of a video frame received in the current period is less than or equal to the first threshold, and if so, proceeding to step 206, if no, proceeding to step 207;
步骤 206: 判定该视频帧为 B帧, 返回步骤 204, 继续判断当前周期内所 接收的下一个视频帧, 直到当前周期接收的所有视频帧判断完毕;  Step 206: Determine that the video frame is a B frame, return to step 204, and continue to determine the next video frame received in the current period, until all the video frames received in the current period are judged;
其中, 当对当前周期内所接收的所有视频帧的类型判断完毕后, 回到步骤 201 , 继续确定下一个周期值, 并继续判断在下一个周期内所接收的视频帧的 类型, 直到所有视频帧的类型全部判断完毕为止。  After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
步骤 207:判断该视频帧是否大于或等于第二阈值,如果是,进入步骤 208 , 如果否, 进入步骤 209;  Step 207: Determine whether the video frame is greater than or equal to the second threshold, and if so, proceed to step 208, if no, proceed to step 209;
步骤 208: 判定该视频帧为 I帧, 返回步骤 204, 继续判断当前周期内所 接收的下一个视频帧, 直到当前周期接收的所有视频帧判断完毕;  Step 208: Determine that the video frame is an I frame, return to step 204, and continue to determine the next video frame received in the current period, until all the video frames received in the current period are judged;
其中, 当对当前周期内所接收的所有视频帧的类型判断完毕后, 回到步骤 201 , 继续确定下一个周期值, 并继续判断在下一个周期内所接收的视频帧的 类型, 直到所有视频帧的类型全部判断完毕为止。  After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
步骤 209: 判定该视频帧为 P帧, 返回步骤 204, 继续判断当前周期内所 接收的下一个视频帧, 直到当前周期接收的所有视频帧判断完毕。  Step 209: Determine that the video frame is a P frame, and return to step 204 to continue to determine the next video frame received in the current period until all video frames received in the current period are judged.
其中, 当对当前周期内所接收的所有视频帧的类型判断完毕后, 回到步骤 201 , 继续确定下一个周期值, 并继续判断在下一个周期内所接收的视频帧的 类型, 直到所有视频帧的类型全部判断完毕为止。  After determining the type of all the video frames received in the current period, return to step 201, continue to determine the next period value, and continue to determine the type of the received video frame in the next period until all video frames All types are judged.
当网络侧识别出视频帧的类型后,还可以根据预先为每种类型的视频帧所 设定的优先级,对优先级高的视频帧进行优先处理,从而保证优先级别高的视 频帧的传输质量。  After the network side identifies the type of the video frame, the video frame with the higher priority can be preferentially processed according to the priority set for each type of video frame in advance, thereby ensuring the transmission of the video frame with the higher priority. quality.
由上述实施例可以看出, 不同类型的视频帧的长度是不同的, 网络侧将当 前统计周期内获得的各个视频帧的长度 N 分别与第一阈值和第二阈值进行 比较,当 小于第一阈值时,判定与所述 W自 6对应的视频帧为 B帧,当 N 大于第二阈值时,判定与所述 对应的视频帧为 I帧, 当上述两个条件都不 满足时, 判定与所述 W™ 对应的视频帧为 P帧, 从而在节省网络开销的基础 上实现了视频帧类型的识别,进而网络侧可以根据视频帧的类型对视频帧分别 进行与帧类型相对应的处理。 同时, 网络侧根据视频帧的类型对不同类型的视 频帧进行与其类型相对应的分析及处理 ,保证无线网络更好的承载流媒体视频 业务。 实施例三 It can be seen from the foregoing embodiment that the lengths of different types of video frames are different, and the network side compares the lengths N of the video frames obtained in the current statistical period with the first threshold and the second threshold respectively, which is smaller than the first At the threshold value, it is determined that the video frame corresponding to the W from 6 is a B frame, and when N is greater than the second threshold, it is determined that the corresponding video frame is an I frame, and when the above two conditions are not satisfied, the determination is The video frame corresponding to the WTM is a P frame, thereby saving the network overhead. The identification of the video frame type is implemented, and the network side can separately process the video frame according to the type of the video frame. At the same time, the network side performs analysis and processing on different types of video frames according to the type of the video frame to ensure that the wireless network better carries the streaming video service. Embodiment 3
请参阅图 5 , 图 5本发明实施例三揭示的一种视频类型的识别装置的结构 图, 该装置包括第一统计单元 501和识别单元 502。 下面结合该装置的工作原 理进一步介绍其内部结构以及作用关系。  Referring to FIG. 5, FIG. 5 is a structural diagram of a video type identification apparatus according to Embodiment 3 of the present invention, where the apparatus includes a first statistical unit 501 and an identification unit 502. The internal structure and the relationship are further described below in conjunction with the working principle of the device.
第一统计单元 501 , 用于统计待识别视频帧的长度值;  a first statistic unit 501, configured to calculate a length value of the video frame to be identified;
其中, 第一统计单元 501包括:  The first statistical unit 501 includes:
接收单元, 用于接收服务数据单元 SDU; 识别单元, 用于识别出属于同 一个视频帧的 SDU;  a receiving unit, configured to receive a service data unit SDU; an identifying unit, configured to identify an SDU belonging to the same video frame;
求和单元, 用于将所述属于同一个视频帧的 SDU的长度值相加求和。 识别单元 502, 用于根据所述第一统计单元 501统计的待识别视频帧的长 度值识别所述待识别视频帧的类型。  And a summing unit, configured to add and sum the length values of the SDUs belonging to the same video frame. The identifying unit 502 is configured to identify, according to the length value of the video frame to be identified that is counted by the first statistic unit 501, the type of the video frame to be identified.
识别单元 502进一步包括:  The identification unit 502 further includes:
第一确定单元 5021、 第二确定单元 5022、 帧类型判断单元 5023。  The first determining unit 5021, the second determining unit 5022, and the frame type determining unit 5023.
第一确定单元 5021 , 用于确定第一阈值, 所述第一阈值为介于 B帧长度 值和 P帧长度值之间的数值;  The first determining unit 5021 is configured to determine a first threshold, where the first threshold is a value between a B frame length value and a P frame length value;
其中, 在一个具体的实施场景下, 所述第一确定单元 5021还可包括: 当 前周期确定单元, 用于确定当前周期; 第二统计单元, 用于统计所述当前周期 确定单元所确定的当前周期内接收的视频帧长度的平均值作为第一平均值;第 一设置单元, 用于比较第一系数乘以所述第一平均值所得到数值与预设的 B 帧最大阈值的大小, 将两者中的最小值设为所述第一阈值。  In a specific implementation scenario, the first determining unit 5021 may further include: a current period determining unit, configured to determine a current period; and a second statistic unit, configured to collect a current current determined by the current period determining unit The average value of the length of the received video frame is used as a first average value; the first setting unit is configured to compare the value obtained by multiplying the first coefficient by the first average value with the preset maximum threshold value of the B frame, and The minimum of the two is set to the first threshold.
第二确定单元 5022, 用于确定第二阈值, 所述第二阈值为介于 P帧长度 值和 I帧长度值之间的数值; 其中, 在一个具体的实施场景下, 所述第二确定单元 5022还可以包括: 当前周期确定单元, 用于确定当前周期; 第二统计单元, 用于统计所述当前周 期确定单元所确定的当前周期内接收的视频帧长度的平均值作为第一平均;第 二设置单元, 用于比较第二系数乘以所述第一平均值所得到的数值与预设的 I 帧最小阈值的大小, 将两者中的最大值设为所述第二阈值。 a second determining unit 5022, configured to determine a second threshold, where the second threshold is a value between a P frame length value and an I frame length value; The second determining unit 5022 may further include: a current period determining unit, configured to determine a current period; and a second statistic unit, configured to collect a current current determined by the current period determining unit, in a specific implementation scenario. The average value of the length of the received video frame in the period is used as a first average; the second setting unit is configured to compare the value obtained by multiplying the second coefficient by the first average value with a preset minimum threshold value of the I frame, The maximum of the two is set to the second threshold.
上述当前周期确定单元包括: 预设单元, 用于为所述当前周期设置一个初 始周期值; 估算单元, 用于估算在所述初始周期内连续接收的 B 帧个数和连 续接收的 I帧个数; 第一更新单元, 用于如果所述估算单元估算的连续接收的 t 第三阈值  The current period determining unit includes: a preset unit, configured to set an initial period value for the current period; and an estimating unit, configured to estimate a number of consecutively received B frames in the initial period and consecutively received I frames a first update unit, configured to determine a continuously received t third threshold if the estimating unit estimates
B帧个数大于第三阈值, 将所述当前周期更新为^ 视频帧的帧率, 所述 tl为从 所述初始周期计时开始到发现连续接收的 B 帧个数大于第三阈值时所持续的 时间, 所述第三阈值为码率不变的情况下连续出现 B 帧的最大个数; 第二更 新单元, 用于如果所述估算单元估算的连续接收的 I帧个数大于第四阈值, 将 t 第四阈值  The number of B frames is greater than a third threshold, and the current period is updated to a frame rate of the video frame, where the t1 is continued from the initial period counting until the number of consecutively received B frames is greater than a third threshold. The third threshold is the maximum number of consecutive B frames in the case where the third threshold is the same as the code rate; the second updating unit is configured to: if the estimating unit estimates the number of continuously received I frames is greater than the fourth threshold , will t the fourth threshold
所述当前周期更新为 视频帧的帧率, 其中, 所述 t2为从初始周期计时开始 到发现连续接收的 I帧个数大于第四阈值时所持续的时间,所述第四阈值为码 率不变的情况下连续出现 I帧的最大个数。 The current period is updated to a frame rate of a video frame, where the t2 is a time period from when the initial period is counted to when the number of consecutively received I frames is greater than a fourth threshold, and the fourth threshold is a code rate. The maximum number of consecutive I frames occurs without change.
在一个具体的实施场景下, 上述估算单元还可以包括: 第三统计单元, 用 于统计在所述初始周期内接收的视频帧长度的平均值作为第二平均值;第四统 计单元, 用于统计在所述初始周期内, 将连续接收的长度小于第一系数与所述 第二平均值的乘积的视频帧的个数作为 B 帧的个数; 第五统计单元, 用于统 计在所述初始周期内,将连续接收的长度大于第二系数与所述第二平均值的乘 积的视频帧的个数作为 I帧的个数。  In a specific implementation scenario, the foregoing estimating unit may further include: a third statistic unit, configured to collect an average value of video frame lengths received in the initial period as a second average value; and a fourth statistic unit, configured to: Counting, in the initial period, the number of consecutively received video frames whose length is smaller than the product of the first coefficient and the second average is the number of B frames; the fifth statistical unit is used for statistics in the In the initial period, the number of consecutively received video frames whose length is greater than the product of the second coefficient and the second average value is taken as the number of I frames.
帧类型判断单元 5023 , 用于当所待识别述视频帧小于或等于所述第一阈 值时, 判定所述待识别视频帧为 B 帧; 当所述待识别视频帧大于或等于所述 第二阈值时, 判定所述待识别的视频帧为 I帧; 当所述待识别视频帧大于所述 第一阈值且小于所述第二阈值时, 判定所述待识别视频帧为 P帧。 本发明实施例还提供了一种视频类型的识别装置, 可以包括: The frame type determining unit 5023 is configured to: when the video frame to be identified is less than or equal to the first threshold, determine that the to-be-identified video frame is a B frame; and when the to-be-identified video frame is greater than or equal to the second threshold Determining that the video frame to be identified is an I frame; when the video frame to be identified is larger than the When the first threshold is smaller than the second threshold, it is determined that the to-be-identified video frame is a P frame. The embodiment of the invention further provides a video type identification device, which may include:
接收单元, 用于接收待识别的视频帧;  a receiving unit, configured to receive a video frame to be identified;
第一统计单元, 用于获得所述接收到的待识别视频帧的长度值或者大小; 确定单元,用于根据所述第一统计单元统计的待识别视频帧的长度值或者 大小确定所述待识别视频帧的类型。  a first statistic unit, configured to obtain a length value or a size of the received video frame to be identified, and a determining unit, configured to determine, according to a length value or a size of the video frame to be identified that is counted by the first statistic unit Identify the type of video frame.
所述确定单元包括:  The determining unit includes:
第一确定单元, 用于确定第一阈值, 所述第一阈值为介于 B帧最大值和 P 帧最小值之间的数值;  a first determining unit, configured to determine a first threshold, where the first threshold is a value between a B frame maximum value and a P frame minimum value;
第二确定单元, 用于确定第二阈值, 所述第二阈值为介于 P帧最大值和 I 帧最小值之间的数值;  a second determining unit, configured to determine a second threshold, where the second threshold is a value between a maximum value of the P frame and a minimum value of the I frame;
帧类型判断单元,用于当所述待识别视频帧的长度值或者大小不大于所述 第一阈值时, 或者, 当所述视频帧的长度值或者大小不大于第一阈值且小于 B 帧的最大值时, 判定所述待识别视频帧为 B 帧; 当所述待识别视频帧的长度 值或者大小不小于所述第二阈值时,或者, 当所述视频帧的长度值或者大小不 小于第二阈值且大于 I帧的最小值时, 判定所述待识别视频帧为 I帧; 当所述 待识别视频帧的长度值或者大小大于所述第一阈值且小于所述第二阈值时,判 定所述待识别视频帧为 P帧。  a frame type determining unit, configured to: when a length value or a size of the to-be-identified video frame is not greater than the first threshold, or when a length value or a size of the video frame is not greater than a first threshold and less than a B frame Determining, when the maximum value, the video frame to be identified is a B frame; when the length value or the size of the to-be-identified video frame is not less than the second threshold, or when the length or size of the video frame is not less than When the second threshold is greater than the minimum value of the I frame, the video frame to be identified is determined to be an I frame; when the length value or the size of the to-be-identified video frame is greater than the first threshold and less than the second threshold, Determining that the to-be-identified video frame is a P-frame.
所述第一确定单元, 进一步包括:  The first determining unit further includes:
当前周期确定单元, 用于确定当前周期;  a current period determining unit, configured to determine a current period;
第二统计单元,用于统计所述当前周期确定单元所确定的当前周期内接收 的视频帧长度值或者大小的平均值, 并将所述平均值作为第一平均值;  a second statistic unit, configured to collect an average value of a video frame length value or a size received in the current period determined by the current period determining unit, and use the average value as a first average value;
第一设置单元, 用于比较第一系数乘以所述第一平均值所得到数值与 B 帧的最大值的大小, 将两者中的最小值设为所述第一阈值。  And a first setting unit, configured to compare a value obtained by multiplying the first coefficient by the first average value and a maximum value of the B frame, and setting a minimum value of the two as the first threshold.
所述第二确定单元, 进一步包括:  The second determining unit further includes:
当前周期确定单元, 用于确定当前周期;  a current period determining unit, configured to determine a current period;
第二统计单元,用于统计所述当前周期确定单元所确定的当前周期内接收 的视频帧长度的的平均值, 并将所述平均值作为第一平均值; 第二设置单元,用于比较第二系数乘以所述第一平均值所得到的数值与预 设的 I帧最小值的大小, 将两者中的最大值设为所述第二阈值。 a second statistic unit, configured to collect an average value of lengths of video frames received in a current period determined by the current period determining unit, and use the average value as a first average value; And a second setting unit, configured to compare a value obtained by multiplying the second coefficient by the first average value with a minimum value of a preset I frame minimum value, and setting a maximum value of the two as the second threshold value.
由上述实施例可以看出, 当第一统计单元统计了视频帧的长度后, 由识别 单元利用第一统计单元统计的视频帧长度对视频帧的类型进行判定,当所述视 频帧小于或等于第一阈值时, 判定所述视频帧为 B 帧; 当所述视频帧大于或 等于第二阈值时, 判定所述视频帧为 I帧; 当所述视频帧大于所述第一阈值且 小于所述第二阈值时,判定所述视频帧为 P帧。避免了网络对每个视频帧的头 部信息进行解析所带来的浪费网络开销问题。 同时, 网络侧根据视频帧的类型 对不同类型的视频帧进行与其类型相对应的分析及处理,保证无线网络更好的 承载流媒体视频业务。  As can be seen from the foregoing embodiment, after the first statistic unit counts the length of the video frame, the identification unit determines the type of the video frame by using the length of the video frame counted by the first statistic unit, when the video frame is less than or equal to Determining, by the first threshold, that the video frame is a B frame; when the video frame is greater than or equal to a second threshold, determining that the video frame is an I frame; when the video frame is greater than the first threshold and less than When the second threshold is described, it is determined that the video frame is a P frame. It avoids the wasted network overhead caused by the network parsing the header information of each video frame. At the same time, the network side performs analysis and processing on different types of video frames according to the type of the video frame to ensure that the wireless network better carries the streaming video service.
本发明实施例还可应用于视频质量评估, 视频质量保障等领域。  The embodiments of the present invention can also be applied to the fields of video quality assessment, video quality assurance, and the like.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于一计算机可 读取存储介质中, 该程序包括如下步骤: 接收待识别的视频帧并统计所述待识 别视频帧的大小; 根据所述待识别视频帧的大小识别所述待识别视频帧的类 型。 所述的存储介质, 如: ROM/RAM、 磁碟、 光盘等。  One of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments may be completed by a program instructing related hardware, and the program may be stored in a computer readable storage medium, and the program includes the following Step: receiving a video frame to be identified and collecting a size of the to-be-identified video frame; and identifying a type of the to-be-identified video frame according to the size of the to-be-identified video frame. The storage medium is, for example, a ROM/RAM, a magnetic disk, an optical disk, or the like.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通 技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若干改进和润饰, 这些改进和润饰也应该视为本发明的保护范围。  The above is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.

Claims

OP090604 WO 2010/060376 PCT/CN2009/075123 - 14- 权 利 要 求 OP090604 WO 2010/060376 PCT/CN2009/075123 - 14- Claims
1、 一种视频帧类型的识别方法, 其特征在于, 所述方法包括:  A method for identifying a video frame type, the method comprising:
接收待识别的视频帧;  Receiving a video frame to be identified;
获得所述接收到的待识别视频帧的大小;  Obtaining a size of the received video frame to be identified;
根据所述待识别视频帧的大小确定所述待识别视频帧的类型。  Determining a type of the to-be-identified video frame according to a size of the to-be-identified video frame.
2、 如权利要求 1所述的方法, 其特征在于, 所述根据所述待识别视频帧 的大小确定所述待识别视频帧的类型, 进一步包括:  The method according to claim 1, wherein the determining the type of the to-be-identified video frame according to the size of the to-be-identified video frame further includes:
确定第一阈值, 所述第一阈值为介于 B帧最大值和 P帧最小值之间的数 值;  Determining a first threshold, the first threshold being a value between a B frame maximum value and a P frame minimum value;
确定第二阈值,所述第二阈值为介于 P帧最大值和 I帧最小值之间的数值; 当所述待识别视频帧的大小不大于所述第一阈值时,或者, 当所述视频帧 的大小不大于第一阈值且小于 B帧的最大值时, 判定所述待识别视频帧为 B 帧;  Determining a second threshold, the second threshold being a value between a P frame maximum value and an I frame minimum value; when the size of the to-be-identified video frame is not greater than the first threshold, or when When the size of the video frame is not greater than the first threshold and less than the maximum value of the B frame, determining that the to-be-identified video frame is a B frame;
当所述待识别视频帧的大小不小于所述第二阈值时,或者, 当所述视频帧 的大小不小于第二阈值且大于 I帧的最小值时,判定所述待识别视频帧为 I帧; 当所述待识别视频帧的大小大于所述第一阈值且小于所述第二阈值时,判 定所述待识别视频帧为 P帧。  When the size of the to-be-identified video frame is not less than the second threshold, or when the size of the video frame is not less than a second threshold and greater than a minimum value of the I frame, determining that the to-be-identified video frame is I And determining, when the size of the to-be-identified video frame is greater than the first threshold and less than the second threshold, determining that the to-be-identified video frame is a P-frame.
3、 根据权利要求 2所述的方法, 其特征在于, 所述确定第一阈值, 进一 步包括:  3. The method according to claim 2, wherein the determining the first threshold further comprises:
确定当前周期;  Determine the current cycle;
统计所述当前周期内接收的视频帧长度的平均值,并将所述平均值作为第 一平均值;  Counting an average of the lengths of the received video frames in the current period, and using the average value as the first average value;
比较第一系数乘以所述第一平均值所得到数值与 B 帧的最大值, 将两者 中的最小值作为所述第一阈值。  The value obtained by multiplying the first coefficient by the first average value and the maximum value of the B frame are compared, and the minimum of the two is taken as the first threshold.
4、 根据权利要求 2所述的方法, 其特征在于, 所述确定第二阈值, 进一 步包括:  4. The method according to claim 2, wherein the determining the second threshold further comprises:
确定当前周期;  Determine the current cycle;
统计所述当前周期内接收的视频帧长度的平均值,并将所述平均值作为第 OP090604 Counting the average of the lengths of the received video frames in the current period, and using the average as the first OP090604
WO 2010/060376 PCT/CN2009/075123  WO 2010/060376 PCT/CN2009/075123
-15- 一平均值; -15- an average value;
比较第二系数乘以所述第一平均值所得到的数值与预设的 I帧最小阈值, 将两者中的最大值作为所述第二阈值。  Comparing the value obtained by multiplying the second coefficient by the first average value with a preset minimum threshold of the I frame, and using the maximum value of the two as the second threshold.
5、 根据权利要求 3或 4任意一项所述的方法, 其特征在于, 所述确定当 前周期包括:  The method according to any one of claims 3 or 4, wherein the determining the current period comprises:
为所述当前周期设置一个初始周期值;  Setting an initial period value for the current period;
获得在所述初始周期内连续接收的 B帧个数和连续接收的 I帧个数; 如果所述连续接收的 B 帧个数大于第三阈值, 将所述当前周期更新为 t 第三阈值 Obtaining a number of B frames continuously received in the initial period and a number of consecutively received I frames; if the number of consecutively received B frames is greater than a third threshold, updating the current period to a third threshold of t
Κ 视频帧的帧率, 所述 tl为从所述初始周期计时开始到发现连续接收的 B帧 个数大于第三阈值时所持续的时间,所述第三阈值为码率不变的情况下连续出 现 B帧的最大个数; 或者, 如果所述连续接收的 I 帧个数大于第四阈值, 将所述当前周期更新为 t 第四阈值 Κ fps video frames, the tl is started from the initial period to find the number of B-frame timing DRX threshold is greater than a third duration, said third threshold is a case where the rate constant The maximum number of B frames consecutively appears; or, if the number of consecutively received I frames is greater than a fourth threshold, updating the current period to a fourth threshold of t
^—视频帧^]帧率, 其中, 所述 t2 为从所述初始周期计时开始到发现连续接收 的 I帧个数大于第四阈值时所持续的时间,所述第四阈值为码率不变的情况下 连续出现 I帧的最大个数。 ^—Video frame ^] frame rate, wherein the t2 is a time period from when the initial period is counted until the number of consecutively received I frames is greater than a fourth threshold, and the fourth threshold is a code rate. In the case of a change, the maximum number of I frames appears continuously.
6、 根据权利要求 5所述的方法, 其特征在于, 6. The method of claim 5, wherein
统计在所述初始周期内接收的视频帧大小的平均值,并将所述平均值作为 第二平均值;  Counting an average of video frame sizes received during the initial period and using the average as a second average;
所述获得在所述初始周期内连续接收的 B帧个数, 进一步包括: 统计在所述初始周期内,将连续接收的大小小于第一系数与所述第二平均 值的乘积的视频帧的个数作为 B帧的个数;  And obtaining the number of B frames continuously received in the initial period, further comprising: counting, in the initial period, continuously receiving a video frame whose size is smaller than a product of the first coefficient and the second average value The number is the number of B frames;
所述获得在所述初始周期内连续接收的 I帧个数, 进一步包括: 统计在所述初始周期内,将连续接收的大小大于第二系数与所述第二平均 值的乘积的视频帧的个数作为 I帧的个数。 The obtaining the number of I frames continuously received in the initial period further includes: counting, in the initial period, a video frame that continuously receives a product whose size is greater than a product of the second coefficient and the second average value The number is used as the number of I frames.
7、 一种视频帧的类型的识别装置, 其特征在于, 包括: 7. A device for identifying a type of a video frame, comprising:
接收单元, 用于接收待识别的视频帧;  a receiving unit, configured to receive a video frame to be identified;
第一统计单元, 用于获得所述接收到的待识别视频帧的大小;  a first statistic unit, configured to obtain a size of the received video frame to be identified;
确定单元,用于根据所述第一统计单元统计的待识别视频帧的大小确定所 述待识别视频帧的类型。  And a determining unit, configured to determine, according to a size of the video frame to be identified that is counted by the first statistical unit, a type of the video frame to be identified.
8、 根据权利要求 7所述的装置, 其特征在于, 所述确定单元包括: 第一确定单元, 用于确定第一阈值, 所述第一阈值为介于 B帧最大值和 P 帧最小值之间的数值;  The device according to claim 7, wherein the determining unit comprises: a first determining unit, configured to determine a first threshold, where the first threshold is between a B frame maximum value and a P frame minimum value Value between
第二确定单元, 用于确定第二阈值, 所述第二阈值为介于 P帧最大值和 I 帧最小值之间的数值;  a second determining unit, configured to determine a second threshold, where the second threshold is a value between a maximum value of the P frame and a minimum value of the I frame;
帧类型判断单元, 用于当所述待识别视频帧的大小不大于所述第一阈值 时, 或者, 当所述视频帧的大小不大于第一阈值且小于 B 帧的最大值时, 判 定所述待识别视频帧为 B 帧; 当所述待识别视频帧的大小不小于所述第二阈 值时, 或者, 当所述视频帧的大小不小于第二阈值且大于 I帧的最小值时, 判 定所述待识别视频帧为 I帧; 当所述待识别视频帧的大小大于所述第一阈值且 小于所述第二阈值时, 判定所述待识别视频帧为 P帧。  a frame type determining unit, configured to: when the size of the to-be-identified video frame is not greater than the first threshold, or when the size of the video frame is not greater than a first threshold and less than a maximum value of a B frame, Determining that the identified video frame is a B frame; or when the size of the video frame to be identified is not less than the second threshold, or when the size of the video frame is not less than a second threshold and greater than a minimum value of the I frame, Determining that the to-be-identified video frame is an I-frame; and determining that the to-be-identified video frame is a P-frame when the size of the to-be-identified video frame is greater than the first threshold and less than the second threshold.
9、 根据权利要求 8所述的装置, 其特征在于, 所述第一确定单元, 进一 步包括:  The device according to claim 8, wherein the first determining unit further comprises:
当前周期确定单元, 用于确定当前周期;  a current period determining unit, configured to determine a current period;
第二统计单元,用于统计所述当前周期确定单元所确定的当前周期内接收 的视频帧大小的平均值, 并将所述平均值作为第一平均值;  a second statistic unit, configured to calculate an average value of video frame sizes received in the current period determined by the current period determining unit, and use the average value as a first average value;
第一设置单元, 用于比较第一系数乘以所述第一平均值所得到数值与 B 帧的最大值的大小, 将两者中的最小值设为所述第一阈值。  And a first setting unit, configured to compare a value obtained by multiplying the first coefficient by the first average value and a maximum value of the B frame, and setting a minimum value of the two as the first threshold.
10、 根据权利要求 8所述的装置, 其特征在于, 所述第二确定单元, 进一 步包括:  The device according to claim 8, wherein the second determining unit further comprises:
当前周期确定单元, 用于确定当前周期;  a current period determining unit, configured to determine a current period;
第二统计单元,用于统计所述当前周期确定单元所确定的当前周期内接收 的视频帧长度的的平均值, 并将所述平均值作为第一平均值; 第二设置单元,用于比较第二系数乘以所述第一平均值所得到的数值与预 设的 I帧最小值的大小, 将两者中的最大值设为所述第二阈值。 a second statistic unit, configured to collect an average value of lengths of video frames received in a current period determined by the current period determining unit, and use the average value as a first average value; And a second setting unit, configured to compare a value obtained by multiplying the second coefficient by the first average value with a minimum value of a preset I frame minimum value, and setting a maximum value of the two as the second threshold value.
11、 根据权利要求 9或 10任意一项所述的装置, 其特征在于, 所述当前 周期确定单元, 进一步包括:  The device according to any one of claims 9 or 10, wherein the current period determining unit further comprises:
预设单元, 用于为所述当前周期设置一个初始周期值;  a preset unit, configured to set an initial period value for the current period;
估算单元, 用于估算在所述预设单元设置的初始周期内连续接收的 B 帧 个数和连续接收的 I帧个数;  An estimating unit, configured to estimate a number of consecutively received B frames and an consecutively received I frames in an initial period set by the preset unit;
第一更新单元, 用于如果所述估算单元估算的连续接收的 B 帧个数大于  a first updating unit, configured to: if the estimating unit estimates, the number of consecutively received B frames is greater than
t 第三阈值  t third threshold
第三阈值,将所述当前周期更新为 视频帧的帧率, 所述 tl为从所述初始周期 计时开始到发现连续接收的 B 帧个数大于第三阈值时所持续的时间, 所述第 三阈值为码率不变的情况下连续出现 B帧的最大个数; 第二更新单元,用于如果所述估算单元估算的连续接收的 I帧个数大于第 And a third threshold, the current period is updated to a frame rate of the video frame, where the t1 is a time from when the initial period is counted to when the number of continuously received B frames is greater than a third threshold. The third threshold is the maximum number of consecutive B frames in the case where the code rate is constant; the second update unit is configured to: if the estimation unit estimates the number of consecutively received I frames is greater than the first
t 第四阈值  t fourth threshold
四阈值, 将所述当前周期更新为 视频帧的帧率, 其中, 所述 t2为从初始周 期计时开始到发现连续接收的 I帧个数大于第四阈值时所持续的时间,所述第 四阈值为码率不变的情况下连续出现 I帧的最大个数。 a fourth threshold, the current period is updated to a frame rate of the video frame, where the t2 is a time from when the initial period is counted to when the number of consecutively received I frames is greater than a fourth threshold, the fourth time The threshold is the maximum number of consecutive I frames in the case where the code rate is constant.
PCT/CN2009/075123 2008-11-25 2009-11-25 Video frame type identification method and device WO2010060376A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810203702.4 2008-11-25
CN2008102037024A CN101426137B (en) 2008-11-25 2008-11-25 Video frame type recognizing method and device

Publications (1)

Publication Number Publication Date
WO2010060376A1 true WO2010060376A1 (en) 2010-06-03

Family

ID=40616429

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/075123 WO2010060376A1 (en) 2008-11-25 2009-11-25 Video frame type identification method and device

Country Status (2)

Country Link
CN (1) CN101426137B (en)
WO (1) WO2010060376A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191484A (en) * 2018-11-14 2020-05-22 普天信息技术有限公司 Method and device for recognizing human speaking in video image

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101426137B (en) * 2008-11-25 2011-08-03 上海华为技术有限公司 Video frame type recognizing method and device
CN102547300B (en) * 2010-12-17 2015-01-21 华为技术有限公司 Method for detecting frame types and device
CN102752022B (en) * 2012-06-29 2014-09-10 清华大学深圳研究生院 Power line communication method and frame response method and device thereof
CN102752023B (en) * 2012-06-29 2014-10-22 清华大学深圳研究生院 Electric terminal equipment and system based on wireless HART (Highway Addressable Remote Transducer) and power wire communication
CN103634698B (en) * 2012-08-21 2014-12-03 华为技术有限公司 Methods for detecting frame type and frame size of video stream and apparatus
CN104283699A (en) * 2013-07-01 2015-01-14 中兴通讯股份有限公司 Method and device for determining service types
CN108023869B (en) * 2016-10-28 2021-03-19 海能达通信股份有限公司 Parameter adjusting method and device for multimedia communication and mobile terminal
CN112019852A (en) * 2019-05-29 2020-12-01 杭州海康威视数字技术股份有限公司 Target type frame identification method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707662A (en) * 2004-05-07 2005-12-14 松下电器产业株式会社 Reproduction apparatus and reproduction method
CN1964250A (en) * 2006-11-23 2007-05-16 华为技术有限公司 Data frame type identification method and device
CN101426137A (en) * 2008-11-25 2009-05-06 上海华为技术有限公司 Video frame type recognizing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707662A (en) * 2004-05-07 2005-12-14 松下电器产业株式会社 Reproduction apparatus and reproduction method
CN1964250A (en) * 2006-11-23 2007-05-16 华为技术有限公司 Data frame type identification method and device
CN101426137A (en) * 2008-11-25 2009-05-06 上海华为技术有限公司 Video frame type recognizing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191484A (en) * 2018-11-14 2020-05-22 普天信息技术有限公司 Method and device for recognizing human speaking in video image

Also Published As

Publication number Publication date
CN101426137A (en) 2009-05-06
CN101426137B (en) 2011-08-03

Similar Documents

Publication Publication Date Title
WO2010060376A1 (en) Video frame type identification method and device
KR100537499B1 (en) Method of generating transmission control parameter and selective retranmission method according to the packet characteristics.
CN101909060B (en) Qos control method suitable for real-time streaming media transmission of mobile videos
US9723329B2 (en) Method and system for determining a quality value of a video stream
EP2814255B1 (en) Method and apparatus for detecting frame types
KR20140098248A (en) Dynamic modification of video properties
MXPA06002026A (en) Quality of experience (qoe) metrics for wireless communication networks.
CN104754339B (en) I framing control method, apparatus and system
KR20120106520A (en) Method of estimating channel rate using signal strength information
CN113473185B (en) Method and device for detecting available bandwidth based on video stream key frame burst characteristics
WO2018024497A1 (en) Estimation of losses in a video stream
JP2004215201A (en) Information processing apparatus and information processing method, data communication system, recording medium, and program
JP5405915B2 (en) Video quality estimation apparatus, video quality estimation method, and video quality estimation apparatus control program
JP2007258919A (en) Video quality estimate apparatus and video quality estimate method
WO2022198464A1 (en) Data transmission method, related device, and communication system
KR101148072B1 (en) Multimedia supporting system and method thereof
Park et al. A cross-layered network-adaptive video streaming using sender-driven wireless channel monitoring
Ayran Reliable real-time video communication in wireless sensor networks

Legal Events

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

Ref document number: 09828636

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09828636

Country of ref document: EP

Kind code of ref document: A1