• Zhong Li's avatar
    lavc/encode: fix frame_number double-counted · d91370e0
    Zhong Li authored
    Encoder frame_number may be double-counted if some frames are cached and then flushed.
    Take qsv encoder (some frames are cached firsty for asynchronism) as example,
    ./ffmpeg -loglevel verbose -hwaccel qsv -c:v h264_qsv -i in.mp4 -vframes 100 -c:v h264_qsv out.mp4
    frame_number passed to encoder is double-counted and larger than the accurate value.
    Libx264 encoding with B frames can also reproduce it.
    Signed-off-by: 's avatarZhong Li <zhong.li@intel.com>
    d91370e0
encode.c 14.6 KB