There was a speech, but there's no definite record of it. James I. Robertson in his biography on Stonewall quotes the speech as written by "
Langhorne to mother, Nov. 4, 1861. Langhorne recorded the presentation immediately after Jackson gave it, his account is short and to the point in typical Jackson style. This rendition alone among all others closes with an appeal to God, which is characteristic of every formal message Jackson ever sent." Apparently, Kyd Douglas and even Henderson in his bio embellished their accounts of the speech.
The speech as written by Langhorne/Robertson:
"Officers and men of the First Brigade! You do not expect a speech from me. I come to bid you a heartfelt goodbye.
"This brigade was formed at Harper's Ferry and the command of it assigned to me. You have endured hard marches, the exposure and privations of the bivouac, like men and patriots. You are the brigade which turned the tide of battle on Manassas Plains and there gained for yourself imperishable honor, and your names will be handed down with honor attached in future history.
"You were the First Brigade in the Army of the Shenandoah, the First Brigade in the Army of the Potomac, the First Brigade in the Second Corps, and are the First Brigade in the hearts of your generals. I hope that you will be the First Brigade in this, our second struggle for independence, and in the future, on the fields on which the Stonewall Brigade are engaged, I expect to hear of crowning deeds of valor and of victories gloriously achieved! May God bless you all! Farewell!"
p. 282/283, fn. 116 on p. 839
If you haven't already seen it, there's a Behind the Scenes video in four parts, telling about the reenactors' involvement in making the movie. Stephen Lang practiced the speech in front of the reenactors before the scene was filmed, and I personally find that practice much more compelling than the scene in the movie.
Here's the link to it.