Markley variables have advantages of slow variation, easy numerical integration and high precision in describing the attitude of spinning spacecraft. Previous attitude estimation methods based on Markley variables for spinning spacecraft usually employ a sun vector from the sun sensor, a magnetic vector from the magnetometer, or the angular rate from the gyro as the measurement. This paper proposes a Markley variables-based attitude estimation method using optical flow and a star vector from a star sensor as the measurement, where optical flow provides rate information and the star vector provides direction information. This method can estimate the direction of the spin axis and spin angular rate very well by using only one star sensor. In addition, the star sensor has higher accuracy than the traditional sun sensor and magnetometer, and the star sensor can also replace the gyro in case the gyro is out of action. The impact factors of this method are also analysed, which include spin angular rate, spin axis orientation and spacecraft moment of inertia tensor error.