diff --git a/src/encmain.c b/src/encmain.c index 7422a1b2..3c2b750c 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -190,6 +190,9 @@ static void* input_read_thread(void* in_args) goto done; } + // Set PTS to make sure we pass it on correctly. + frame_in->pts = frames_read; + bool read_success = yuv_io_read(args->input, args->opts->config->width, args->opts->config->height, diff --git a/src/encoderstate.c b/src/encoderstate.c index 3e6830af..b53f994c 100644 --- a/src/encoderstate.c +++ b/src/encoderstate.c @@ -823,6 +823,8 @@ static void encoder_set_source_picture(encoder_state_t * const state, kvz_pictur state->tile->frame->rec = kvz_image_copy_ref(frame); } else { state->tile->frame->rec = kvz_image_alloc(state->encoder_control->chroma_format, frame->width, frame->height); + state->tile->frame->rec->dts = frame->dts; + state->tile->frame->rec->pts = frame->pts; } kvz_videoframe_set_poc(state->tile->frame, state->frame->poc);