We consider the Brascamp-Lieb inequalities concerning multilinear integrals of products of functions in several dimensions. We give a complete treatment of the issues of finiteness of the constant, and of the existence and uniqueness of centred gaussian extremals. For arbitrary extremals we completely address the issue of existence, and partly address the issue of uniqueness. We also analyse the inequalities from a structural perspective. Our main tool is a monotonicity formula for positive solutions to heat equations in linear and multilinear settings, which was first used in this type of setting by Carlen, Lieb, and Loss [CLL]. In that paper, the heat flow method was used to obtain the rank-one case of Lieb's fundamental theorem concerning exhaustion by gaussians; we extend the technique to the higher-rank case, giving two new proofs of the general-rank case of Lieb's theorem.