ffmpeg: Use input packet duration in vfr/cfr code if available and valid