Among the metal hydride materials, magnesium (Mg) and its alloys show an excellent performance for the hydrogen fuel based economy. Transition metals, e.g. Titanium (Ti), have shown to lower the activation energy and therefore improve the slow kinetics of hydrogenation/dehydrogenation of Mg. Understanding the reason for the slow kinetics and determining the mechanism of hydride formation can help improve the system. Here, we study separately the two systems: Ti-TiH2 and Mg-MgH2 (with Pd as catalyst) in thin films of thickness 50-800nm. The nano-scale thin films enable us to monitor the hydride growth and determine the diffusion coefficients. The two metals show a different behaviour of hydrogenation. The oxide passivation layer in the case of Ti is shown to have a great impact so that the pressure increase of hydrogen does not accelerate the kinetics of hydride formation. The interface barrier becomes significantly important and a linear regime is observed. TEM images support the fast diffusivity of H into Ti known from literature, since TiH2 is first formed at the back side, closer to the substrate. In the case of Mg, microscopic imaging shows that MgH2 is immediately formed underneath the surface and a layer-like growth towards the substrate is observed. Surprisingly, a transition between linear, at 200°C, and parabolic growth regime, at 300°C, is observed. Diffusion coefficients and surface transport coefficients are determined by combining XRD, SEM-FIB and TEM.