Opened 11 months ago
#10372 new defect
Keyframes are not inserted as specified by -force_key_frames in libaom-av1 encoder
| Reported by: | nicol | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avcodec |
| Version: | git-master | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the bug: When a keyframe location with no -force_key_frames specified is specified again with -force_key_frames, the keyframe is shifted back one frame and the keyframe is inserted consecutively with the original keyframe.
How to reproduce:
Check the keyframe location without -force_key_frames.
ffmpeg -f lavfi -i mptestsrc=r=30:d=5:t=all -c:v libaom-av1 -crf 31 -b:v 0 -g 60 -cpu-used 8 mptestsrc.mp4 -y
ffprobe -v error -i mptestsrc.mp4 -select_streams v:0 -show_entries packet=flags -of flat | grep -e K - | sed -e "s/[^0-9]//g" | awk -F ',' 'NR==1,NR==ENS {print $1}'
0
60
120
Check keyframe locations by specifying -force_key_frames.
ffmpeg -f lavfi -i mptestsrc=r=30:d=5:t=all -c:v libaom-av1 -crf 31 -b:v 0 -g 60 -cpu-used 8 -force_key_frames expr:eq(n,60)+eq(n,120) mptestsrc3.mp4 -y
ffprobe -v error -i mptestsrc3.mp4 -select_streams v:0 -show_entries packet=flags -of flat | grep -e K - | sed -e "s/[^0-9]//g" | awk -F ',' 'NR==1,NR==ENS {print $1}'
0
60
61
120
121
The desired behavior is the same as libsvtav1 encoder.
ffmpeg -f lavfi -i mptestsrc=r=30:d=5:t=all -c:v libsvtav1 -crf 31 -b:v 0 -g 60 -preset 8 -svtav1-params enable-force-key-frames=1 -force_key_frames expr:eq(n,60)+eq(n,120) mptestsrc4.mp4 -y
ffprobe -v error -i mptestsrc4.mp4 -select_streams v:0 -show_entries packet=flags -of flat | grep -e K - | sed -e "s/[^0-9]//g" | awk -F ',' 'NR==1,NR==ENS {print $1}'
0
60
120
ffmpeg version btbn ffmpeg-N-110645-gd4c48ee7f3-win64-gpl
built on ... Auto-Build 2023-05-17 12:49
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Note:
See TracTickets
for help on using tickets.


