Deploying Your Media Server
This topic provides information on which DLLs and files to copy to get the Media Server working on another computer. Typically, you perform testing on a development computer and then when you are ready to deploy your server, you move the server files to a live server.
A simple way to install the server on another computer is to run the setup on the target computer and then copy the files you have modified. But seeing which files need to be copied is also useful to understand how the server files and DLLs work together.
In the steps below, we will use the following special strings:
- <INSTDIR> is the folder on the computer containing the LEADTOOLS Multimedia toolkit (e.g. "c:\LEADTOOLS22")
- <TARGETDIR> is the target directory on the computer that will host the media server (e.g. "c:\MediaServer").
Here is a list of the steps you need to take:
- First, make sure you have administrator rights on the target computer because you will need to register DLLs at some point.
Copy the folder containing the server files:
- Copy all the files and subfolder from
<INSTDIR>\Examples\Multimedia\MediaStreaming\CPP\Server to <TARGETDIR>. The simplest way to do this is to copy the whole folder
<INSTALLDIR>\Examples\Multimedia\MediaStreaming\CPP\Server to the target computer and then rename "Server" to whatever name you want. For example, let's say you rename it as "MediaServer".
Copy the server EXEs to the target computer. Copy the following files from the <INSTDIR>\Bin\CDLL\Win32 to <TARGETDIR> (from <INSTDIR>\Bin\CDLL\x64 if you are using the 64-bit server):
- ltmsServerSvc_Original.exe (windows service server EXE)
- ltmsLogViewer_Original.exe (log viewer EXE)
- ltmsServerMgr_Original.exe (windows service manager)
- ltmsServer_Original.exe (standalone server EXE)
Copy the license files from <INSTDIR>\Support\Common\License to <TARGETDIR> (the same place you copied the exes):
After this step, <TARGETDIR> should contain the .LIC file, several .EXEs and 3 subfolders: "config", "Logs" and "media". (To reduce confusion, disable the "Hide extensions for known file types" option in Windows Explorer).
Copy the following DLLs to <TARGETDIR> and register each of them on the target computer. In order to register them, it may be necessary to run cmd as administrator and register the DLLs from this elevated DOS prompt one by one. For example, to register LTMS22.dll type regsvr32 LTMS22.dll. Make sure you register DSKernel2.dll before the dlls listed below it (so register DSKernel2.dll before LMISODmx.dll). For a 64-bit server, the DLLs are in CDLL\x64 folders and have an extra 'x' in the filename.
- <INSTDIR>\Bin\CDLL\Win32\LMFLVDmx.dll (see Note 5)
- <INSTDIR>\Bin\CDLL\Win32\LMMpgDmxT.dll (see Note 6)
If your server implements live streaming, you should copy and register the DLLs required for live streaming (see Note 8):
- <INSTDIR>\Bin\CDLL\Win32\LEncAAC.dll (copy only, do not try to register this dll)
- <INSTDIR>\Bin\CDLL\Win32\LMRTSPSrc.dll (if you are restreaming an RTSP stream)
- <INSTDIR>\Bin\CDLL\Win32\LMONVIFSrc.dll (if you are restreaming an ONVIF device)
- <INSTDIR>\Bin\CDLL\Win32\LDecH2643.dll (only if you are recompressing an H264 stream)
- <INSTDIR>\Bin\CDLL\Win32\LDecAAC.dll (only if you are recompressing an AAC stream)
Edit all the .xml files from <TARGETDIR>\config and make sure MediaFolder is set to %ltmsMediaFolder% and LogFolder is set to %ltmsLogFolder%. %ltmsMediaFolder% and %ltmsLogFolder% are predefined values of the folder strings defined by LEADTOOLS. See the ltmsPathResolver Object for more details on these predefined folder strings. These settings should already be like this, but double-check to be sure. So, look and make sure the lines defining <MediaFolder> and <LogFolder> are as follows:
- Register the Windows Service Server by running ltmsServerSvc_Original.exe and clicking the Yes button.
Run the Windows Service Manager (ltmsServerMgr_Original.exe) and
- Make sure the folders are correct by clicking the View buttons next to Media Folder and Log Folder. If they are not correct, correct them using the "Network..." and "Logging..." buttons.
Run the Standalone Server (ltmsServer_Original.exe) and
- Make sure the folders are correct by clicking the View buttons next to Media Folder and Log Folder. (You might want to clear the Log folder by deleting all the Log files, since some of them are from the old computer. Note that if you try to delete all of the log files, one of them might fail to delete because at this point, the Windows Service server is already running and has a log file open).
- At this point, the Windows Service is running, so if you wish to manually edit the .XML file (for example if one of the folders is incorrect), you should stop the Windows Service before changing its ltmsServerSvc.xml file. See Note 1 for more details.
- Once both the standalone exe and the windows media service have the correct configurations, you can start the server. For example, run the Windows Service Manager and click the Start button if it is enabled. If the Start button is disabled, the service is already running.
Test that the server is running properly:
- The simplest way to do so is to click the "Browser..." button in the Windows Service manager. This will open the default browser. It will also show you the correct URL to enter in other browsers (eg: http://192.168.1.102:6969/player.html). If the page is loaded properly and the video is playing in the default browser on the target computer, go to another computer/device and enter the same URL in another browser.
If the server is running properly, you can add more compatible .MP4, .TS, .FLV. .Ogg, .webm or .ISM files to <TARGETDIR>\Media\vod or <TARGETDIR>\Media folders. Here are the steps for testing one such file:
- Create a compatible file called "new.mp4" using the Convert to Media Server demo. (Initially, create these files on the computer that has LEADTOOLS Multimedia installed).
- Copy it to <TARGETDIR>\Media\vod
- Go to the Server or Service manager demo
- Click the Browse button to open the default browser. This will play the default sample.mp4 file.
- In the File edit box in the browser, change sample.mp4 to new.mp4 and click the Open button.
- The Windows Service Manager runs the Windows Service automatically whenever you run ltmsServerMgr_Original.exe. The service reads the configuration .XML file when it starts and rewrites the .XML file when it stops running. If you manually change the XML configuration file while the service is running, the changes will be ignored and will be overwritten when the service is eventually stopped. So if you wish to change the Windows service configurations by editing <TARGETDIR>\config\ltmsServerSvc.xml, be sure to stop the services first. (You can stop a service from Task Manager->Services or by launching Services from Control Panel). This problem does not occur if you change the settings using the Windows Service Manager because it automatically stops and restarts the service whenever settings are changed through its user interface.
- If you want to avoid entering the port number in URLs (which is somewhat cumbersome in Android or Apple iPhone/iPad devices), you can make the server listen on port 80. But in that case you should make sure no other executable (like IIS) is already listening on TCP port 80. You can run "netstat /a" or "netstat -anob" from a DOS prompt box to see the list of open ports on your computer.
- If you can view the stream from the local computer but you do not see anything from another computer, the most likely cause is that the firewall on the computer hosting the server is blocking incoming connections. So check the firewall settings for the TCP port on the server computer and make sure it is accepting connections on the port used by the server.
- These steps are only for copying the files needed for the server. They are not enough to enable the Convert To Media Server demo on the new computer. That demo uses many more files and for that. You will need to copy all the codecs, filters and Multimedia DLLs as described in Multimedia Files You Must Include With Your Application (Redistributables).
- LMFLVDmx.dll is needed only if you wish to stream FLV files (.FLV) as Flash (RTMP) or RTSP
- LMMpgDmxT.dll is needed only if you wish to stream MPEG2 Transport files (.ts) as Flash (RTMP) or RTSP
- You can stream .MP4 files using all the streaming formats. You can stream .FLV, .TS, .Ogg, .webm and .ISM files only with certain streaming formats. See Supported Source File Formats and Players for more details.
- There might be many DLLs required for live streaming, depending on the type of the source you are using (webcamera, IP camera, ONVIF devices, etc). You might need to copy other decoders not listed here. Please see Multimedia Files You Must Include With Your Application (Redistributables) for more details.
- The Windows 10 Anniversary Update includes changes to Microsoft Edge that affect how Flash content is displayed. If you are enabling Flash with the LEADTOOLS Media Server and testing on Microsoft Edge, refer to Windows 10 Update Effects On Edge.