The atomic spectrum of oxygen has been excited in an electrodeless discharge lamp; depending on the wavelength the lines have been analysed by means of Fabry-Perot or Fourier spectrometry. The fine structure of the 2p3(4S)3d 3,5D terms have been re-measured with an uncertainty of about 0.2 mK; those of the terms 2p3(4S)4d 3,5D have been resolved and determined with an uncertainty less than 2 mK. The fine structure intervals of the quintet terms are found to obey the Casimir formula within the limits of the experimental errors; for each triplet and each quintet the radial quantities A' and B' involved in this formula are obtained. In order to interpret theoretically the values of these constants, the Breit-Dirac equation and the equivalent operators formalism are used. In a pure coupling scheme, ab initio calculations of the various magnetic interactions (spin-orbit, spin-other-orbit, spin-spin interactions) do not give satisfactory results but, by taking into account higher-order terms, a good agreement between experimental and theoretical (ab initio) values is achieved.