CASTEP Geometry Optimization Movie
The geometry optimization routine does not appear to have a method to output frames to an .xtd file for CASTEP in Materials Studio. Usually a movie makes more sense for a molecular dynamics simulation.

However, if you construct a script that performs a sequence if geometry optimizations with MaxIterations = 3 (must be &gt;2), you can output each result to .std (study table) or .xtd. You would do this by outputting a geometry optimization after three iterations, then repeat the calculation on the result, until convergence. Then you take the frames and make a video

The help file in Materials Studio is rather a good resource, be sure to dig around in there, especially for the scripting API