One can also be called into the court, in which case one is obliged to come and to take an oath as well. Being a witness is a formal position for which one has to accept responsibility. As a witness, lying is a crime. If you are called into the court, you have to come. If you do not, it is a crime as well. However, a witness does not have to incriminate her or him self. Loss of memory or forgetfulness is accepted by the court as a reason for not having to testify. Also the witness capacity to speak the truth can be hindered by relations to other people who are involved as well.
Being witness is a formal position
Being a witness is a formal position in the process of law. To accept being a witness is a conscious choice to want to be present and testify. A witness has to be sworn in by taking an oath.