The optical vibrations of hydrogen in TbNiAlH1.4 and UNiAlH2.0 were investigated by means of inelastic neutron scattering. The experimental data were analysed, including multiphonon neutron scattering contributions, calculated in an isotropic harmonic approximation. At least two fundamental H optical peaks were observed in TbNiAlH1.4, and were assigned to the vibrational modes of hydrogen atoms occupying different interstitial sites in the metal sublattice. The high-energy part of the UNiAlH2.0 spectra is characterized by strong anharmonicity, and a broad fundamental band. The latter can be accounted for by a large dispersion of phonon modes due to the strong H-H interactions, and/or different metal-hydrogen force constants, which may originate from different metal atoms surrounding the H atoms in the unit cell.