#11548 closed defect (invalid)

Extra keyframe when encoding with x264

Reported by: David Johansen Owned by:
Priority: normal Component: avformat
Version: 7.1 Keywords: force_key_frames
Cc: David Johansen Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

./ffmpeg -i repeated_keyframe.mp4 -c:v libx264 -force_key_frames source -f hls index.m3u8

It appears that the problem is that in X264_frame of libx264.c on ctx->frame_num of 318 the value pic_out.b_keyframe is 1 and it already was on 316. I tried adding no-scenecut=1 and min-keyint but neither of those changed the output, and you can see that the second entry in index.m3u8 is a very short duration (#EXTINF:0.040000) and this is an extra segments since there should only be two in index.m3u8

I tried outputting to a .mp4 which I assumed would reproduce the same issue, but it does not, so something is behaving different with the specific use of the hls output.

Using this video as an example:
​https://drive.google.com/file/d/1oaK-G7jMdOk2Qt3yOXPvF8E7W8NuhtGv/view?usp=sharing

Change History (1)

comment:1 by David Johansen, 19 months ago

Resolution: → invalid
Status: new → closed

The problem is actually that keyint defaults to 250 and this was causing a keyframe to trigger just before the actual one in this example file.

Note: See TracTickets for help on using tickets.