  We show that a class of Poincar\'e-Wirtinger inequalities on bounded convex
sets can be obtained by means of the dynamical formulation of Optimal
Transport. This is a consequence of a more general result valid for convex
sets, possibly unbounded.
