[FFmpeg-devel,V1] ffmpeg: fix video_delay warning for HEVC/MPEG4 decoding

Submitted by Jun Zhao on Sept. 26, 2018, 9:49 a.m.

Details

Message ID 1537955394-29009-1-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao Sept. 26, 2018, 9:49 a.m.
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: #6109

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

Comments

Carl Eugen Hoyos Sept. 26, 2018, 3:35 p.m.
2018-09-26 11:49 GMT+02:00, Jun Zhao <mypopydev@gmail.com>:
> 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

Can you provide such a hevc sample?

Carl Eugen
mypopy@gmail.com Sept. 27, 2018, 12:41 a.m.
On Wed, Sep 26, 2018 at 11:36 PM Carl Eugen Hoyos <ceffmpeg@gmail.com>
wrote:
>
> 2018-09-26 11:49 GMT+02:00, Jun Zhao <mypopydev@gmail.com>:
> > 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
>
> Can you provide such a hevc sample?
>
Hi, Carl:

The HEVC clips have some license  issue, so I can't provide the clips,
sorry about  this.

I use the test clips from
https://software.intel.com/en-us/stress-bitstreams-and-encoder, now is
http://vicuesoft.com/

Patch hide | download patch | download mbox

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,