[Live-devel] audio and vedio can not synchronization

kingaceck kingaceck at 163.com
Mon Mar 18 02:43:14 PDT 2013


Hi

   I am using live555 to support mp4 file that with h264 and aac.when vlc play the mp4 file automation the audio and vedio can synchronization .If I click the progress bar to jump to a special position the audio and vedio can not synchronization .What can I do to resolve the problem.Thank you.

In the subsession I rewrite the seekStreamSource like this:

void FfmpegH264ServerMediaSubsession
::seekStreamSource(FramedSource* inputSource, double& seekNPT, double /*streamDuration*/, u_int64_t& /*numBytes*/) {
  H264VideoStreamFramer* framer = (H264VideoStreamFramer*)inputSource;
     framer->flushInput();
  // "inputSource" is a filter; its input source is the original elem stream source:
     FfmpegDemuxedElementaryStream* elemStreamSource
    = (FfmpegDemuxedElementaryStream*)(((FramedFilter*)inputSource)->inputSource());
  // Next, get the original source demux:
  FfmpegDemux& sourceDemux = elemStreamSource->sourceDemux();
  // and flush its input buffers:
  sourceDemux.FlushInput();
  sourceDemux.seekStreamSource(seekNPT);
}

void FfmpegDemux::seekStreamSource(double seekNPT) {
av_seek_frame(format_ctx_, -1, seekNPT * 1000 * 1000, AVSEEK_FLAG_BACKWARD); //timestamp is usec
}


2013-03-18 



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


More information about the live-devel mailing list