You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/nvenc: don't queue and offset dts for AV1
dts != pts is actually a spec violation for AV1, given it has no reordering in the classical sense. We don't really need the whole timestamp queue in this case and can just pass through the timestamp as is for both dts and pts.
This commit is contained in:
@@ -2170,9 +2170,13 @@ static int nvenc_set_timestamp(AVCodecContext *avctx,
|
||||
NvencContext *ctx = avctx->priv_data;
|
||||
|
||||
pkt->pts = params->outputTimeStamp;
|
||||
pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
|
||||
|
||||
if (avctx->codec_descriptor->props & AV_CODEC_PROP_REORDER) {
|
||||
pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
|
||||
pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1);
|
||||
} else {
|
||||
pkt->dts = pkt->pts;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2582,6 +2586,8 @@ static int nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
|
||||
|
||||
if (frame && frame->buf[0]) {
|
||||
av_fifo_write(ctx->output_surface_queue, &in_surf, 1);
|
||||
|
||||
if (avctx->codec_descriptor->props & AV_CODEC_PROP_REORDER)
|
||||
timestamp_queue_enqueue(ctx->timestamp_list, frame->pts);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user