[Libav-user] MUX Synchronize dts/pts/basetime does it mandatory?

Corey Taylor corey.taylor.fl at gmail.com
Tue Jan 23 12:21:03 EET 2018


On Tue, Jan 23, 2018 at 1:19 AM, kckang <kckang at 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


More information about the Libav-user mailing list