Infrared emission and star formation in early-type galaxies