Decomposition of SmBa2Cu3Ox (Sm-123) films deposited on MgO substrates was in situ observed by high-temperature optical microscopy. The films were detected to be predominantly c-axis oriented, with highly fourfold symmetry. It was observed that a minor change in the a-axis-oriented grains percentage had a strong effect on the thermal stability of the films and the melting mode. In the case of nearly 1% of a-oriented grains, the decomposition temperature of the SmBCO film was above the peritectic temperature (Tp), showing a high thermal stability. The peritectic product of the Sm2BaCuO5 (Sm-211) phase exhibited the preferential orientation of [0 0 1] parallel to [1 1 0] of the Sm-123 matrix. On the other hand, when substitution of a-axis-oriented grains increased up to 3% or more, the decomposition temperature of the Sm-123 film dropped below Tp. Interestingly, in the latter case, the Sm-211 phase had an epitaxial relation with Sm-123 as Sm-211[0 0 1]//Sm-123 [1 0 0] or Sm-211[0 0 1]//Sm-123[0 1 0], distinctly different from that mentioned above. In this paper the melting behaviour and its mechanisms, together with the epitaxial orientation of Sm-211 grains in Sm-123 thin films, are studied in detail by means of the interface-energy analysis.