On Tue, Jan 23, 2018 at 1:19 AM, kckang <kck...@skycom.ne.kr> wrote: > //this code is not work > > dts = av_gettime() / 1000; > dts = dts * 25; > printf( "DTS:%l",dts); > dts = av_gettime(); > int duration = 20; // 20 > if(m_prevAudioDts > 0LL) { > duration = dts - m_prevAudioDts; > } > > m_prevAudioDts = dts; > m_currAudioDts += duration; > pkt.duration = duration; > > > > > > this one means pts/dts....
I think you are talking about keeping the pts of the streams in-sync. Have you tried rescaling the packet pts/dts/duration like in the remuxing example? You should use the packet input from each source (audio and video) and just rescale with the new stream time_base before writing. https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remuxing.c#L160 corey _______________________________________________ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user