Create an instance of the IltmmRTSPServer interface. This is accomplished using the Win32 CoCreateInstance function, as follows:
IltmmRTSPServer* pServer;
CoCreateInstance(&CLSID_ltmmRTSPServer, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmRTSPServer, (void**)&pServer);
IltmmRTSPServer* pServer;
CoCreateInstance(CLSID_ltmmRTSPServer, NULL, CLSCTX_INPROC_SERVER, IID_IltmmRTSPServer, (void**)&pServer);
Specify the source folder that will contain the media files that will be streamed:
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"c:\\RTSPSourceFolder");
// assign the source file path to the convert object
IltmmRTSPServer_put_SourceFolder(pServer, 0, bstr);
// free the string
SysFreeString(bstr);
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"c:\\RTSPSourceFolder");
// assign the source file path to the convert object
pServer->put_SourceFolder(0, bstr);
// free the string
SysFreeString(bstr);
Specify which server address to use. In here, we will use localhost (127.0.0.1). You change this to the IP address of your computer
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"127.0.0.1");
// assign the source file path to the convert object
IltmmRTSPServer_put_TargetAddress(pServer, bstr);
// free the string
SysFreeString(bstr);
BSTR bstr;
// create a string containing the source file path
bstr = SysAllocString(L"127.0.0.1");
// assign the source file path to the convert object
pServer->put_TargetAddress(bstr);
// free the string
SysFreeString(bstr);
Start the server and listen on the default RTSP port (554). If that port is already used by another server, you can start it on another available port:
IltmmRTSPServer_StartServer(pServer, ltmmRTSP_DefaultPort);
pServer->StartServer(ltmmRTSP_DefaultPort);
You can now connect with an RTSP client and stream file using this URL:
rtsp://127.0.0.1/file.ext
, where c:\\RTSPSourceFolder\\file.ext
is a valid media file.
When you are done, stop the server and release the pServer interface.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document