<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">But if I use the vlc to play it, the audio's pts is out of range, and it's dropped.<br>but it works by ffplay.<br>I don't know where is wrong. <br>Could you help me to check it where is wrong. I'm crazy caused by this problem.<br>Here is my code.<br>audio is g711, each buffer is 160 bytes.<br>void AudioFrameSource::doGetNextFrame()<br>{<br>    unsigned acquiredFrameSize=0;<br>    if(m_session!=NULL)<br>  {<br>      m_session->GetNextAudioFrame((char*)fTo,fMaxSize,&acquiredFrameSize,&fNumTruncatedBytes);<br>      if(acquiredFrameSize!=0)<br>      {<br>          if(_isFirst)<br>            {<br>                m_session->GetTimeScale(&_timeval);<br>                _isFirst = false;<br>            }<br>            else<br>            {<br>                _timeval.tv_usec += 20000;<br>                if(_timeval.tv_usec>=1000000)<br>                {<br>                    _timeval.tv_sec ++;<br>                    _timeval.tv_usec -= 1000000;<br>                }<br>            }<br>            fFrameSize = acquiredFrameSize;<br>            fPresentationTime = _timeval;<br>           // fDurationInMicroseconds = 20000;<br>      }<br>  }<br><br>    nextTask() = envir().taskScheduler().scheduleDelayedTask(20000,(TaskFunc*)FramedSource::afterGetting, this);<br>}<br><br><br>video's getnextframe<br>each buffer is  h264 nalu, and the stream's average framerate is 25fps.<br>void VideoFrameSource::doGetNextFrame()<br>{<br>  unsigned int framesize=0;<br>  if(m_session!=NULL)<br>  {<br>      bool lastnalu=false;<br>      m_session->GetNextVideoFrame(_firstframe,lastnalu,(char*)fTo,fMaxSize,&framesize,&fNumTruncatedBytes);<br>      fFrameSize = framesize;<br>      if(framesize!=0)<br>      {<br>          if(_firstframe)<br>          {<br>               m_session->GetTimeScale(&_timescale);<br>               _firstframe = false;<br>          }<br>          else if(lastnalu)<br>          {<br>                _timescale.tv_usec += 40000;<br>                if(_timescale.tv_usec>=1000000)<br>                {<br>                    _timescale.tv_sec ++;<br>                    _timescale.tv_usec -= 1000000;<br>                }<br>          }<br>        fPresentationTime = _timescale;<br>       // fDurationInMicroseconds = 40000;<br>      }<br>  }<br><br>   nextTask() = envir().taskScheduler().scheduleDelayedTask(8000,(TaskFunc*)FramedSource::afterGetting, this);<br>}<br><br><div></div><div id="divNeteaseMailCard"></div><br>At 2013-10-24 16:35:56,"Ross Finlayson" <finlayson@live555.com> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial;">I saw the FAQ in live555 website.<div>It said the live555 sync the audio and video by RTCP's SR packets. </div><div>So I should create RTCP instance for each RTP source explititly?<br></div></div></blockquote><div><br></div>No, because (assuming that you are controlling the streaming using RTSP) this is done implicitly.</div><div><br></div><div>(In the RTSP server, this is done when the stream starts playing; in the RTSP client, it is done in the implementation of the "initiate()" function.)</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></blockquote></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>