int64_t timeBase = (int64_t(pVideoCodecCtx->time_base.den))/int64_t(pVideoCodecCtx->time_base.num); int64_t seekTarget = int64_t(SEEK_TARGET*1000) * timeBase; if (av_seek_frame(pFormatCtx, 0, seekTarget, AVSEEK_FLAG_ANY) >= 0) { ...