We performed an optical spectroscopy measurement on single crystals of $mathrm{Ba_2Ti_2Fe_2As_4O}$, which is a newly discovered superconductor showing a coexistence of superconductivity and density wave order. The study reveals a spectral change related to the formation density wave energy gap below $T_{DW}approx$125 K, leading to the removal of about half of the multiple Fermi surface sheets. The ratio of 2$Delta_{DW}$/$k_B T_{DW}approx$ 11.9 is considerably larger than the mean-field value based on the weak-coupling BCS theory. At the lowest temperature in the superconducting state, we observed opening of superconducting energy gaps $Delta_1(0) =3.4$ meV and $Delta_2(0)=7.9$ meV. The properties of superconducting state in $mathrm{Ba_2Ti_2Fe_2As_4O}$ are similar to that in $mathrm{BaFe_{1.85}Co_{0.15}As_2}$.