[Live-devel] rtp synchronization

kingaceck kingaceck at 163.com
Sun Mar 31 20:22:12 PDT 2013


Hi

I use live555 to transport h264 and aac stream from mp4 file.At the client when I play it automatic (don't clike the progress bar) the video and audio can  synchronization.

But when I clicked on the progress bar (can call seekStreamSource(...) ) the video and audio can not synchronization.The audio lag . I try to resolve it for many days,but I 

cant by now.Can you give me your suggestions .Tank you very very very much!

void FfmpegDemux::seekStreamSource(double seekNPT) {
//format_ctx_->streams[this->server_demux_->audio_stream_id_]->time_base
int64_t  pos = (int64_t)(seekNPT * AV_TIME_BASE);
pos = av_rescale_q(pos, AV_TIME_BASE_Q,format_ctx_->streams[this->server_demux_->audio_stream_id_]->time_base);
av_seek_frame(format_ctx_, this->server_demux_->audio_stream_id_, pos, AVSEEK_FLAG_ANY); //timestamp is usec AVSEEK_FLAG_ANY AVSEEK_FLAG_BACKWARD
//av_seek_frame(format_ctx_, -1, seekNPT*1000*1000, AVSEEK_FLAG_BACKWARD); //timestamp is usec
// if(seekNPT>0)
// avcodec_flush_buffers(format_ctx_->streams[this->server_demux_->audio_stream_id_]->codec);
}

2013-04-01 



kingaceck 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130401/5668d961/attachment.html>


More information about the live-devel mailing list