We present an ab-initio study of the phase transition cd->beta-tin in Si and Ge under hydrostatic and non-hydrostatic pressure. For this purpose we have developed a new method to calculate the influence of non-hydrostatic pressure components not only on the transition pressure but also on the enthalpy barriers between the phases. We find good agreement with available experimental and other theoretical data. The calculations have been performed using the plane-wave pseudopotential approach to the density-functional theory within the local-density and the generalized-gradient approximation implemented in VASP.