We propose an arbitrary driven spin as the working fluid of a quantum Otto cycle in the presence of internal friction. The role of total allocated time to the adiabatic branches of the cycle, generated by different control field profiles, on the extractable work and the thermal efficiency are analyzed in detail. The internal friction is characterized by the excess entropy production and quantitatively determined by studying the closeness of an actual unitary process to an infinitely long one via quantum relative entropy. It is found that the non-ideal, finite-time adiabatic transformations negatively effect the work output and the thermal efficiency of the quantum heat engine. The non-monotone dependence of the work output, thermal efficiency, entropy production and the internal friction on the total adiabatic time are elucidated. It is also found that almost frictionless adiabatic transformations with small entropy production can be obtained in a short adiabatic time. Complete frictionless solutions for finite adiabatic times, possible implementation of our engine in NMR setups and the estimation of the power output have also been analyzed.