“cmd.count_frames” returns the number of frames defined for the PyMOL movie.
cmd.count_frames()
def count_frames(quiet=1):
count_frames | api