I had this (well, closely related) problem today. This stackoverflow topic was one of the best search engine results, so I thought that I would provide future searchers with additional information.
I used the VideoWriter object and called frame=getframe(fig_handle) to save each frame in the video. As in the question to this topic, only 1 frame was saved. In addition, the background behind the figure could be seen through it, as if the figure was partially transparent.
Change rendering to artists or zbuffer. ( set(gcf,'renderer','zbuffer') ..)
I needed OpenGL rendering because the film used transparency. The key to this work was to use
opengl('software')
This circumvented what was probably the problem when sending graphics to and from the graphics card (I donβt know exactly ... it worked, and I switched).
source share