I may be remembering it wrong but I seem to recall that avcodec_encode_video2() used to set it on older version of ffmpeg…? What is the recommendation for dealing with non fixed-fps content?