[FFmpeg-trac] #9283(avcodec:new): key_frame flag not set in AVFrame using cuviddec on interlaced h264

FFmpeg trac at avcodec.org
Tue Jun 8 18:49:52 EEST 2021


#9283: key_frame flag not set in AVFrame using cuviddec on interlaced h264
-------------------------------------+-------------------------------------
             Reporter:  stuhlo       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avcodec      |                  Version:  4.3.2
             Keywords:  cuvid nvdec  |               Blocked By:
  avc h264                           |
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------
 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`.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9283>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list