Opened 3 years ago

Closed 3 years ago

#9283 closed defect (fixed)

key_frame flag not set in AVFrame using cuviddec on interlaced h264

Reported by: stuhlo Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: cuvid
Cc: stuhlo Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Using cuviddec through ffmpeg API, decoded frames never contain flag key_frame set.

The problem occurs when decoding interlaced input where each field is stored in a separate packet. A pair of fields is decoded as a single frame. In the function cuvid_handle_picture_decode, the last seen key frame is marked in the array ctx->key_frame according to picparams->CurrPicIdx. If two subsequent fields represent a single decoded frame (i.e. they share CurrPicIdx) and only the first one is entirely intra -coded (i.e. it is a key frame), handling the second field in the function cuvid_handle_picture_decode overwrites the key_frame flag before it can be read in the function cuvid_output_frame.

Attachments (1)

ffmpeg-cuvid-keyframe-fix.patch (1.4 KB ) - added by stuhlo 3 years ago.
patch for the bug

Download all attachments as: .zip

Change History (4)

by stuhlo, 3 years ago

patch for the bug

comment:1 by Carl Eugen Hoyos, 3 years ago

Analyzed by developer: unset
Keywords: nvdec avc h264 removed
Reproduced by developer: unset
Version: 4.3.2unspecified

Patches (and patch suggestions) are unfortunately ignored here, please send your patch to the FFmpeg mailing list.

in reply to:  1 comment:2 by stuhlo, 3 years ago

Replying to Carl Eugen Hoyos:

Patches (and patch suggestions) are unfortunately ignored here, please send your patch to the FFmpeg mailing list.

I sent it. Thx.

comment:3 by Balling, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.