You can use the “ModuleStreamControl” module. It can be used to dynamically create, set up, and start new live Stream class streams from static and live sources, and add sources to existing Stream class streams. It uses a custom Flash client as a user interface to the module. You can find more information in the “How to control Stream class streams dynamically (ModuleStreamControl)” forum article.
I have this but I had a programmer write the code for me, the only issue i have is the delay in switching, since it waits and switches on keyframes and also its switching at the server there can be a delay of upto a couple of seconds for people watching the output stream, but it can be done.