Well you can try to adjust my script (
https://groups.google.com/d/msg/caffe-users/2xpmLJYmt5k/ApiOQ7NnAwAJ) to directly grab the images from your source and put them into the DB -> No intermediary storage of all images.
As to the difference: I cannot give representative timing results (and I have not seen serious benchmarking for that here either), but I think that theoretically LMDB should be a bit faster. Although that speed difference might not be actually visible depending on your network complexity, since caffe has data prefetching. It is just that LMDB is a "real" DB whereas HDF5 is only a "light" DB. Nevertheless I personally prefer HDF5 because it is much easier and nicer to work with, and I never really had speed problems.
Jan