Hydrogenated amorphous carbon (a-C:H) and hydrogenated amorphous carbon nitride (a-CNx:H) films were prepared in a custom-built radio-frequency plasma-enhanced chemical vapor deposition (RF-PECVD) system with a parallel-plate configuration. Pure methane and a gas mixture of methane and nitrogen were used as gas sources to obtain these films. The films were characterized using Fourier transform infrared and optical transmission spectroscopy techniques. The incorporation of nitrogen and the effect of annealing (100–500 °C) on the film properties were studied. The films were determined to be thermally stable up to 300 °C. Upon annealing above 300 °C, the thickness and refractive index of both a-C:H and a-CNx:H films increase while the optical energy gap E04 decreases. These effects were more pronounced in a-CNx:H. From the IR spectra, these changes are considered to be due to the decreases in nitrogen and hydrogen concentrations in the films which result in their structural modification.