How to use use_wallclock_as_timestamps?

Viewed 3927

I try to use_wallclock_as_timestamps in the video.

The -use_wallclock_as_timestamps option tells FFmpeg to ignore those timestamps and instead use the wallclock time:

if (s->use_wallclock_as_timestamps)
    pkt->dts = pkt->pts = av_rescale_q(av_gettime(), AV_TIME_BASE_Q, st->time_base);

But it do not work.

1 Answers

You should rescale value from codec to stream timebase:

pkt->dts = pkt->pts = av_rescale_q(av_gettime(), codecContext->time_base, stream->time_base);
Related