I don't think there is some kind of middleware. You may find open source code for some Windows Media stream recorders, but I don't think it will be easy to create your own middleware with it.
IMHO the best option here is to show some part of a stream. See the following FAQ to learn how to do it with Windows Media and Real Video streams:
FAQ: Start and end times of a streaming media