Extract key moments.and extract head frame and tail frame