The fringe projection technique is an effective technique to measure 3D shape of objects, in which phase retrieval is an important procedure. In this paper, the phase extraction algorithm of random phase-shift, which can be used in the fluctuating light source and the non-uniform background intensity and modulation amplitude, is proposed. The proposed method can retain more details of reconstructed phase than Fourier transform profilometry. Compared with multi-frame phase-shifting method, the proposed method only needs two fringe patterns to extract the phase and phase shift of the object. Our method consists of two stages. Firstly, the method is built based upon Lissajous Ellipse Fitting technique that extracts the phase from only two phase-shifted fringes which may contain arbitrary and unknown phase shift in dynamic measurement experiment. Second, the non-uniform background intensity and modulation amplitude are removed. The simulation results demonstrate that the proposed method can effectively obtain the phase.