[FFmpeg-devel] [PATCH V2] ffmpeg: fix video_delay warning for HEVC/MPEG4 decoding

Jun Zhao mypopydev at gmail.com
Wed Sep 26 13:03:19 EEST 2018


For HEVC/MPEG4, we also need video_delay from the decoder, when decoding
some HEVC/MPEG4 clips, got numerous log like:
"video_delay is larger in decoder than demuxer", similar ticket: #3711

fix ticket: #6019

Signed-off-by: Lin Xie<lin.xie at intel.com>
Signed-off-by: Jun Zhao <jun.zhao at intel.com>
---
 fftools/ffmpeg.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 934dc71..7e939d0 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2389,7 +2389,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
     // The following line may be required in some cases where there is no parser
     // or the parser does not has_b_frames correctly
     if (ist->st->codecpar->video_delay < ist->dec_ctx->has_b_frames) {
-        if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) {
+        if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264 ||
+            ist->dec_ctx->codec_id == AV_CODEC_ID_HEVC ||
+            ist->dec_ctx->codec_id == AV_CODEC_ID_MPEG4) {
             ist->st->codecpar->video_delay = ist->dec_ctx->has_b_frames;
         } else
             av_log(ist->dec_ctx, AV_LOG_WARNING,
-- 
1.7.1



More information about the ffmpeg-devel mailing list