Opened 3 weeks ago

Last modified 3 weeks ago

#10961 new task

RTSP h264 hardware decode shows a very strange log: Increasing reorder buffer to 1920921104

Reported by: hechuan Owned by:
Priority: critical Component: avcodec
Version: 4.2.9 Keywords: FFmpeg decode hw_decode RTSP
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Use FFmpeg to hardware decode (h264_nvdec) two RTSP h264 IP camera.Eache camera has a seperate thread to read frame, decode and scale.After run some time, ffmpeg show some very strange log as blow:

1710848158.543170 [243] [debug] non-existing PPS 1920921104 referenced
1710848158.543174 [243] [debug] decode_slice_header error
1710848158.543174 [243] [debug] no frame!
1710848158.647788 [243] [debug] non-existing PPS 1920957856 referenced
1710848158.647867 [243] [debug] non-existing PPS 1920921104 referenced
1710848158.647872 [243] [debug] decode_slice_header error
1710848158.647873 [243] [debug] no frame!
1710848158.705852 [243] [debug] error while decoding MB 1920958160 0, bytestream -6
1710848158.763328 [243] [debug] Increasing reorder buffer to 1920921104
1710848160.782519 [265] [debug] Increasing reorder buffer to 635491232
1710864812.410619 [260] [debug] SEI type 1101054320 size 0 truncated at 136
1710864812.410726 [260] [debug] SEI type 1101055152 size 0 truncated at 134
1710864812.453565 [265] [debug] SEI type 635527536 size 0 truncated at 136
1710864812.453646 [265] [debug] SEI type 635528368 size 0 truncated at 132
1710864812.470501 [260] [debug] SEI type 1101054320 size 0 truncated at 136
1710864812.470550 [260] [debug] SEI type 1101055152 size 0 truncated at 134
1710864812.500707 [260] [debug] SEI type 1101054320 size 0 truncated at 136

Used version: 4.2.9

I read ffmpeg source code, the key code as blow:

out_of_order = MAX_DELAYED_PIC_COUNT - i;
if( cur->f->pict_type == AV_PICTURE_TYPE_B

(h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - (int64_t)h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))

out_of_order = FFMAX(out_of_order, 1);

if (out_of_order == MAX_DELAYED_PIC_COUNT) {

av_log(h->avctx, AV_LOG_VERBOSE, "Invalid POC %d<%d\n", cur->poc, h->last_pocs[0]);
for (i = 1; i < MAX_DELAYED_PIC_COUNT; i++)

h->last_pocs[i] = INT_MIN;

h->last_pocs[0] = cur->poc;
cur->mmco_reset = 1;

} else if(h->avctx->has_b_frames < out_of_order && !sps->bitstream_restriction_flag){

int loglevel = h->avctx->frame_number > 1 ? AV_LOG_WARNING : AV_LOG_VERBOSE;
av_log(h->avctx, loglevel, "Increasing reorder buffer to %d\n", out_of_order);
h->avctx->has_b_frames = out_of_order;

}

It seems that, out_of_order will never be a so large number!!!
If so, I think hardware decoder will appear "No decoder surfaces left" error.

Attachments (1)

ffmpeg_increasing_order_to_large_number.txt (8.3 KB ) - added by hechuan 3 weeks ago.

Download all attachments as: .zip

Change History (2)

comment:1 by hechuan, 3 weeks ago

Please help me, I would appreciate it so much.

Note: See TracTickets for help on using tickets.