Here's a full example on making an animated GIF "movie" from an HDF5 file. The data should be an HDF Dataset of a 3 dimensional array [Nframes][Nrows][Ncolumns].
#
# be sure to be run as Administrator to install new packages
#
source("http://bioconductor.org/biocLite.R")
biocLite("rhdf5")
install.packages('caTools')
install.packages('fields')
library(caTools)
library(fields)
library(rhdf5)
x = h5read(file="mydata.h5",name="/Images")
write.gif(x,"movie1.gif",col=rainbow,delay=10,flip=TRUE)