Pied Piper is a minor character in Shrek Forever After. He also makes a brief appearance in the beginning of Shrek, but bears no resemblance to the one seen in the fourth movie.
The Pied Piper is seen early on, when Shrek steps out of his house and sees all of the fairytale creatures squatting there. He is seen sitting on a log, summoning rats with his flute.
Shrek Forever After
In the final movie, Pied Piper is something of a contract killer hired by Rumpelstiltskin in order to capture the ogres, and more importantly, Shrek. The Piper's flute is a magical object, able to control the actions of others even though they consciously resist. By playing the tune to "Shake Your Groove Thing", he is able to capture all ogres except Shrek and Fiona (who were saved by Donkey and Puss). During conversations with Rumpelstiltskin, it is revealed that the Pied Piper cannot (or chooses not) to speak, instead playing his flute to convey thoughts. Whether or not he is an antagonist can be argued, as at the end of the film he helps to punish Rumpelstiltskin for his crimes.