AVS (audio video standard) audio and video presynchronizing method based on RTP (real time protocol) package
Abstract
The invention claims a based on rtp package of avs video frequency synchronization method of preventing. Main process of the invention is following: Audio and video buffer area receives the audio video frequency package rtp; According to rtp audio video frequency package sequence number of judging and the delay of the performance and do corresponding processing; Through rtp audio video frequency package the head field carried by the time stamp data type frame number and other information calculating the represented absolute time interval playback; According to absolute playback time interval establishing rtp audio video frequency package the mapping; According to rtp audio video frequency package the mapping relation of the rtp of audio video synchronous condition; According to different desynchronizing condition to make the corresponding adjusting. The invention can effectively improve media is avs of desynchronizing condition at the same time it realizes the frequency media is fast synchronous it reaches the main body of the audio video frequency synchronization effect.

Term
5.6 yearsto projected expiry
Projected expiry 16 May 2032, counted from filing; an application has no term until it is granted.
- Priority and filed
- Published
- Today
- Projected expiry
9 claims: 6 independent, 3 dependent
- 1一种基于RTP封装的AVS音视频预同步方法,其特征在于:其包括以下步骤: 步骤I.接收RTP音视频包: 启动接收RTP音视频包的线程,打开音频缓冲区,设其初始值大小为Am ;打开视频缓冲区,设其初始值大小为Vm,准备接收新来的RTP音频包和RTP视频包; 步骤2.分析包迟到性并处理: 启动解析RTP包包头字段信息的线程,解析出RTP音频包或RTP视频包的序列号,将该RTP包的序列号与巾贞听端口的表中的序列号按从小到大的顺序逐一比较,若该序列号与表中的序列号都不相同且小于表中最小的,则说明该包是迟到且不能实现同步的包,直接将该包丢弃,不再进入缓冲区排队;若该序列号与表中的序列号都不相同且大于表中最小的,则说明该包是没有迟到的包,该包进入缓冲区,解析包头字段信息,准备形成新的映射块;若与表中序列号相同,则说明该包是迟到但还可能实现同步的RTP包,该包进入缓冲区,准备快速确定在队列中的位置; 对迟到但还可能实现同步的RTP包,首先找到含有缺失序列号标记的映射块,然后将该包的序列号与该映射块缺失标记出的序列号进行比较,若相同,则说明该包属于该映射块,即确定位置;若都不相同,则与下一个含有缺失序列号标记的映射块缺失标记出的序列号进行比较,直到确定位置; 步骤3.计算绝对回放时间区间: (1)解析出RTP音频包或RTP视频包的RTP时间戳,并获取SR包的RTP时间戳和NTP时间戳,计算出该RTP包所表示的绝对回放起始时间;SR :Sender Report,发送者报告,NTP :Network Time Protocol,网络时间协议; (2)解析RTP音频包或RTP视频包所携带的数据类型,即音频帧或视频帧,若是音频帧,则该RTP包中全为完整音频帧,解析出其帧数量;若是视频帧,则该RTP包不一定全为完整视频帧,解析出其帧头数量;并据此利用插值方法得出所对应的绝对回放时间区间长度; (3)根据步骤(I)和(2),计算出RTP音频包或RTP视频包所表示的绝对回放时间区间[X, y], X是绝对回放起始时间,y是绝对回放结束时间; 步骤4.建立RTP音视频包映射: 启动映射线程,因为音频和视频在同一个绝对时间轴上回放,把绝对时间轴做为桥梁,建立起该RTP包的一个媒体相对另一媒体的映射,同时该RTP包形成一个新的映射块或加入一个已存在的映射块,建立起RTP包映射; 步骤5.判断媒体失步情况: 启动判断失步的线程,根据已经建立的RTP音频包和RTP视频包关于绝对回放时间的的映射,开始检测RTP音频包和RTP视频包的失步情况并做出相应的调整;对所有的失步情况分析,将失步分为三种情况:第一种情况是其中一种媒体相对另一媒体出现整体性RTP包迟到,第二种情况是在某个媒体内出现个别RTP包来迟,第三种情况是第一种和第二种同时发生的情况; 步骤6.处理不同失步情况: 对第一种失步情况,即媒体间失步,处理步骤如下:将没有迟到的媒体整体延迟时间t再解RTP包;同时,该媒体缓冲区仍然接收新来的RTP包,对新来的RTP包做上述步骤2的判断处理,只要该包不是迟到且不能同步的RTP包,就开始向内存提交请求以增大该缓冲区容量来容纳更多RTP包;整体性RTP包迟到的媒体则在时间t内等待迟到的RTP包群到来,同时向发送端发送反馈信息,通知发送端降低该媒体发包频率; 对第二种失步情况,即媒体内失步,处理步骤如下:该媒体缓冲区内RTP包不做整体延时处理,也不向发端发送反馈信息,其侦听端口一旦侦听到来迟但还可能实现同步的包,立即按照步骤2中所述的方法,进行媒体内快速同步; 对第三种混合情况,即混合失步,首先将没有迟到的媒体延迟时间t再解RTP包;同时,该媒体缓冲区仍然接收新来的RTP包,对新来的RTP包做上述步骤2的判断处理,只要该包不是迟到且不能同步的RTP包,就开始向内存提交请求以增大该缓冲区容量来容纳更多RTP包;整体性RTP包迟到的媒体则在时间t内等待迟到的RTP包群,并且向发送端发送反馈信息,通知发送端降低该媒体发包频率;同时,其侦听端口一旦侦听到个别来迟但还可能实现同步的包,立即按照步骤2中所述的方法,进行媒体内快速同步。
- 2根据权利要求I所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:步骤3中的(I)中,计算RTP包绝对回放起始时间To的公式是To=Ts+1000(to-ts)/K,其中Ts是SR包中的64位NTP时间戳,ts是SR包中的32位RTP时间戳,to是该RTP包的32位时间戳,K是音频或视频帧的采样频率。
- 3根据权利要求I所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:步骤3中的(2)中,所述的插值方法是,对于音频,已知帧的采样频率K和帧的数量m,利用公式Ta=m/K,得出区间长度,其中Ta为音频绝对回放时间区间长度,对于视频,若该RTP包只封装了完整的视频帧,则按照计算音频帧的方法计算出Tv,Tv为视频绝对回放时间区间长度;若只封装了一个视频帧的宏块或条带且不包含帧头,则该时间区间Tv=O ;同理,若封装了视频帧帧头,则每个帧头表示为一个完整视频帧的时间,其计算Tv的公式也与计算音频帧的公式相同,帧数量m就是视频帧帧头数,K仍为视频帧的采样率。
- 4根据权利要求I所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:步骤3中的(3)中,计算RTP音频包绝对回放结束时间的方法是利用公式Tae=to+Ta,其中Tae表示该RTP音频包的绝对回放结束时间,to表示该RTP音频包的绝对回放起始时间,Ta表示该RTP音频包的绝对回放时间区间长度。
- 5根据权利要求4所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:计算RTP视频包绝对回放结束时间的方法是利用公式Tve=to+Tv ,其中Tve表示该RTP视频包的绝对回放结束时间,to表示该RTP视频包的绝对回放起始时间,Tv表示该RTP视频包的绝对回放时间区间长度JURTP音频包的绝对会放时间区间[Ta,Tae], RTP视频包的绝对会放时间区间[Tv, Tve]。
- 6根据权利要求I所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:其中等待时间t,由以下两种情况确定:若没有迟到的媒体持续接收新来的RTP包,且在时间tl达到该缓冲区的上限时,整体性RTP包迟到的媒体仍未完成媒体块映射同步,则此时t=tl ;若没有迟到的媒体尚未达到缓冲区上限H时,整体性RTP包迟到的媒体在时间t2已经完成媒体块映射同步,则此时t=t2 ;媒体块映射同步,是指进入该缓冲区的每个RTP包,都能找到对应的另一媒体映射,但并不保证每个映射块都没有个别RTP包的缺失。
- 7根据权利要求I所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:在缓冲区中,主要包括帧听端口和映射块两个模块,这两个模块协同工作的机制如下:帧听端口模块主要包含一张迟到但还可能实现同步的RTP包的包序列号的表,这些序列号在表中按照从小到大的顺序存放;每当接收一个新的RTP包,就将该包的序列号与表中的序列号按从小到大的顺序逐一比较,若该序列号与表中的序列号都不相同且小于表中最小的,则说明该包是迟到且不能实现同步的包,直接将该包丢弃,不再进入缓冲区排队;若该序列号与表中的序列号都不相同且大于表中最小的,则说明该包是没有迟到的包,则该包进入缓冲区,解析包头字段信息,准备形成新的映射块;若该序列号与表中某个序列号相同,则说明该包是迟到但还可能实现同步的RTP包,该包进入缓冲区。
- 8根据权利要求7所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:迟到但还可能实现同步的RTP包快速确定在队列中的位置的方法:首先找到含有缺失序列号标记的映射块,然后将该包的序列号与该映射块缺失标记出的序列号进行比较,若相同,则说明该包属于该映射块,即确定位置;若都不相同,则与下一个含有有缺失序列号标记的映射块缺失标记出的序列号进行比较,直到确定位置。
- 9根据权利要求8所述的一种基于RTP封装的AVS音视频预同步方法,其特征在于:该表由两种情况进行实时更新:一是每当形成一个新的映射块,该映射块就检测是否块内或相邻块间有缺失的RTP包序列号,同时查询是否其相邻映射块已经做出缺失序列号标记;若没有,将该序列号添加到缺失序列号标记中,同时将该序列号发送到侦听端口模块的表中进行更新,即在表中增加一个该缺失包序列号;若有,则不做缺失序列号标记,也不向侦听端口模块的表发送该缺失序列号;二是每当一个映射块要进行解RTP包时,且该映射块仍有缺失序列号标记,则将该缺失标记的序列号发送到侦听端口的表中进行更新,即删除表中与该缺失序列号相同的序列号。
Independent claims9
80 paragraphs, as filed
The technical field of
[0001] the invention claims a stream media synchronous field especially relates to rtp package avs transmission of audio video frequency media to the field of synchronous.
Background technology
Is avs [ 0002 audio video coding standard audio video frequency coding standard of digital audio/video encoding/decoding technical standard of the working group the digital audio and video frequency coding standard. Avs standard comprises a system video frequency audio frequency digital rights management mobile video and 9 parts. Avs multi-media communication system multiple when it does not ensure the qos quality of service quality of service grouping exchanging network to carry out real-time multimedia data transmission of the user is desired it has good quality of service ensuring the network and the reliability and transmission time delay and so on real time data communication in the process is usually met by such as packet loss random sequence jitter repeatedly and a series problem. In order to in network and effectively transmit the real-time data ietf internet internet engineering task force engineering tasks and development of the real timetransport rtp protocol real-time transmission protocol. Is rtp interactive audio frequency video and has real time property of the data providing end to end the transmission service it comprises two relation of intimate protocol rtp and rtcp real which transport controlprotocol real time transmission control protocol.
[0003] is rtp is used for internet to the multimedia data flow the invention claims a transmission protocol rtp main body and it is not only can be orderly transmitting data packet and providing reliable transmitting mechanism and it does not provide flow control and congestion control comprising the invention claims an rtcp and these services. Rtp and rtcp to provide flow control and congestion control service. Server using rtcp information dynamically changes the transmission speed is even it can change the effective load type. Rtp and rtcp used by matching with each other and they can effectively the feedback and the minimum expense of the transmission efficiency of optimization so it is especially suitable for transmission network of the real time data.
[0004] for solving the problem of avs video frequency in the network transmission time delay dithering generated by the synchronization problem generally adopts the method comprises the steps of receiving terminal adding the jitter buffer area. No matter what of the added is rtp packet receiving buffer area of decoding buffer and image display buffer area is also near the invention claims a double buffering region although it can be on a certain degree reducing the delay jitter of the first majority * periodically by changing the buffer size media to eliminate in time delay jitter and then the image display buffer area according to audio and video playback time whether or not the same performing frame-lost or repeatedly displaying *** frame image and the actual synchronizing effect is not ideal at all. The invention claims a more effective method to it solves the problem that the time delay dithering generated by the synchronization problem is not only depends on adjusting the size of the buffer area to realize the synchronous media playback. The method is rtp packet before it is carried out once a synchronization so as to ensure the whole of the audio the video *.
The content of invention
[0005] this invention claims a based on rtp package of avs video frequency synchronization method of preventing. Which is used for the avs system body to carry out audio video frequency synchronization before the first early * at the same time through establishing rtp audio video frequency package based on absolute playback time interval mapping rapidly determine the audio video frequency media and media in the desynchronizing condition and make relevant adjustment so as to reach the audio video frequency synchronization effect.
[0006] the purpose of this invention lies in the rtp package sent by the avs video at the same *. So this invention aims at the avs system and rtp and rtcp packet the characteristic of the avs system to the audio and video executing the exact synchronous front it makes full use of rtp packet head field the time stamp data type frame number and rtcp packet head of the time stamp information to the audio video frequency for the first preset at the same time and guarantee to achieve the main body of the audio video frequency synchronization effect.
[0007] needed specification of the avs audio and video the invention is rtp package and sending corresponding to the ground are respectively installed to rtp audio frequency package and video frequency package rtp message and it is not specifically refers to which they are inches the invention is rtp audio video frequency package or rtp package. Received rtp audio frequency package buffer zone of called audio buffer region that receives video frequency package rtp buffer zone of called video buffer area the body which does not have point the invention claims a buffer area when they are formed said audio-video buffer area buffer area or. Audio buffer area of the rtp audio frequency package is to a certain *** one rtp video frequency package formed by the called mapping module mapping module audio video buffer area of the rtp video frequency package is to a certain *** one rtp audio frequency package formed by the mapping module called video frequency mapping file block is not specifically the invention claims a mapping module which is easy to *** said system the mapping module. Also need to get the mapping module it is composed of *** one or more than one rtp packet and a lack mark if sequence number mapping block is not lost it is not be lost serial number mark is composed of. File to be processed the audio frequency media and video frequency media when there is not specifically the media system which is used for representing *** media. Sr packet is *** utility model claims an rtcp packet. The invention requires to rtp packet the packet head field expanding one byte is used to mark the rtp pack number of frames of video frame the frame head frame amount representing. If it is especially the file in the symbol of unit is millisecond.
[0008] based on rtp package of the avs video frequency synchronization method comprising the following steps:
Following steps of i receiving rtp audio video frequency package:
Starting received rtp audio video frequency package thread of the audio buffer area is the initial value to am; Opening video buffer area is the initial value as vm preparing to receive new by rtp audio frequency package and video frequency package rtp;
Step 2 analyzes the package delay to the property and processing:
Starting analyzing rtp packet head field information of the thread analyzing the rtp audio frequency package or rtp video frequency package sequence number of the rtp package sequence number of the towel zhen listener *** in a table of the sequence number from small to big according to the sequence one by one compared with the sequence number and the surface of the sequence number is different and less than the minimum values in the invention is that the late and can realize synchronization of the package bag to directly throw away it does not enter into the buffer area queue; If the sequence number and the surface of the sequence number is different which is larger than surface of the minimum then it proves that the packet is not to delay the packet the packet going into buffer area analyzing the head field information preparing form a new mapping block; If and the surface in sequence numbers are identical then it proves that the delay is the only can be also can realize synchronization of the rtp package to enter buffer zone preparing fast determination in the queue in a position;
To the late but also can realize synchronization of rtp packet firstly finding a missing sequence number of the mark of mapping block then transferring the packet sequence number and the mapping module lacking mark the sequence number and comparing if it is the same then it proves that the packet belonging to the mapping module which is fixed position; If it is different and the lower *** plurality of containing losing sequence number of the mark of mapping block lack mark the sequence number comparing the determining the position;
Step 3 calculating absolute playback time interval:
Analyzing the rtp audio frequency package or rtp video frequency package of the rtp time stamp and obtaining the sender report sr a sender report package of the rtp time stamp and network protocol ntp which network time protocol time stamp calculating the rtp packet represented by the absolute playback start time;
Analyzing rtp audio frequency package or rtp video frequency package the portable * data type of the audio or video frame if it is audio frequency frame the rtp packet is complete the whole audio frequency frame analyzing out its frame number; If it is video frame the rtp package is not to be a whole and the video frame analyzing out the frame head amount; And according to the using interpolation method obtain the corresponding to the absolute playback time interval length;
According to step and calculating the rtp audio frequency package or rtp video packet represented by the absolute playback time interval ] [ x y and x is a absolute playback start time of the y is a absolute playback ending time;
Step 4 building rtp audio video frequency package mapping: Starting mapping thread because of the audio and video at the same axle is absolute time playback the absolute time axis as the bridge is established the rtp pack a plurality of media *** the relative mapping of media at the same time the rtp package to form a new mapping block or adding *** of the existed the mapping module is established mapping rtp package;
Step 5 judging desynchronizing condition media:
Start and judge synchronous lines of the program according to the established is rtp audio frequency package and video frequency package rtp related to absolute playback time of the mapping begin to detect rtp audio frequency package and video frequency package of the rtp desynchronizing condition and to make the corresponding to the adjustment of synchronous situation analysis and losing step is divided into three situations: First condition is that its middle *** media corresponding to the media *** the integrity chi rtp package to the second condition is in a certain media appears in the individual rtp package to delay the third condition is the first and second at the same time the invention claims a method for situation *;
Step 6 process is not synchronizing/ desynchronizing condition:
To the first synchronous signal between media in * and desynchronizing treatment it comprises the steps as follows: It does not delay of the media and the whole body of the delay time t and the rtp package; At the same inches the media buffer area can still receive new from the rtp package to the new of the rtp package to said step 2 is on the judgement processed it only needs to the packet is not to delay and it is not the same step of rtp package to the memory to start to submit request to zeng said buffer capacity to contain more rtp package; The integrity is rtp package to the delay of media then at time t in the waiting time of the rtp package to the cluster -inch at the same to the sending terminal sends feedback information notification sending terminal reduces the media packet frequency;
To the second synchronous condition the media desynchronizing treatment it comprises the steps as follows: The media buffering area in the rtp package does not take the whole time delay processing and it does not to the terminal sends feedback information the interception end *** to intercepts the dan delay but also can realize synchronization of the immediately according to step 2 in the method for processing media in the rapid synchronization;
The third mixed * or the mixture is * firstly does not delay of media to the delay time t and the rtp package; At the same inches the media buffer area can still receive new from the rtp package to the new of the rtp package to said step 2 is on the judgement processed it only needs to the packet is not to delay and it is not the same step of rtp package to the memory to start to submit request to zeng said buffer capacity to contain more rtp package; The integrity is rtp package to the delay of media then at time t in the waiting time of the rtp package group from the sending terminal sends feedback information notification sending terminal reduces the media packet frequency; And at the same time the detecting end *** once intercepts the individual to delay but also can realize synchronization of the immediately according to step 2 in said method to process media is fast and *.
[0009] as the invention is *** improvement step 3 in the calculated in the rtp package to the set starting time to formula is as follows b = ts ts /k and 1000 to the ts is sr for the 64 digits ntp time stamp is sr ts packet in the 32 is rtp time stamp is rtp package to said 32 bits time stamp k is audio or video frame of the sampling frequency.
[0010] as the invention is *** improvement step 3 in the middle of the interpolation method is to the audio frequency known frame the sampling frequency of the k and frame number m uses formula ta m = /k and the interval length of the ta is insulating to the audio frequency the time interval length according to the video if the rtp package and package the whole video frame is calculated according to the audio frequency frame of the method calculating the tv program is the video playback absolute time interval length; Package if only one of the video frames or macro block strip it does not comprise frame head the time interval tv = o; At the same time if there is packaging the video frame head the head of each frame is represented as *** whole of the video frame time the calculation program with and calculating audio frequency frame of the formula is the same frame number m it is video data frame head k is still of the video frame the sampling rate.
[0011] as the invention is *** improvement step 3 in the calculated in rtp audio frequency package absolute playback ending time of the method uses formula to tae = and the ta tae representing the rtp audio frequency package the absolute playback ending time b represents the rtp audio frequency package the absolute playback start time ta representing the rtp audio frequency package the absolute playback time interval length.
[0012] as the invention is *** improvement of the computer rtp video frequency package absolute playback ending time of the method uses formula tve = to the tv in the rtp tve indicating the video frequency package the absolute playback ending time b represents the rtp video frequency package the absolute playback start time is rtp tv indicating the video frequency package the absolute playback time interval length; The rtp audio frequency package will be put the absolute time interval between ta tae on rtp video frequency package will be put the absolute time interval tv tve ] [.
[0013] as the invention is *** improvement of the waiting time t by the following two states determined: If there is the delay of media constantly receives new to rtp packet and the time ti to reach the buffer area of the upper limit for the integrity of rtp package to the delay of media it does not finish the media block mapping at the same time the time t = tl; If there is the delay of media body does not reach the buffer area the upper limit h when the integrity of rtp package to the delay of media in the time t2 has been completed media block mapping at the same time the time t = t2; Media block mapping at the same * is entering the buffer area of each rtp packets can be found relative to the other end of the media mapping but it does not ensure that each mapping each piece is rtp package there is no loss of.
[0014] as the invention is *** improvement in the buffer area it mainly comprises frame monitoring terminal and mapping block two modules the two modules are cooperated working mechanism of the following: *** end of frame monitoring module it mainly comprises *** zhang chi to but also can realize synchronization of rtp package of packet sequence number of the surface of the sequence number in the table from small to big according to the order of storing; When receiving *** new of the rtp package to the package the sequence number and the surface of the sequence number from small to big according to the sequence one by one compared with the sequence number and the surface of the sequence number is different and less than the minimum values in the invention is that the late and can realize synchronization of the package bag to directly throw away it does not enter into the buffer area queue; If the sequence number and the surface of the sequence number is different which is larger than surface of the minimum then it proves that the packet is not to delay the packet the packet going into buffer area analyzing the head field information preparing form a new mapping block; If the serial number and list of some sequence number is the same then it proves that the delay is the only can be also can realize synchronization of the rtp package to the buffer area.
[0015] as the invention is *** improvement to the delay but also can realize synchronous rapidly determine rtp package in the queue in the position of the method is as follows: Firstly finding a missing sequence number of the mark of mapping block then transferring the packet sequence number and the mapping module lacking mark the sequence number and comparing if it is the same then it proves that the packet belonging to the mapping module which is fixed position; If it is different is connected with the upper and lower two *** comprising losing sequence number of the mark of mapping block lack mark the sequence number comparing the determining the position.
[0016] as the invention is *** improves the surface of the two states in real time update: The first one is that when forming *** new mapping block the mapping module is detecting whether or not block or in adjacent block is set between the lacking of rtp packet sequence number at the same time checking whether the neighbouring mapping module which has been make losing sequence number mark; If there is the sequence number is added to the deletion serial number mark in the same time the sequence number transmitted to the interception *** end of the module to update list the list zeng the one of the lost packet sequence number; If there is not be lost serial number mark and it does not to the interception *** end of the surface of the module transmits the sequence number loss; *** is when the mapping module to carry out the rtp package inches and the mapping module still has shortage of the serial number mark the deficiency of mark the sequence number transmitted to the interception *** end of the surface of the middle to update the deleting list and the losing sequence number of the same sequence number.
[0017] this invention has the beneficial effects of this utility model is that: Rtp audio video frequency package after the first synchronization processing is eliminated after the in the network transmission media is generated by the shake and media between the time delay difference. Message exchange between the rtp package to the audio video frequency media has finished the initial * the synchronization of this utility model can ensure the subsequent the avs system to the audio frequency decoding then accurate and synchronous playback.
[0018] the method of the invention is the most obvious feature is rtp it fully makes use of the audio video frequency package the head field portable * the time stamp information and the transmitting terminal executes the rtp package the mark the rtp package head field the data type frame amount information and so on the first do once it is complete effective synchronous processing it ensures the follow-up of the avs system to carry out precise audio video frequency synchronization playing back. The method can be the medium in the synchronous media the desynchronizing and mixed synchronous to effectively adjust so as to reach the avs video main body of the synchronous effect at the same time because it adopts dynamic application buffer area the method avoids the memory in the waste of resource.
Specification attached drawing
[0019] i receiving an rtp audio video frequency package the audio video buffer structure image display;
Picture 2 the first rtp video frequency package setting up relating to time of map it is not;
Picture 3 rtp audio video frequency package the media is as diagram;
Picture 4 rtp audio video frequency package the synchronous media the image display; 5 rtp an audio video frequency package the mixed synchronous diagram;
Picture 6 rtp audio video frequency package effectively at the same time of the image display;
Picture 7 rtp audio video frequency package the synchronous process of image display.
Specific implementing manner
[0020] a lower surface of the attached drawing specification and a specific embodiment of this invention the invention further ***.
[0021] practical implement method is as follows:
I receiving rtp audio video frequency package:
Starting received rtp audio video frequency package thread of the audio buffer area is the initial value to am; Opening video buffer area is the initial value as vm preparing to receive new by rtp audio frequency package and video frequency package rtp. Image in the i a1 a2
Is rtp an audio frequency package sequence number of vm vi v2 is rtp video frequency package sequence number of said represented by the real sequence number and is not necessarily is continuous. The outside of i image in other image does not have picture output audio frequency *** end of video interception interception port and deficiency of mark of the actual is the only is used for subsequent clearly the invention is not drawn out to.
[0022] 2 analyzes the package delay to the property and processing:
Starting analyzing the rtp packet head field information of the thread analyzing the rtp audio frequency package or rtp video frequency package sequence number of the rtp package sequence number of the towel zhen listener *** in a table of the sequence number from small to big according to the sequence by a comparison. If the sequence number and the surface of the sequence number is different and less than the minimum values in the invention is that the late and can realize synchronization of the package bag to directly throw away it does not enter into the buffer area queue; If the sequence number and the surface of the sequence number is different which is larger than surface of the smallest common than the maximum of the invention is the packet is not to delay the packet the packet going into buffer area analyzing the head field information preparing form a new mapping block; If and the surface in sequence numbers are identical then it proves that the delay is the only can be also can realize synchronization of the rtp package to enter buffer zone preparing fast determination in the queue in a position. The audio and video buffer area the structure is as picture i show.
[0023] to the late but also can realize synchronization of rtp packet firstly finding a missing sequence number of the mark of mapping block then transferring the packet sequence number and the mapping module lacking mark the sequence number and comparing if it is the same then it proves that the packet belonging to the mapping module which is fixed position; If it is different and the lower *** plurality of containing losing sequence number of the mark of mapping block lack mark the sequence number comparing the determining the position. So as to realize the audio medium in the fast at the same *.
[0024] calculating absolute playback time interval:
Continuous parsing thread and starting the computer thread.
[0025] analyzing the rtp audio frequency package or rtp video frequency package of the rtp time stamp and obtaining any one of sr the rtp time stamp and ntp time stamp. Calculating the rtp packet represented by the absolute playback start time of the calculated in the rtp package to the set starting time to formula is as follows b = ts ts /k and 1000 to the ts is sr for the 64 digits ntp time stamp is sr ts packet in the 32 is rtp time stamp is rtp package to said 32 bits time stamp k is audio or video frame of the sampling frequency.
[0026] analyzing rtp audio frequency package or rtp video frequency package the portable * data type of the audio or video frame if it is audio frequency frame the rtp packet is complete the whole audio frequency frame analyzing out its frame number; If it is video frame the rtp package is not to be a whole and the video frame analyzing out the frame head amount; And according to the using interpolation method obtain the corresponding to the absolute playback time interval length; And according to the using interpolation method obtain the corresponding to the absolute playback time interval length of the interpolation method is to the audio frequency known frame the sampling frequency of the k and frame number m uses formula ta m = /k and the interval length of the ta is insulating to the audio frequency the time interval length. To the video if the rtp package and package the whole video frame is calculated according to the audio frequency frame of the method calculating the tv program is the video playback absolute time interval length; Package if only one of the video frames or macro block strip it does not comprise frame head the time interval tv = o; At the same time if there is packaging the video frame head the head of each frame is represented as *** whole of the video frame time the calculation program with and calculating audio frequency frame of the formula is the same frame number m it is video data frame head k is still of the video frame the sampling rate.
[0027] according to step and calculating the rtp audio frequency package or rtp video packet represented by the absolute playback time interval ] [ x y and x is a absolute playback start time of the y is a absolute playback ending time.
[0028] calculating rtp audio frequency package absolute playback ending time of the method uses formula to tae = and the ta tae representing the rtp audio frequency package the absolute playback ending time b represents the rtp audio frequency package the absolute playback start time ta representing the rtp audio frequency package the absolute playback time interval length.
[0029] calculating rtp video frequency package absolute playback ending time of the method uses formula tve = to the tv in the rtp tve indicating the video frequency package the absolute playback ending time b represents the rtp video frequency package the absolute playback start time is rtp tv indicating the video frequency package the absolute playback time interval length. With rtp audio frequency package is set as an example *** audio frequency package with 150 audio frequency frame rate 8k the sampling interval time l per 8ms we can use calculating the interval length 18 75ms. Is set on the whole frame of the rtp video frequency package is same to the processing is equipped with strip belt or macro blocks and they are through judging the rtp is set on the frame head to amount of calculation interval length.
[0030] rtp according to the audio frequency package will be put the absolute time interval between ta tae on rtp video frequency package will be put the absolute time interval tv tve ] [.
[0031] 4 building rtp audio video frequency package mapping:
Starting mapping thread because of the audio and video at the same axle is absolute time playback the absolute time axis as the bridge is established the rtp pack a plurality of media *** the relative mapping of media at the same time the rtp package to form a new mapping block or adding *** of the existed the mapping module rtp packet established mapping and forming mapping is shown as picture 2 1.
[0032] 5 judging desynchronizing condition media:
Start and judge synchronous lines of the program according to the established is rtp audio frequency package and video frequency package rtp related to absolute playback time of the mapping begin to detect rtp audio frequency package and video frequency package of the rtp desynchronizing condition and to make the corresponding to the adjustment of synchronous situation analysis and losing step is divided into three situations first condition is that its middle *** media corresponding to the media *** is rtp package integrity chi rtp package to the called number of rtp package such as media the continuous three or more than one rtp packet sequence number loss we can be judged as the first condition is as follow the picture 3 represented; The second condition is in a certain media appears in the rtp pack delay for each such as media the continuous two and the lower part of the rtp pack delay the time they can be used to judge that the first and second condition in step 4 the display picture; The third condition is the first and second at the same time the condition such as media at the same time the continuous three and is rtp package to the delaying and continuous two and is rtp delay the time they can be used for judging as the third condition of losing step 5 shown as picture.
[0033] 6 process is not synchronizing/ desynchronizing condition:
Initiate synchronous thread.
[0034] to the first synchronous * between media in the condition of losing * processing steps are as follows: It does not delay of the media and the whole body of the delay time t and the rtp package. At the same inches the media buffer area can still receive new from the rtp package to the new of the rtp package to said step 2 is on the judgement processed it only needs to the packet is not to delay and it is not the same step of rtp package to the memory to start to submit request to zeng said buffer capacity to contain more rtp package. The integrity is rtp package to the delay of media then at time t in the waiting time of the rtp package to the group at the same time to the sending terminal sends feedback information notification sending terminal reduces the media packet frequency.
[0035] to the second synchronous information * the media desynchronizing treatment it comprises the steps as follows: The media buffering area in the rtp package the do not the whole time delay processing and it does not to the terminal sends feedback information the interception end *** to intercepts the dan delay but also can realize synchronization of the immediately according to step 2 in said method to process media is fast and *.
[0036] the third mixed * or the mixture is * firstly does not delay of media to the delay time t and the rtp package. At the same inches the media buffer area can still receive new from the rtp package to the new of the rtp package to said step 2 is on the judgement processed it only needs to the packet is not to delay and it is not the same step of rtp package to the memory to start to submit request to zeng said buffer capacity to contain more rtp package. The integrity is rtp package to the delay of media then at time t in the waiting time of the rtp package group from the sending terminal sends feedback information notification sending terminal reduces the media packet frequency. And at the same time the detecting end *** dan intercepts the individual to delay but also can realize synchronization of the immediately according to step 2 in said method to process media is fast and *.
[0037] to the three conditions to make the synchronization and after processing if the displaying picture 6.
[0038] the waiting time t by the following two states determined: If there is the delay of media constantly receives new to rtp packet and the time ti to reach the buffer area of the upper limit for the integrity of rtp package to the delay of media it does not finish the media block mapping at the same time the time t = tl; If there is the delay of media body does not reach the buffer area the upper limit h when the integrity of rtp package to the delay of media in the time t2 has been completed media block mapping at the same time the time t = t2. Media block mapping at the same time it is entering the buffer area of each rtp packets can be found relative to the other end of the media mapping but it does not ensure that each mapping each piece is rtp package there is no loss of the point-to-point mapping *** is special so it has little appear *.
[0039] rtp audio video frequency package after the first synchronization processing is eliminated after the in the network transmission media is generated by the shake and media between the time delay difference between the language * to rtp packet when the audio video frequency media has finished the initial * the synchronization of this utility model can ensure the subsequent the avs system after decoding to carry out accurately synchronous playback.
[0040] the operation process with the rtp package to the time to carry out treatment so as to fast deal can be different condition of losing *.
[0041] the audio buffer it is mainly comprised of audio frequency frame monitoring terminal and audio frequency mapping the two modules. The two modules are cooperated working mechanism of the following:
Audio frequency frame listener *** module it mainly comprises *** zhang chi to but also can realize synchronization of rtp audio frequency package of packet sequence number of the surface of the sequence number in the table from small to big according to the order of storing. When receiving *** new of the rtp audio frequency package is the package the sequence number and the surface of the sequence number from small to big according to the sequence by a comparison. If the sequence number and the surface of the sequence number is different and less than the minimum values in the invention is that the late and can realize synchronization of the package bag to directly throw away it does not enter into the buffer area queue; If the sequence number and the surface of the sequence number is different which is larger than surface of the smallest common than the maximum of the invention is the packet is not to delay the packet the packet going into buffer area analyzing the head field information preparing form a new audio block mapping; If the serial number and list of some sequence number is the same then it proves that the delay is the only can be also can realize synchronization of audio frequency package the rtp package to the buffer area preparing fast determination in the queue in a position.
[0042] late but also can realize synchronization of rtp audio frequency package quickly determining in the queue in the position of the method of: Firstly finding a missing sequence number of the mark of mapping block then transferring the packet sequence number and the mapping module lacking mark the sequence number and comparing if it is the same then it proves that the packet belonging to the mapping module which is fixed position; If it is different is connected with the upper and lower two *** comprising losing sequence number of the mark of mapping block lack mark the sequence number comparing the determining the position. So as to realize the audio media by fast synchronization.
[0043] on the surface of the two states in real time update: The first one is that when forming *** a new audio the mapping module mapping module is detecting whether or not block or in adjacent block is set between the lacking of rtp audio frequency package sequence number at the same time checking whether the neighbouring mapping module which has been make losing sequence number mark; If there is the sequence number is added to the deletion serial number mark in the same time the sequence number transmitted to the audio signal hearing *** end of the module to update list the list zeng the one of the lost packet sequence number; If there is not be lost serial number mark and it does not to the interception *** end of the surface of the module transmits the sequence number loss. *** is that when an audio frequency mapping module to carry out the audio frequency package inches or rtp and the mapping module still has shortage of the serial number mark the deficiency of mark the sequence number transmitted to the audio signal hearing *** end of the surface of the middle to update the deleting list and the losing sequence number of the same sequence number. So as to finish the updating.
0044 ] and [ the corresponding to the video buffer region is also set with corresponding to the two modules such as image i show and the audio frequency is different from that of the working mechanism.
[0045] the content is combined with the main body of the preferred embodiment of this invention the detailed *** step the invention can not be determined this invention claims a concrete actualizing of only limited in the specification. To the invention belongs to technical field of the common technical personnel to said it is not separated from the invention is designed under the premise of it also can make several is single push and pull or replace all the as when it belongs to the invention claims a protection range.
7 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7
Every citation, both waysCites: the store holds 3 of 4
| Document | Relation | Office | Category | Cited during | Relevant claims |
|---|---|---|---|---|---|
| CN109905725A | Cited by | China | – | Search report | – |
| CN110446113A | Cited by | China | – | Search report | – |
| CN113225598A | Cited by | China | – | Search report | – |
| CN103826084A | Cited by | China | – | Search report | – |
| CN113099310A | Cited by | China | – | Search report | – |
| CN103561260A | Cited by | China | – | Search report | – |
| CN113207021A | Cited by | China | – | Search report | – |
| CN103607664A | Cited by | China | – | Search report | – |
| CN113115080A | Cited by | China | – | Search report | – |
| CN103945371A | Cited by | China | – | Search report | – |
| CN105393547A | Cited by | China | – | Search report | – |
| CN110225385A | Cited by | China | – | Search report | – |
| CN103414957A | Cited by | China | – | Search report | – |
| US11146611B2 | Cited by | United States of America | – | Applicant | – |
| CN112564837A | Cited by | China | – | Search report | – |
| CN115460454A | Cited by | China | – | Search report | – |
| CN108200481A | Cited by | China | – | Search report | – |
| CN109565466A | Cited by | China | – | Search report | – |
| CN106598884A | Cited by | China | – | Search report | – |
| CN101272383A | Cites | China | A | Search report | 1-9 |
| US2007242670A1 | Cites | United States of America | A | Search report | 1-9 |
| US2010183000A1 | Cites | United States of America | A | Search report | 1-9 |
| 郭尧: "基于AVS的嵌入式音视频同步传输系统设计", 《中国优秀硕士学位沦为全文数据库 信息科技辑》 | Non-patent | – | – | Search report | – |
| 任时珍等: "基于RTP/RTCP协议的实时数据传输与同步控制策略", 《计算机工程与应用》 | Non-patent | – | – | Search report | – |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 201210151664 | China | A | |
| CN20121151664 | – | – | – |
4 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Termination of patent right due to non-payment of annual feeCF01 | CF01 | |
| Grant of patent or utility modelGrantedC14 | C14 | |
| Entry into substantive examinationC10 | C10 | |
| PublicationC06 | C06 |
Numbers
- Publication
- 102665141
- Publication, DOCDB
- 102665141
- Publication, EPODOC
- CN102665141
- Application
- 101516649
- Application, DOCDB
- 201210151664
- Application, EPODOC
- CN20121151664
Titles3
- English
- Based on rtp package of avs video frequency synchronization method of preventing
- Chinese
- 一种基于RTP封装的AVS音视频预同步方法
- English
- AVS (audio video standard) audio and video presynchronizing method based on RTP (real time protocol) package
Classification
- IPC, 2
- H04N21 6437
- H04N21 8547