WO2011044781A1 - 一种多媒体码流发送的方法和系统 - Google Patents

一种多媒体码流发送的方法和系统 Download PDF

Info

Publication number
WO2011044781A1
WO2011044781A1 PCT/CN2010/074994 CN2010074994W WO2011044781A1 WO 2011044781 A1 WO2011044781 A1 WO 2011044781A1 CN 2010074994 W CN2010074994 W CN 2010074994W WO 2011044781 A1 WO2011044781 A1 WO 2011044781A1
Authority
WO
WIPO (PCT)
Prior art keywords
sent
adjustment period
data packets
module
data
Prior art date
Application number
PCT/CN2010/074994
Other languages
English (en)
French (fr)
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 WO2011044781A1 publication Critical patent/WO2011044781A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23406Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving management of server-side video buffer

Definitions

  • the present invention relates to the field of video surveillance, and in particular to a method and system for transmitting a multimedia code stream. Background technique
  • multimedia service quality is the most critical issue in operations.
  • the code rate of the system is controlled by the encoder.
  • the encoder collects audio and video data, encodes it according to the encoding parameters, and then packages the multimedia stream to the destination address.
  • the multimedia stream consists of I, p, and B frames.
  • the I frame refers to the intra-coded picture. No additional information is needed for decoding. Compared with other frame types, the I frame requires more data, so the I frame is sent only when needed.
  • the I frame is mainly composed of transform coefficients and does not contain vectors.
  • the P frame refers to the forward preview screen obtained from the previous screen.
  • the front screen can be either an I screen or a P screen.
  • the data of the P picture is composed of the vectors extracted from each macro block described in the previous picture, instead of the transform coefficients describing the correction or difference data that must be added to the macro block.
  • the data required for the P picture is approximately half of the I picture.
  • the B frame is a picture that is predicted in both directions from the front and back I screens or P pictures.
  • the B picture data consists of a vector from which the picture data described in the front or back is extracted.
  • the B picture contains the conversion factor for correction. Since the two-way preview is very effective, the B picture correction data is the smallest.
  • the data required for the B frame picture is approximately one quarter of the I picture.
  • setting the code rate basically limits the average bit rate of the system, but in the encoding process, the amount of information corresponding to the I frame is more than 4 frames larger than the P frame. At the same time, the frequency of the I frame is much lower than P frame: If the I frame period is set to 2 seconds and the frame rate is set to 25 frames per second, then every 50 frames will be output. The current I frame, the rest are frames, and the interval between each frame is 40 milliseconds.
  • the system bandwidth is designed according to the bandwidth required for I frame transmission, the system bandwidth is very high and difficult to implement. Second, the I frame frequency is much lower than the frame rate. Designing the system according to the maximum bandwidth will greatly waste system resources. .
  • the encoder transmits the frame for most of the time, and the data is transmitted within 2 seconds. The amount is low, and once the I frame arrives, the amount of data sent within this 40 millisecond will rise sharply.
  • the code rate of the multimedia stream exceeds the upper limit of the bandwidth, the video image will have problems such as blooming, pause, etc., which seriously affects the user experience.
  • the engineering practice also confirms that the instantaneous code rate of the system exceeds the system bandwidth. At the same time, the code rate of the multimedia code stream is small and large, and the volatility will affect the quality of the multimedia video. Summary of the invention
  • the present invention provides a method and system for transmitting a multimedia code stream, which can prevent the multimedia instantaneous transmission code rate from exceeding the system bandwidth.
  • the present invention uses the following technical solutions:
  • a multimedia code stream sending method includes the process of encapsulating the multimedia code stream into a data packet, and the method further includes the following processing steps:
  • the actual number of data packets sent in the adjustment period is determined according to the expected number of transmissions of the data packet, and the data packet is sent according to the actual number of data packets transmitted in each transmission period in the adjustment period.
  • the one adjustment period includes one transmission period or multiple transmission periods.
  • the method further includes the step of: configuring a mapping relationship between the total number of currently buffered data packets and the number of expected packets to be transmitted according to the system bandwidth.
  • the data packet is sent according to the actual number of packets sent in each transmission period in the adjustment period, which is specifically performed as follows:
  • the actual number of data packets sent in the previous adjustment period is less than the expected number of data packets to be sent in the adjustment period, it is determined that the actual number of data packets sent in the adjustment period is the actual number of data packets sent in the previous adjustment period plus The number of reservations;
  • the actual number of data packets sent in the previous adjustment period is greater than the expected number of data packets to be sent in the adjustment period, it is determined that the actual number of data packets sent in the adjustment period is the actual number of data packets sent in the previous adjustment period minus the number of data packets actually sent.
  • the predetermined number is one.
  • the invention also discloses a multimedia code stream sending system, comprising a data encapsulating module and a data sending control module, wherein the data encapsulating module is configured to encapsulate the multimedia code stream into a data packet, and the data sending control module is configured to control the encapsulation
  • the data transmission control module includes a buffer module, a number determination module, and an adjustment transmission module, where the buffer module is configured to place a data packet to be sent; the number determination module is used to When an adjustment period arrives, determining, according to the total number of currently buffered data packets in the buffer module, a number of expected data packets to be sent in the adjustment period; and the adjustment sending module is configured to send the number according to the data packet. Determine the actual number of packets sent in this adjustment period, and send the packets according to the actual number of packets sent in each transmission cycle in this adjustment period.
  • the one adjustment period includes one transmission period or multiple transmission periods.
  • the data sending control module further includes a mapping module, where the mapping module The block is configured to configure a mapping relationship between the total number of currently buffered data packets and the number of packets expected to be sent according to the system bandwidth.
  • the adjustment sending module includes a comparison module and an adjustment module, where the comparison module is configured to compare the actual number of data packets sent in the previous adjustment period with the expected number of data packets to be sent in the current adjustment period.
  • the adjustment module is configured to perform processing according to the comparison result of the comparison module; if the comparison result of the comparison module is that the actual number of data packets transmitted in the previous adjustment period is less than the expected number of data packets to be sent in the adjustment period, The adjusting module determines that the actual number of data packets sent in the adjustment period is adjusted to the actual number of data packets sent in the previous adjustment period plus a predetermined number; if the comparison result of the comparison module is the actual data packet of the previous adjustment period If the number of packets to be transmitted is greater than the number of packets to be sent in the current adjustment period, the adjustment module determines that the actual number of packets sent in the adjustment period is adjusted to be the actual number of packets transmitted in the previous adjustment period minus a predetermined number; If the comparison result of the comparison module is that
  • the predetermined number is one.
  • the present invention determines the expected number of data packets to be transmitted according to the current number of buffered data packets in each adjustment period, and determines the actual number of data packets to be sent in the adjustment period. Since the actual number of packets transmitted is always limited by the number of packets expected to be transmitted, the burst characteristics that suddenly increase when the I frame arrives in the existing transmission process are adjusted to the fluctuation characteristics centered on the number of expected transmissions. The possibility that the instantaneous code rate of the multimedia code stream exceeds the system bandwidth can be reduced, the transmission process is smoothed, and the multimedia code stream can be sent more uniformly, thereby providing a higher quality video service to the user. DRAWINGS
  • FIG. 1 is a flowchart of a method for transmitting a multimedia code stream according to the present invention
  • 2 is a waveform diagram of a multimedia code stream transmission at a code rate of 512 kbps
  • FIG. 2-a is a waveform diagram of a normal transmission method
  • FIG. 2-b is a waveform diagram of a transmission method using the present invention
  • FIG. 3-a is a waveform diagram of a general transmission method
  • FIG. 3-b is a waveform diagram of a transmission method using the present invention
  • FIG. 4 is a waveform diagram of a multimedia code stream transmission at a code rate of 2000 kbps
  • FIG. 4-a is a waveform diagram of a general transmission method
  • FIG. 4-b is a waveform diagram of a transmission method using the present invention
  • Figure 5 is a structural diagram of the system of the present invention.
  • FIG. 6 is a structural diagram of a data transmitting module according to the present invention.
  • FIG. 7 is a structural diagram of an adjustment transmitting module of the present invention. detailed description
  • a method for transmitting a multimedia code stream includes the following steps:
  • Step 101 compress and encode the multimedia signal, and divide and encapsulate the data packet into a data packet.
  • Step 102 Set a buffer, and configure a mapping relationship between the total number of currently buffered data packets and the number of data packets to be sent according to the system bandwidth, and set a length of the adjustment period;
  • one adjustment period may be one transmission period or multiple transmission periods.
  • an adjustment period is usually set to multiple transmission periods.
  • one adjustment period is set to L transmission periods, that is, within one adjustment period, each transmission period is sent a certain number.
  • the data packet is sent a total of L times.
  • the adjustment period contains more transmission periods, which makes the adjustment more gradual and less
  • the number of times the total number of buffered packets is read, the number of packets expected to be sent is generated, and the processing speed of the entire system is increased, and the processing speed of the entire system is increased.
  • the inclusion of fewer transmission periods makes the adjustment more adaptable to the current state, and the adjustment is more timely and effective. .
  • Step 103 Put the data packet to be sent into a buffer
  • the multimedia code stream is composed of I, p, and B frames.
  • the data packet to be sent will increase a lot in an instant. Therefore, the buffer is first created, and the data packet to be sent is placed in the buffer.
  • the total number of packets to be sent in the buffer is the total number of buffered packets.
  • Putting the data packet to be sent into the buffer instead of transmitting it all at once can reduce the possibility that the instantaneous transmission rate of the multimedia stream exceeds the system bandwidth.
  • Step 104 If the current number of times the data packet has been sent is less than L times, indicating that the adjustment period has not expired, the data is sent according to the actual number of packets sent by the current data packet;
  • Step 105 If the current data packet sent S is equal to L times, indicating that the adjustment period ends, and the next adjustment period is entered. At this time, the data packet of the adjustment period is determined according to the total number of currently buffered data packets in the buffer. Expected to send the number N;
  • Step 106 According to the expected number of data packets to be sent, N, the number of packets actually sent in the previous adjustment period, M', determine the number of packets actually sent in the adjustment period, M;
  • the number of packets actually transmitted in the adjustment period is actually transmitted by the data packet of the previous adjustment period.
  • the number M' is added to the predetermined number; if the actual number of packets sent by the last adjustment period M' is greater than the number N of data packets expected to be transmitted in the adjustment period, the number of packets actually transmitted in the adjustment period is M.
  • the data packet of an adjustment period is actually sent by the number M' minus a predetermined number.
  • the predetermined number is usually set to 1, and may be set to other numbers according to requirements, but in order to make the packet transmission smoother, the predetermined number is usually set to a relatively small number.
  • Step 107 In the adjustment period, each transmission period sends a data packet according to the actual number M of data packets, and is sent L times.
  • the actual number of data packets to be sent in this adjustment period only the actual number of data packets transmitted in the previous adjustment period is increased or decreased by 1, or another smaller predetermined number, and continues for L transmission periods.
  • the multimedia stream can be sent more uniformly, and the smooth adjustment can be achieved, and the user can provide a higher quality video service.
  • Step 108 repeating steps 104 to 107 to continue to adjust the transmission code rate of the multimedia code stream.
  • Step 201 compress and encode the multimedia signal, and divide and encapsulate the data packet into a data packet.
  • Step 202 Set a buffer, and configure a mapping relationship between the total number of currently buffered data packets and the number of packets expected to be sent according to the system bandwidth, and set an adjustment period length to send the same number of packets L times.
  • mapping relationship between the total number of configured buffered packets and the number of packets expected to be sent by N can be as shown in Table 1.
  • Table 1 Users can also configure the relationship between the total number of other buffered packets and the number of packets expected to be sent according to the system bandwidth. Accordingly, another mapping table can be established, and the diverse configurations can meet the diverse needs of users.
  • Step 203 Put the data packet to be sent into a buffer.
  • Step 204 when the I frame arrives, the data packet of the buffer increases instantaneously, and the total number of buffered data packets increases to 80-100;
  • Step 205 The actual number of data packets sent in the adjustment period is 1, and the number of times sent has been L times, and the next adjustment period is entered; Step 206, querying the table configured in step 203, determining that the number of expected packets to be sent in the adjustment period is 5;
  • Step 207 the actual number of data packets sent in the previous adjustment period is less than the number of data packets expected to be sent in the adjustment period of 5, and then the number of data packets actually sent in the adjustment period is 2, and is continuously sent L times. , enter the next adjustment cycle;
  • Step 208 the total number of buffer data packets is still 80-100, and the table configured in step 202 is queried to determine that the number of data packets to be sent in the adjustment period is 5;
  • Step 209 the actual number of data packets sent in the last adjustment period is less than the number of data packets expected to be transmitted in the adjustment period of 5, and then the number of data packets actually sent in the adjustment period is determined to be 3, and is continuously sent L times, and enters Next adjustment cycle;
  • Step 210 the total number of buffered data packets is reduced to 30-50, and the table configured in step 202 is queried to determine that the number of expected packets to be sent in the adjustment period is 3;
  • Step 211 The actual number of data packets sent by the previous adjustment period is equal to the number of data packets expected to be sent in the adjustment period, and the number of data packets actually sent in the adjustment period is determined to be kept at 3, and is continuously sent L times. ;
  • Step 212 The total number of buffered data packets is 0-10, and the table configured in step 202 is queried to determine that the number of data packets to be sent in the adjustment period is one;
  • Step 213 The actual number of data packets sent by the last adjustment period is greater than the number of data packets expected to be sent by the adjustment period, and the number of data packets actually sent in the adjustment period is determined to be 2, and is continuously sent L times. Next adjustment cycle;
  • Step 214 the total number of buffered data packets obtained is 0-10, and the table configured in step 202 is queried to determine that the number of data packets to be sent in the adjustment period is 1;
  • Step 215 The actual number of data packets sent by the last adjustment period is greater than the number of data packets expected to be sent by the adjustment period, and then the number of data packets actually sent in the adjustment period is determined to be 1, and is continuously sent L times. The next adjustment cycle.
  • Embodiment 3 The actual number of data packets sent by the last adjustment period is greater than the number of data packets expected to be sent by the adjustment period, and then the number of data packets actually sent in the adjustment period is determined to be 1, and is continuously sent L times. The next adjustment cycle.
  • the waveform of the burst code stream with the code rate of 512 kbps is as shown in FIG. 2-a before the adjustment.
  • the I frame with the period of 2 seconds arrives, a peak appears in the waveform, and the peak value is peaked. More than 20 packets, while other times are sent P frames, the packet is maintained at around 5.
  • the instantaneous transmission code rate of the multimedia code stream may exceed the bandwidth and cause the possibility of blooming.
  • the waveform after smooth adjustment is as shown in FIG. 2-b, and the waveform of the entire wave is smoother than the waveform shown in FIG. 2-a, and the maximum peak value is about 10 data packets, which is smaller than before the adjustment.
  • the peak value is reduced by half, which can effectively reduce the possibility that the instantaneous bit rate exceeds the bandwidth.
  • the adjusted waveform is more uniform and can provide users with higher quality video services.
  • the waveform of the 1000 kbps multimedia stream before adjustment is shown in Figure 3-a.
  • the adjusted code stream is shown in Figure 3-b.
  • the adjusted waveform is smoother and the peak value is also 20 drops to 16.
  • the waveform of the 2000 kbps multimedia stream before adjustment is shown in Figure 4-a.
  • the adjusted code stream is shown in Figure 4-b.
  • the adjusted waveform is smoother and the peak value is also 40 dropped to 16.
  • a multimedia code stream sending system includes a data encapsulating module and a data sending control module, where the data encapsulating module is configured to encapsulate a multimedia code stream into a data packet, and the data sending control is performed.
  • the module is configured to control a sending rate of the encapsulated data packet, where the data sending control module includes a buffering module, a number determining module, and an adjustment sending module, where the buffering module is configured to place a data packet to be sent;
  • the number determining module is configured to determine, according to the total number of currently buffered data packets in the buffer module, the number of expected packets to be sent in the adjustment period when an adjustment period arrives;
  • the number of packets expected to be sent determines the actual number of packets sent during this adjustment period, and is within this adjustment period.
  • Each transmission cycle sends a packet according to the actual number of packets sent.
  • the one adjustment period includes one transmission period or multiple transmission periods.
  • the data sending control module may further include a mapping module, where the mapping module is configured to configure the total number of currently buffered data packets according to system bandwidth. The mapping relationship between the number of packets expected to be sent by the packet.
  • the adjustment sending module includes a comparison module and an adjustment module, where the comparison module is configured to compare data packets actually sent in the previous adjustment period.
  • the data packet of the number and the adjustment period is expected to be sent, and the adjustment module is configured to perform processing according to the comparison result of the comparison module.
  • the adjustment module determines the actual number of data packets to be adjusted in the adjustment period. For the number of packets actually sent in the previous adjustment period plus a predetermined number; if the comparison result of the comparison module is that the number of packets actually sent in the previous adjustment period is greater than the number of packets expected to be sent in the adjustment period, then The adjusting module determines that the actual number of data packets sent in the adjustment period is adjusted to be the actual number of data packets sent in the previous adjustment period minus a predetermined number; if the comparison result of the comparison module is the actual data packet sent in the previous adjustment period If the number is equal to the number of packets expected to be sent in the adjustment period, the adjustment module determines that the actual number of packets sent in the adjustment period remains unchanged.
  • the predetermined number is one.
  • this is only an example for ease of understanding, and the specific implementation of the present invention should not be construed as being limited to the description. It is to be understood by those skilled in the art that various changes and substitutions may be made without departing from the spirit and scope of the invention.

Description

一种多媒体码流发送的方法和系统 技术领域
本发明涉及视频监控领域, 特别是一种多媒体码流发送的方法和系统。 背景技术
在视频监控领域, 多媒体服务质量, 特别是视频图像质量是运营中最 关键的问题。
在视屏监控系统中, 当用户设定了码率、 帧频等编码参数后, 系统的 码率就由编码器控制。 编码器釆集音频、 视频数据, 根据编码参数进行编 码, 然后将多媒体码流打包发送到目的地址。
多媒体码流由 I、 p、 B帧构成。 I 帧是指帧内编码画面, 解码时不需要 其它额外的信息, 与其它帧类型相比, I 帧需要较多的数据, 所以只在需要 时才发送 I帧。 I帧主要由变换系数组成, 不含矢量。
P帧是指从前面画面中得到的前向预见画面, 前面画面可以是 I 画面, 也可以是 P画面。 P画面的数据由在前面画面中描述的从每个宏块中提取的 矢量组成, 而不是由描述必须加到宏块上的校正或差异数据的变换系数所 组成。 P画面需要的数据大约是 I画面的一半。
B帧是指从前、后的 I画面或者 P画面上双向预见的画面。 B画面数据 由描述在前面或后面的画面数据中从哪里提取的矢量组成。 B 画面包含变 换系数, 用于校正。 由于双向预见非常有效, 所以 B 画面校正数据是最小 的。 B帧画面需要的数据大约是 I画面的四分之一。
一般情况下, 设定了码率大小基本就限定了系统的平均码率, 但是在 编码过程中, I帧对应的信息量比 P帧大 4艮多, 同时, I帧的频率却远低于 P帧: 如设置 I帧周期为 2秒, 帧频设置为每秒 25帧的话, 那么每 50帧出 现一次 I帧 , 其余均为 Ρ帧 , 而每帧间隔为 40毫秒。
如果按照 I帧发送时需要的带宽来设计系统带宽,一是对系统带宽要求 很高, 难以实现 , 二是 I帧出现频率远低于 Ρ帧, 按最大带宽来设计系统 会极大地浪费系统资源。
在运营商网络带宽有限的情况下, 如果按照每次调度时能发送多少数 据包就发送多少数据包的方式发送数据, 那么在 2秒时间内, 编码器大部 分时间发送 Ρ帧, 数据的发送量较低, 一旦 I帧到达, 在这个 40毫秒内发 送的数据量将急剧上升。 当多媒体码流的码率超过带宽上限, 视频图像就 会出现花屏、 停顿等的问题, 严重影响了用户体验, 工程实践中也证实了 系统瞬间码率超过系统带宽情况的存在。 同时, 多媒体码流发送码率时大 时小, 波动剧烈也会影响多媒体视频的质量。 发明内容
本发明提供了一种多媒体码流的发送方法和系统, 可以避免多媒体瞬 间发送码率超过系统带宽。
为了解决上述技术问题, 本发明釆用了如下技术方案:
一种多媒体码流发送方法, 包括将所述多媒体码流封装成数据包的过 程, 所述方法还包含以下处理步骤:
设置緩冲区, 将待发送数据包放入所述緩冲区;
在一个调整周期到达时, 根据所述緩冲区中的当前緩冲数据包总数, 确定本调整周期的数据包期望发送个数;
根据所述数据包期望发送个数确定本调整周期的数据包实际发送个 数, 并在本调整周期内的每个发送周期按数据包实际发送个数发送数据包。
在上述方案中, 所述一个调整周期包含一个发送周期, 或包含多个发 送周期。
在上述方案中, 在所述设置緩冲区, 将待发送数据包放入所述緩冲区 之后, 所述方法还包括以下步骤: 根据系统带宽配置所述当前緩冲数据包 总数与数据包期望发送个数的映射关系。
在上述方案中, 在所述本调整周期内的每个发送周期按数据包实际发 送个数发送数据包, 具体按以下方式进行:
若上一调整周期的数据包实际发送个数小于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数为上一调整周期的数 据包实际发送个数加上预定个数;
若上一调整周期的数据包实际发送个数大于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数为上一调整周期的数 据包实际发送个数减去预定个数;
若上一调整周期的数据包实际发送个数等于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数保持不变。
在上述方案中, 所述预定个数为 1。
本发明还公开了一种多媒体码流发送系统, 包括数据封装模块、 数据 发送控制模块, 所述数据封装模块用于将多媒体码流封装成数据包, 所述 数据发送控制模块用于控制封装后的数据包的发送速率, 所述数据发送控 制模块包括緩冲模块、 个数确定模块、 调整发送模块, 其中, 所述緩冲模 块用于放置待发送数据包; 所述个数确定模块用于在一个调整周期到达时, 根据所述緩冲模块中的当前緩冲数据包总数, 确定本调整周期的数据包期 望发送个数; 所述调整发送模块用于根据所述数据包期望发送个数确定本 调整周期的数据包实际发送个数, 并在本调整周期内的每个发送周期按数 据包实际发送个数发送数据包。
在上述方案中, 所述一个调整周期包含一个发送周期, 或包含多个发 送周期。
在上述方案中, 所述数据发送控制模块还包括映射模块, 所述映射模 块用于根据系统带宽配置所述当前緩冲数据包总数与数据包期望发送包个 数的映射关系。
在上述方案中, 所述调整发送模块包括比较模块、 调整模块, 其中, 所述比较模块用于比较上一调整周期的数据包实际发送个数与本调整周期 的数据包期望发送个数, 所述调整模块用于根据所述比较模块的比较结果 进行处理; 若所述比较模块的比较结果为上一调整周期的数据包实际发送 个数小于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整 周期的数据包实际发送个数调整为上一调整周期的数据包实际发送个数加 上预定个数; 若所述比较模块的比较结果为上一调整周期的数据包实际发 送个数大于本调整周期的数据包期望发送个数, 则所述调整模块确定本调 整周期的数据包实际发送个数调整为上一调整周期的数据包实际发送个数 减去预定个数; 若所述比较模块的比较结果为上一调整周期的数据包实际 发送个数等于本调整周期的数据包期望发送个数, 则所述调整模块确定本 调整周期的数据包实际发送个数保持不变。
在上述方案中, 所述预定个数为 1。
与现有技术相比, 本发明的有益效果在于:
本发明通过緩冲待发送数据包, 在每个调整周期根据当前緩冲数据包 个数确定数据包期望发送个数, 并据此确定该调整周期内的数据包实际发 送个数。 由于数据包实际发送个数始终受到数据包期望发送个数的限制, 从而将现有发送过程中的 I帧到达时突然增大的突发特性,调整为以期望发 送个数为中心的波动特性, 可以降低多媒体码流瞬间发送码率超过系统带 宽的可能性, 发送过程被平滑化, 可以较为均匀的发送多媒体码流, 因而 可以向用户提供更高质量的视频服务。 附图说明
图 1为本发明的多媒体码流发送方法的流程图; 图 2为码率 512kbps的多媒体码流发送波形图, 图 2-a为普通发送方法 的波形图, 图 2-b为釆用本发明的发送方法的波形图;
图 3为码率 1000kbps的多媒体码流发送波形图, 图 3-a为普通发送方 法的波形图, 图 3-b为釆用本发明的发送方法的波形图;
图 4为码率 2000kbps的多媒体码流发送波形图, 图 4-a为普通发送方 法的波形图, 图 4-b为釆用本发明的发送方法的波形图;
图 5为本发明的系统结构图;
图 6为本发明数据发送模块的结构图;
图 7为本发明的调整发送模块的结构图。 具体实施方式
下面对照附图并结合具体实施方式对本发明进行进一步详细说明。 实施例一
如图 1 所示, 本发明的一个实施例的多媒体码流发送方法, 包括以下 步骤:
步骤 101 , 对多媒体信号压缩编码, 并分割、 封装为数据包;
步骤 102,设置緩冲区, 根据系统带宽配置当前緩冲数据包总数与数据 包期望发送个数 N的映射关系, 设置一个调整周期的长度;
这里, 系统带宽越大, 数据包期望发送个数 N越大, 当前緩冲数据包 总数越大, 数据包期望发送个数 N也越大。
其中, 一个调整周期可以是一个发送周期, 也可以是多个发送周期。 为了较为均匀的发送多媒体码流, 通常设置一个调整周期为多个发送周期, 本实施例中一个调整周期设置为 L个发送周期, 即在一个调整周期内, 每 个发送周期发送一定个数的数据包, 共发送 L次。
根据不同的需求可以设置不同的调整周期长度, 可以满足用户的多样 化的需求。 调整周期包含较多的发送周期, 可以使得调整更加平緩, 并减 少緩冲区数据包总数读取、 数据包期望发送个数生成等处理的次数, 提高 整个系统的处理速度; 而包含较少的发送周期, 则可以使得调整更加适应 当前状态, 调整更加及时有效。
步骤 103 , 将待发送数据包放入緩冲区;
多媒体码流由 I、 p、 B帧构成, 当 I帧来临时, 需要发送的数据包会瞬 间增加很多, 因此, 先建立緩冲区, 把待发送的数据包放入緩冲区中, 位 于緩冲区的待发送的数据包总数即为緩冲数据包总数。
将待发送的数据包放入緩冲区中而不是一次性全部发送, 可以降低多 媒体码流的瞬间发送码率超过系统带宽的可能性。
步骤 104, 若当前数据包已发送次数 S小于 L次, 表明该调整周期还 未结束, 则继续按照当前数据包实际发送个数发送数据;
步骤 105 , 若当前数据包已发送次数 S等于 L次, 表明该调整周期结 束, 进入下一个调整周期, 此时,根据緩冲区中的当前緩冲数据包总数, 确 定本调整周期的数据包期望发送个数 N;
步骤 106, 根据数据包期望发送个数 N、 上一调整周期的数据包实际发 送个数 M' 确定本调整周期的数据包实际发送个数 M;
若上一调整周期的数据包实际发送个数 M' 小于本调整周期的数据包 期望发送个数 N, 则本调整周期的数据包实际发送个数 M为上一调整周期 的数据包实际发送个数 M' 加上预定个数; 若上一调整周期的数据包实际 发送个数 M' 大于本调整周期的数据包期望发送个数 N, 则本调整周期的 数据包实际发送个数 M为上一调整周期的数据包实际发送个数 M' 减去预 定个数。 这里, 预定个数通常设置为 1,也可以根据需求设置为其它数, 但 为了使数据包发送的较为平滑, 预定个数通常设置为比较小的数。
步骤 107, 在本调整周期内,每个发送周期都按照数据包实际发送个数 M发送数据包, 共发送 L次。 在确定本调整周期的数据包实际发送个数的时候, 只将上一调整周期 的数据包实际发送个数增加或减少 1 , 或其它一个较小的预定个数, 并在持 续 L个发送周期后再进行下一次调整, 可以较为均勾的发送多媒体码流, 达到平滑调整的目的, 可以向用户提供更高质量的视频服务。
步骤 108,重复步骤 104至步骤 107 ,继续调整多媒体码流的发送码率。 实施例二
步骤 201 , 对多媒体信号压缩编码, 并分割、 封装为数据包;
步骤 202,设置緩冲区, 根据系统带宽配置当前緩冲数据包总数与数据 包期望发送个数 N的映射关系, 设置一个调整周期长度为发送相同个数的 数据包 L次。
配置的緩冲数据包总数与数据包期望发送个数 N的映射关系可以如下 表 1所示。
Figure imgf000009_0001
表 1 用户也可以根据系统带宽配置其它的緩冲数据包总数与数据包期望发 送个数 N的关系, 相应的可以建立另一张映射表, 多样化的配置可以满足 用户多样化的需求。
步骤 203 , 将待发送数据包放入緩冲区;
步骤 204, 当 I帧到达时, 緩冲区的数据包会瞬间增多, 緩冲数据包总 数增加为 80-100;
步骤 205 , 本调整周期的数据包实际发送个数为 1 , 已发送的次数为 L 次后, 进入下一个调整周期; 步骤 206, 查询步骤 203中配置的表格, 确定本调整周期的数据包期望 发送个数为 5;
步骤 207,上一个调整周期内的数据包实际发送个数 1小于本调整周期 的数据包期望发送个数 5 , 则确定本调整周期的数据包实际发送个数为 2, 并持续发送 L次后, 进入下一个调整周期;
步骤 208, 由于 I帧数据量较大, 緩冲区数据包总数仍为 80-100, 查询 步骤 202中配置的表格, 确定本调整周期的数据包期望发送个数为 5;
步骤 209,上个调整周期的数据包实际发送个数 2小于本调整周期的数 据包期望发送个数 5 , 则确定本调整周期的数据包实际发送个数为 3 , 并持 续发送 L次, 进入下一个调整周期;
步骤 210,緩冲数据包总数下降为 30-50,查询步骤 202中配置的表格, 确定本调整周期的数据包期望发送个数为 3;
步骤 211 ,上一调整周期的数据包实际发送个数 3等于本调整周期的数 据包期望发送个数 3 ,则确定本调整周期的数据包实际发送个数为保持为 3 , 并持续发送 L次;
步骤 212, 緩冲数据包总数为 0-10, 查询步骤 202中配置的表格, 确定 本调整周期的数据包期望发送个数为 1个;
步骤 213 ,上个调整周期的数据包实际发送个数 3大于本调整周期的数 据包期望发送个数 1 , 则确定本调整周期的数据包实际发送个数为 2, 并持 续发送 L次, 进入下一个调整周期;
步骤 214,获取到的緩冲数据包总数为 0-10, 查询步骤 202中配置的表 格, 确定本调整周期的数据包期望发送个数为 1 ;
步骤 215 ,上个调整周期的数据包实际发送个数 2大于本调整周期的数 据包期望发送个数 1 , 则确定本调整周期的数据包实际发送个数为 1 , 并持 续发送 L次, 进入下一个调整周期。 实施例三
如图 2所示,码率 512kbps的多媒体码流在调整前有突发码流的波形如 图 2-a所示, 当周期为 2秒的 I帧到达时, 波形图出现一个波峰, 波峰峰值 超过 20个数据包, 而其他时间发送的是 P帧, 数据包维持在 5个左右。 由 图 2-a可以看到, 当 I帧到达需要发送时, 多媒体码流的瞬间发送码率有超 出带宽而引起花屏的可能性。
按照本发明的码流发送方法平滑调整后的波形如图 2-b所示,整个波的 波形比图 2-a中所示的波形平滑, 最大峰值在 10个数据包左右, 比调整之 前的峰值下降了一半, 可以有效的降低瞬间码率超出带宽的可能性, 同时, 调整后的波形图也较为均匀, 可以向用户提供更高质量的视频服务。
如图 3所示, 码率 1000kbps的多媒体码流在调整前的波形如图 3-a所 示, 调整后的码流如图 3-b所示, 调整后的波形较为平滑, 波峰值也从 20 下降到 16。
如图 4所示, 码率 2000kbps的多媒体码流在调整前的波形如图 4-a所 示, 调整后的码流如图 4-b所示, 调整后的波形较为平滑, 波峰值也从 40 下降到了 16。
实施例四
如图 5 所示, 本发明一个实施例的多媒体码流发送系统中, 包括数据 封装模块、 数据发送控制模块, 所述数据封装模块用于将多媒体码流封装 成数据包, 所述数据发送控制模块用于控制封装后的数据包的发送速率, 所述数据发送控制模块包括緩冲模块、 个数确定模块、 调整发送模块, 其 中, 所述緩冲模块用于放置待发送数据包; 所述个数确定模块用于在一个 调整周期到达时, 根据所述緩冲模块中的当前緩冲数据包总数, 确定本调 整周期的数据包期望发送个数; 所述调整发送模块用于根据所述数据包期 望发送个数确定本调整周期的数据包实际发送个数, 并在本调整周期内的 每个发送周期按数据包实际发送个数发送数据包。
本发明一个实施例的多媒体码流发送系统中, 所述一个调整周期包含 一个发送周期, 或包含多个发送周期。
如图 6所示, 本发明一个实施例的多媒体码流发送系统中, 所述数据 发送控制模块还可以包括映射模块, 所述映射模块用于根据系统带宽配置 所述当前緩冲数据包总数与数据包期望发送包个数的映射关系。
如图 7所示, 本发明一个实施例的多媒体码流发送系统中, 所述调整 发送模块包括比较模块、 调整模块, 其中, 所述比较模块用于比较上一调 整周期的数据包实际发送个数与本调整周期的数据包期望发送个数, 所述 调整模块用于根据比较模块的比较结果进行处理。
具体地, 若比较模块的比较结果为上一调整周期的数据包实际发送个 数小于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周 期的数据包实际发送个数调整为上一调整周期的数据包实际发送个数加上 预定个数; 若比较模块的比较结果为上一调整周期的数据包实际发送个数 大于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周期 的数据包实际发送个数调整为上一调整周期的数据包实际发送个数减去预 定个数; 若比较模块的比较结果为上一调整周期的数据包实际发送个数等 于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周期的 数据包实际发送个数保持不变。
本发明一个实施例的多媒体码流发送系统中, 所述预定个数为 1个。 明, 但这只是为便于理解而举的实例, 不应认为本发明的具体实施只局限 于这些说明。 对于本发明所属技术领域的普通技术人员来说, 在不脱离本 发明构思的前提下, 可以做出各种可能的等同改变或替换, 这些改变或替 换都应属于本发明的保护范围。

Claims

权利要求书
1、 一种多媒体码流发送方法, 包括将所述多媒体码流封装成数据包的 过程, 其特征在于, 所述方法还包含以下处理步骤:
设置緩冲区, 将待发送数据包放入所述緩冲区;
在一个调整周期到达时, 根据所述緩冲区中的当前緩冲数据包总数, 确定本调整周期的数据包期望发送个数;
根据所述数据包期望发送个数确定本调整周期的数据包实际发送个 数, 并在本调整周期内的每个发送周期按数据包实际发送个数发送数据包。
2、 如权利要求 1所述的多媒体码流发送方法, 其特征在于, 所述一个 调整周期包含一个发送周期, 或包含多个发送周期。
3、 如权利要求 1所述的多媒体码流发送方法, 其特征在于, 在所述设 置緩冲区, 将待发送数据包放入所述緩冲区之后, 所述方法还包括: 根据 系统带宽配置所述当前緩冲数据包总数与数据包期望发送个数的映射关 系。
4、 如权利要求 1所述的多媒体码流发送方法, 其特征在于, 在所述本 调整周期内的每个发送周期按数据包实际发送个数发送数据包, 具体按以 下方式进行:
若上一调整周期的数据包实际发送个数小于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数为上一调整周期的数 据包实际发送个数加上预定个数;
若上一调整周期的数据包实际发送个数大于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数为上一调整周期的数 据包实际发送个数减去预定个数;
若上一调整周期的数据包实际发送个数等于本调整周期的数据包期望 发送个数, 则确定本调整周期的数据包实际发送个数保持不变。
5、 如权利要求 4所述的多媒体码流发送方法, 其特征在于, 所述预定 个数为 1个。
6、一种多媒体码流发送系统, 包括数据封装模块、数据发送控制模块, 所述数据封装模块用于将多媒体码流封装成数据包 , 所述数据发送控制模 块用于控制封装后的数据包的发送速率, 其特征在于, 所述数据发送控制 模块包括緩冲模块、 个数确定模块、 调整发送模块, 其中,
所述緩冲模块用于放置待发送数据包; 所述个数确定模块用于在一个 调整周期到达时, 根据所述緩冲模块中的当前緩冲数据包总数, 确定本调 整周期的数据包期望发送个数; 所述调整发送模块用于根据所述数据包期 望发送个数确定本调整周期的数据包实际发送个数, 并在本调整周期内的 每个发送周期按数据包实际发送个数发送数据包。
7、 如权利要求 6所述的多媒体码流发送系统, 其特征在于, 所述一个 调整周期包含一个发送周期, 或包含多个发送周期。
8、 如权利要求 6所述的多媒体码流发送系统, 其特征在于, 所述数据 发送控制模块还包括映射模块, 所述映射模块用于根据系统带宽配置所述 当前緩冲数据包总数与数据包期望发送包个数的映射关系。
9、 如权利要求 6所述的多媒体码流发送系统, 其特征在于, 所述调整 发送模块包括比较模块、 调整模块, 其中,
所述比较模块用于比较上一调整周期的数据包实际发送个数与本调整 周期的数据包期望发送个数;
所述调整模块用于根据所述比较模块的比较结果进行处理;
若所述比较模块的比较结果为上一调整周期的数据包实际发送个数小 于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周期的 数据包实际发送个数调整为上一调整周期的数据包实际发送个数加上预定 个数; 若所述比较模块的比较结果为上一调整周期的数据包实际发送个数 大于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周期 的数据包实际发送个数调整为上一调整周期的数据包实际发送个数减去预 定个数; 若所述比较模块的比较结果为上一调整周期的数据包实际发送个 数等于本调整周期的数据包期望发送个数, 则所述调整模块确定本调整周 期的数据包实际发送个数保持不变。
10、 如权利要求 9所述的多媒体码流发送系统, 其特征在于, 所述预 定个数为 1个。
PCT/CN2010/074994 2009-10-14 2010-07-05 一种多媒体码流发送的方法和系统 WO2011044781A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200910110770 CN102045552B (zh) 2009-10-14 2009-10-14 一种多媒体码流发送的方法和系统
CN200910110770.0 2009-10-14

Publications (1)

Publication Number Publication Date
WO2011044781A1 true WO2011044781A1 (zh) 2011-04-21

Family

ID=43875811

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074994 WO2011044781A1 (zh) 2009-10-14 2010-07-05 一种多媒体码流发送的方法和系统

Country Status (2)

Country Link
CN (1) CN102045552B (zh)
WO (1) WO2011044781A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935643B (zh) * 2015-05-27 2018-08-21 河北远东通信系统工程有限公司 一种数字集群系统数据帧动态缓冲处理方法
CN106789385B (zh) * 2015-11-23 2020-05-22 杭州海康威视数字技术股份有限公司 一种视频流的发送方法、发送装置和网络摄像机
CN105554517B (zh) * 2015-12-03 2018-09-28 浙江大华技术股份有限公司 一种视频流发送方法及装置
CN110971942B (zh) * 2018-09-28 2021-08-17 杭州海康威视数字技术股份有限公司 数据传输方法和装置
CN113068001B (zh) * 2019-12-16 2022-10-04 浙江宇视科技有限公司 基于级联摄像机的数据处理方法、装置、设备和介质
CN111757151B (zh) * 2020-06-30 2022-08-19 平安国际智慧城市科技股份有限公司 基于rtp协议的视频流发送方法、装置、设备和介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030223366A1 (en) * 2002-06-03 2003-12-04 International Business Machines Corporation Flow control in computer networks
CN1655547A (zh) * 2004-09-09 2005-08-17 上海川海信息科技有限公司 一种流媒体传输系统中的速率控制方法
CN1983907A (zh) * 2005-12-13 2007-06-20 中兴通讯股份有限公司 一种流媒体发送速率的控制方法
CN101068236A (zh) * 2007-04-13 2007-11-07 华为技术有限公司 流媒体码率控制方法、系统和设备
CN101466034A (zh) * 2008-12-25 2009-06-24 华为技术有限公司 发送、播放流媒体数据的方法和装置及流媒体点播系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791055B (zh) * 2004-12-14 2010-04-07 腾讯科技(深圳)有限公司 一种减小数据包播放延时的方法
CN1996935B (zh) * 2006-01-04 2011-02-02 华为技术有限公司 一种流媒体接收端缓冲区内数据包的动态调整方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030223366A1 (en) * 2002-06-03 2003-12-04 International Business Machines Corporation Flow control in computer networks
CN1655547A (zh) * 2004-09-09 2005-08-17 上海川海信息科技有限公司 一种流媒体传输系统中的速率控制方法
CN1983907A (zh) * 2005-12-13 2007-06-20 中兴通讯股份有限公司 一种流媒体发送速率的控制方法
CN101068236A (zh) * 2007-04-13 2007-11-07 华为技术有限公司 流媒体码率控制方法、系统和设备
CN101466034A (zh) * 2008-12-25 2009-06-24 华为技术有限公司 发送、播放流媒体数据的方法和装置及流媒体点播系统

Also Published As

Publication number Publication date
CN102045552B (zh) 2012-12-19
CN102045552A (zh) 2011-05-04

Similar Documents

Publication Publication Date Title
CN102239690B (zh) 用于拥塞控制的稳定视频速率适配
WO2017148260A1 (zh) 语音编码发送方法和装置
US8527649B2 (en) Multi-stream bit rate adaptation
CN104737514B (zh) 用于分布媒体内容服务的方法和设备
CN109068187B (zh) 实时流量传送系统和方法
WO2011044781A1 (zh) 一种多媒体码流发送的方法和系统
CN107210993A (zh) 无线通信网络中的多媒体内容流的动态速率调整的方法与系统
JP2005518729A (ja) インターネットプロトコルネットワークを通してファイン・グラニュラー・スケーラビリティに従い符号化されたビデオをストリーミングするための方法
MXPA06013211A (es) Metodo y aparato para asignar a informacion a los canales de un sistema de comunicacion.
CN101909208A (zh) 一种适用于cdma2000的视频无线传输控制方法
CN104394484A (zh) 一种无线实时流媒体传输方法
CN110996103A (zh) 一种根据网络情况对视频编码码率进行调节的方法
CN111741248B (zh) 一种数据传输方法、装置、终端设备和存储介质
WO2018185778A1 (en) Systems and methods for achieving optimal network bitrate
CN102905128A (zh) 编解码处理器在无线视频传输过程中码率控制的方法
CN105142002A (zh) 音/视频直播方法、装置及控制方法、装置
US20230231787A1 (en) Communication method and an apparatus
CN101521813B (zh) 一种处理媒体流的方法和装置
CN104253967A (zh) 一种实时视频通信传输控制方法
Lam et al. A transparent rate adaptation algorithm for streaming video over the internet
CN1867072A (zh) 可适性视频信号编码的方法及应用其的信号编码装置
Semsarzadeh et al. An adaptive rate control for faster bitrate shaping in x264 based video conferencing
CN105306970A (zh) 一种流媒体直播发送速度的控制方法及装置
Jammeh et al. Smoothing transcoded MPEG-1 video streams for Internet transmission
CN108353035B (zh) 用于多路复用数据的方法和设备

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: 10823013

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: 10823013

Country of ref document: EP

Kind code of ref document: A1