From ea8ffb5bc10cf64c947266d647189759e98c0709 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Mon, 31 Oct 2022 18:57:51 -0500 Subject: [PATCH] Add fallback for AVFrame.pkt_dts, which is only used on certain codecs (AV1) --- src/FFmpegReader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index e5e19823..7e69f012 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1180,6 +1180,9 @@ bool FFmpegReader::GetAVFrame() { // This is the current decoded frame (and should be the pts used) for // processing this data video_pts = next_frame->pts; + } else if (next_frame->pkt_dts != AV_NOPTS_VALUE) { + // Some videos only set this timestamp (fallback) + video_pts = next_frame->pkt_dts; } // break out of loop after each successful image returned