CN100397847C - Method of generating real time transfer protocol time stamp - Google Patents
Method of generating real time transfer protocol time stamp Download PDFInfo
- Publication number
- CN100397847C CN100397847C CNB031100554A CN03110055A CN100397847C CN 100397847 C CN100397847 C CN 100397847C CN B031100554 A CNB031100554 A CN B031100554A CN 03110055 A CN03110055 A CN 03110055A CN 100397847 C CN100397847 C CN 100397847C
- Authority
- CN
- China
- Prior art keywords
- encoding
- rtp
- speech
- local clock
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to a method for generating a timestamp of a real-time transport protocol (RTP) of the field of communication technology. An RTP timestamp is generated by adopting a local clock through an executor. Firstly, an RTP timestamp of a first message can be randomly generated; a subsequent message can obtain the current local clock, and the difference value of the current local clock and a previous message local clock can be calculated; the difference value can be corrected to the integer multiple of a voice coding/decoding group packet interval; the current message timestamp is the previous message timestamp adding the corrected difference value; when a reliable link is arranged between a voice source end and the executor, if the current message is a voice frame and the previous message is also a voice frame, the current message timestamp is the previous message timestamp adding the voice coding/decoding group packet interval. The present invention provides a method for simply, effectively and quickly generating the RTP timestamp without a codec; thereby, the device cost is saved, and the voice damage is reduced.
Description
Technical field
The present invention relates to communication technical field, relate in particular to a kind of generation method of RTP timestamp.
Background technology
Real-time transport protocol (rtp) is the bearing protocol of carrying real-time voice/Media Stream on packet networks such as IP, utilize this agreement, the elimination that timestamp that the recipient can be got on by the transmit leg mark when sending by each RTP message and sequence number are realized shake and the sequence of message are rebuild (out of order elimination).According to the RTP standard, transmit leg must satisfy strict requirement when generating time stamp, and these requirements comprise:
What 1, time stamp must be based on regulation, the perhaps clock frequency that consults of both sides all is to be reference clock with 8KHz such as, general encoding and decoding speech.
2, the time stamp difference between the adjacent message must be the integral multiple of the group inter-packet gap of corresponding voice/medium encoding and decoding defined.Such as, the group parlor of adaptive multi-rate (AMR) encoding and decoding speech (a kind of code decode algorithm of standard) defined is divided into 20 milliseconds, and under reference clock (8KHz) situation based on standard code, this group inter-packet gap is equivalent to 160 ticktocks of RTP clock.Because the cause of silence compression, the AMR encoding and decoding under quiet situation, be separated by a period of time (8 AMR group bag times are equal to 160 milliseconds) just export a context update message, so, during silence compression, it is 160 * 8=1280 ticktock that the time stamp of adjacent RTP message differs.
Existing RTP time stamp generation method commonly used is exactly to adopt code decode algorithm to finish the generation of time stamp, for coding/decoding module, voice are continuous, so algorithm is known the temporal information that all need, in real work, coding/decoding module can be realized the generation of timestamp like this:
1, generates first message (P at random
0) RTP timestamp (standard for the purpose of safety, the initial value that requires the RTP time stamp is a random number), be designated as TS
0
2, subsequently, to the voice message P of each generation
i(i belongs to natural number), it is TS that its time stamp is set
I-1+ Delta, wherein, Delta be this encoding and decoding speech the standard group inter-packet gap (such as, for the AMR encoding and decoding, Delta=160);
If 3 certain message P
jNeed so with this packet loss, but still not upgrade TS sending opposite end (such as the discontinuous transmission frame during being in silence compression) on the network to
j
There is following shortcoming in the generation of existing timestamp:
1, must exist under the situation of codec and could use, if there is not codec, then algorithm be inapplicable, such as, do not needing encoding and decoding speech, in the time of still need being transformed into the voice flow in other carrying the RTP carrying.
If 2 increase codec by force, because codec resource costliness, the cost of equipment will sharply raise so, and in addition, the encoding and decoding of codec action has increased delay, and has increased speech damage.
If 3 Real-time Transport Protocol are handled and not (such as digital signal processor) realization in a device of codec, codec need transmit time stab information to the Real-time Transport Protocol processing unit so, increase the transmission bandwidth requirement of device interior like this, and increased the message complexity.
Summary of the invention
Technical problem to be solved by this invention is: overcome existing generation RTP time stamp and must use shortcomings such as cost height, speech damage that codec brings and the transmission bandwidth that has increased device interior require, a kind of method that generates the RTP time stamp simply, effectively and quickly that does not need codec is provided, thereby the saving equipment cost reduces speech damage.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be:
The generation method of this RTP timestamp is characterized in that: adopt local clock and generate the real-time transport protocol (rtp) time stamp by actuator, may further comprise the steps:
A, generate the RTP timestamp of first message at random;
B, subsequent packet is obtained current local clock, and calculate the difference of current local clock and previous message local clock;
C, described difference is revised, be the integral multiple of encoding inter-packet gap;
D, current message time stamp are previous message time stamp and the described difference sum through revising.
Among the described step C, when described difference is revised, can will round behind the group inter-packet gap of this difference divided by encoding and decoding speech earlier, and then multiply by the group inter-packet gap of encoding and decoding speech.
Among the described step C, when described difference is revised, can earlier this difference be added modifying factor earlier, after asynchronous the compensating to local clock and source end clock, round behind the group inter-packet gap divided by encoding and decoding speech again, and then multiply by the group inter-packet gap of encoding and decoding speech.
Described modifying factor is half of group inter-packet gap of encoding and decoding speech.
Described actuator between speech source end and destination, can with speech source within same equipment, also can be not within same equipment, but link to each other by network with the speech source end.
When realizing that asynchronous transfer mode adaptation layer two (AAL2) is carried to conversion between the RTP carrying, described actuator is at the medium gateway internal of needs carrying conversion.
When being reliable link between speech source end and the described actuator, if current message is speech frame, and previous message also is speech frame, and then current message time stamp is the group inter-packet gap that previous message time stamp adds encoding and decoding speech.
The reference clock frequency of the encoding and decoding speech that the frequency of described local clock can be supported with needs is identical, also can be different.
When the frequency of local clock and the reference clock frequency that needs the encoding and decoding speech supported not simultaneously, local clock's numerical value of obtaining is converted to the clock numerical value corresponding with encoding and decoding speech reference clock frequency.
Beneficial effect of the present invention is: the present invention utilizes local clock, and generates the RTP time stamp by actuator, has realized a kind of quick RTP time stamp generation method that does not need codec, and this method is simple, effective, and algorithm complex is very low.The generation method of RTP time stamp is self-enclosed, do not need the extra help of codec, especially only need carry conversion, and the occasion that does not need to carry out encoding and decoding conversion has great significance, it has been removed from and has increased the extra charge of codec, thereby has saved equipment cost, and has avoided other to increase the problem behind the codec, comprise and postpone end to end to increase the speech damage that extra encoding and decoding bring etc.
Embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
Codec for the prior art employing, because voice are continuous, therefore coding/decoding module is known required temporal information, the present invention does not adopt codec, utilize local clock and generate the RTP time stamp by actuator, the reference clock frequency of the encoding and decoding speech that the frequency of this clock can be supported with needs is identical, also can be different, but need frequency faster.For different clock frequencies, local clock's numerical value can be scaled the clock numerical value corresponding with the standard time clock frequency of encoding and decoding.
The position of actuator of the present invention between speech source end and destination somewhere, it can with speech source within an equipment, also can be not within same equipment, but link to each other by certain network with the speech source end, typically, such as medium gateway internal, realize that asynchronous transfer mode adaptation layer two (being AAL2, a kind of bearing protocol at real-time streams such as voice-bearers on the asynchronous transfer mode ATM network network) is carried to the conversion between the RTP carrying in needs carrying conversion.
If the pairing RTP ticktock of the group inter-packet gap number of the encoding and decoding speech of need supporting be Interval (to the AMR encoding and decoding, Interval=160), suppose that the standard time clock frequency of the frequency of local clock and encoding and decoding is identical, then:
1, to first RTP message P
0, its time stamp TS
0Be a random number, write down the numerical value C of current local clock simultaneously
0
2, to each follow-up message P
i, carry out following processing:
2a, obtain the current C of local clock
i
2b, calculating C
i-C
I-1
2c, C=(C
i-C
I-1+ Interval/2)/round behind the Interval; Wherein, Interval/2 is a modifying factor, can be to asynchronous the compensating of local clock and source end clock;
The time stamp of 2d, an i message is: TS
i=TS
I-1+ C * Interval;
2e, record TS
iAnd C
i, for future use.
Since time stamp must based on the regulation, the perhaps clock frequency that consults of both sides, therefore, if local clock's frequency is different with the encoding and decoding standard clock frequency, for example working as local clock frequency is 20KHz, and AMR encoding and decoding standard clock frequency is when being 8KHz, and the standard group inter-packet gap of 20ms is equivalent to 400 ticktocks of this local clock, is 160 ticktocks and be equivalent to the encoding and decoding standard clock frequency.Therefore, in above-mentioned steps, obtain the numerical value C of local clock
iAnd C
I-1After, need earlier it be converted into the clock value corresponding with the encoding and decoding standard clock frequency according to the ratio of local clock's frequency and encoding and decoding standard clock frequency, carry out subsequent treatment again.
When being reliable link between speech source end and the actuator of the present invention (situation that does not have LOF), implementation method of the present invention can also further be simplified:
1, to first RTP message P
0, its time stamp TS
0Be a random number, write down the numerical value C of current local clock simultaneously
0
2, to each follow-up message P
i, carry out following processing:
2a, the current message of judgement are speech frame or quiet frame, if speech frame then carries out 2b, otherwise 2e;
2b, the previous message of judgement are speech frame or quiet frame, if speech frame then carries out 2c, otherwise 2e;
The time stamp of 2c, this message is TS
i=TS
I-1+ Interval;
2d, obtain and write down present clock C
i, record TS
i, finish.
2e, obtain the current C of local clock
i
2f, calculating C
i-C
I-1
2g, C=(C
i-C
I-1+ Interval/2)/round behind the Interval; Wherein, Inteval/2 is a modifying factor, can be to asynchronous the compensating of local clock and source end clock;
The time stamp of 2h, an i message is: TS
i=TS
I-1+ C * Interval;
2i, record TS
iAnd C
i, for future use, finish.
In this case, has only the context update frame under the quiet situation, and the timestamp of first speech frame after quiet needs certain calculating, and other speech frame just carries out simple additional calculation, and in fact, speech frame will account for half of frame of whole voice flow, so this simplification has reduced the algorithm complex of half.
The present invention has realized a kind of quick RTP time stamp generation method that does not need codec, this method is simple, effective, algorithm complex is low, removed the extra charge that increases codec from, thereby saved equipment cost, and avoided other to increase the problem behind the codec, comprised postponing end to end to increase the speech damage that extra encoding and decoding bring etc.
Claims (9)
1. the generation method of a RTP timestamp is characterized in that: adopt local clock and generate the realtime transmission protocol RTP time stamp by actuator, may further comprise the steps:
A, generate the RTP timestamp of first message at random;
B, subsequent packet is obtained current local clock, and calculate the difference of current local clock and previous message local clock;
C, described difference is revised, be the integral multiple of encoding inter-packet gap;
D, current message time stamp are previous message time stamp and the described difference sum through revising.
2. the generation method of RTP timestamp according to claim 1, it is characterized in that: among the described step C, when described difference is revised, can will round behind the group inter-packet gap of this difference divided by encoding and decoding speech earlier, and then multiply by the group inter-packet gap of encoding and decoding speech.
3. the generation method of RTP timestamp according to claim 1, it is characterized in that: among the described step C, when described difference is revised, earlier this difference is added modifying factor earlier, after asynchronous the compensating to local clock and source end clock, round behind the group inter-packet gap divided by encoding and decoding speech again, and then multiply by the group inter-packet gap of encoding and decoding speech.
4. the generation method of RTP timestamp according to claim 3 is characterized in that: described modifying factor is half of group inter-packet gap of encoding and decoding speech.
5. according to the generation method of claim 1,2,3 or 4 described RTP timestamps, it is characterized in that: described actuator between speech source end and the destination and the speech source end within same equipment; Perhaps not within same equipment, but link to each other by network with the speech source end.
6. the generation method of RTP timestamp according to claim 5, it is characterized in that: when realizing that asynchronous transfer mode adaptation layer two AAL2 is carried to conversion between the RTP carrying, described actuator is at the medium gateway internal of needs carrying conversion.
7. the generation method of RTP timestamp according to claim 5, it is characterized in that: when being reliable link between speech source end and the described actuator, if current message is a speech frame, and previous message also is a speech frame, and then current message time stamp is the group inter-packet gap that previous message time stamp adds encoding and decoding speech.
8. according to the generation method of claim 1,2,3 or 4 described RTP timestamps, it is characterized in that: the frequency of described local clock is identical with the reference clock frequency of the encoding and decoding speech that needs are supported, and is perhaps different.
9. the generation method of RTP timestamp according to claim 8, it is characterized in that: when the reference clock frequency of the encoding and decoding speech of the frequency of local clock and needs support not simultaneously, local clock's numerical value of obtaining is converted to the clock numerical value corresponding with encoding and decoding speech reference clock frequency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB031100554A CN100397847C (en) | 2003-04-14 | 2003-04-14 | Method of generating real time transfer protocol time stamp |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB031100554A CN100397847C (en) | 2003-04-14 | 2003-04-14 | Method of generating real time transfer protocol time stamp |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1538704A CN1538704A (en) | 2004-10-20 |
CN100397847C true CN100397847C (en) | 2008-06-25 |
Family
ID=34319611
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB031100554A Expired - Fee Related CN100397847C (en) | 2003-04-14 | 2003-04-14 | Method of generating real time transfer protocol time stamp |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100397847C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100466598C (en) * | 2004-10-22 | 2009-03-04 | 华为技术有限公司 | A Realization Method of Data Message Transmission Based on RTP |
WO2007115431A1 (en) * | 2006-04-07 | 2007-10-18 | Huawei Technologies Co., Ltd. | A data message transmitting method based on real time transmitting protocol and a device thereof |
CN101102263B (en) * | 2006-07-07 | 2010-05-12 | 华为技术有限公司 | Recovery method and device for compressed packet |
US7936794B2 (en) * | 2007-08-07 | 2011-05-03 | Avaya Inc. | Clock management between two end points |
CN102376324B (en) * | 2010-08-09 | 2015-08-05 | Tcl集团股份有限公司 | A kind of player method of video data frame, system and player |
CN112671696B (en) * | 2019-10-16 | 2023-05-12 | 华为技术有限公司 | Message transmission method, device, computer equipment and computer storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5640388A (en) * | 1995-12-21 | 1997-06-17 | Scientific-Atlanta, Inc. | Method and apparatus for removing jitter and correcting timestamps in a packet stream |
WO2002028107A2 (en) * | 2000-09-28 | 2002-04-04 | Nokia Corporation | Enhanced header compression profile |
US20020167911A1 (en) * | 2001-03-16 | 2002-11-14 | Kenetec, Inc. | Method and apparatus for determining jitter buffer size in a voice over packet communications system |
EP1351472A2 (en) * | 2002-04-01 | 2003-10-08 | Samsung Electronics Co., Ltd. | Forming RTP packets |
-
2003
- 2003-04-14 CN CNB031100554A patent/CN100397847C/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5640388A (en) * | 1995-12-21 | 1997-06-17 | Scientific-Atlanta, Inc. | Method and apparatus for removing jitter and correcting timestamps in a packet stream |
WO2002028107A2 (en) * | 2000-09-28 | 2002-04-04 | Nokia Corporation | Enhanced header compression profile |
US20020167911A1 (en) * | 2001-03-16 | 2002-11-14 | Kenetec, Inc. | Method and apparatus for determining jitter buffer size in a voice over packet communications system |
EP1351472A2 (en) * | 2002-04-01 | 2003-10-08 | Samsung Electronics Co., Ltd. | Forming RTP packets |
Also Published As
Publication number | Publication date |
---|---|
CN1538704A (en) | 2004-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5174182B2 (en) | Playback delay estimation | |
US8160030B2 (en) | Data rate controller | |
US20080304474A1 (en) | Techniques to Synchronize Packet Rate In Voice Over Packet Networks | |
US6876647B2 (en) | Dynamic priority adjustment in a real time streaming engine | |
US20030009337A1 (en) | Enhanced media gateway control protocol | |
CN100583691C (en) | Synchronization method and system for transmitting voice data in a mobile communication system | |
RU2431239C2 (en) | Method, apparatus and system for carrier channel setup in gsm network | |
US20040179555A1 (en) | System and method for compressing data in a communications environment | |
CA2254706A1 (en) | Speech reception via a packet transmission facility | |
US20080291902A1 (en) | Managing a buffer for media processing | |
CN100397847C (en) | Method of generating real time transfer protocol time stamp | |
US7418013B2 (en) | Techniques to synchronize packet rate in voice over packet networks | |
CN103188403B (en) | The online monitor method of voice gateways | |
JP4567369B2 (en) | One or more encoded frames from an isochronous telecommunications stream based on one or more code rates of the one or more encoded frames to generate a non-isochronous telecommunications stream Control components to remove | |
CN102843350A (en) | Method and system for selecting encoding and decoding in media negotiation process during IP (Internet Protocol) call | |
JP5831095B2 (en) | Voice communication system, voice communication apparatus and program | |
EP2129051B1 (en) | A method and system for realizing the voice compensation in the mobile communication network | |
CN101562898B (en) | High-efficiency wireless access system RTP agent technology | |
CN101610321A (en) | The implementation method of function of training telephone operators in a kind of call center system | |
CN100518029C (en) | User interface processing unit in mobile communication system | |
CN101394584B (en) | Method, system and device for data transmission | |
RU2426250C2 (en) | Method and system for speech compensation in mobile communication system | |
Yoo et al. | A media stream processing of VoIP media gateway | |
TWI232657B (en) | Communicating tone information in a network | |
CN100544522C (en) | Qcelp 8k packets of voice is at the transmission method in CDMA2000 conventional terminal territory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170929 Address after: 044200 Yuncheng, Guanghua County, Wanrong, Shanxi, Dingcun Patentee after: Li Yunxia Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: Huawei Technologies Co., Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080625 Termination date: 20180414 |