Added support for multiple instances of recording/streaming. Each instance is referred to by a name passed as an argument during the function call.