Video Streaming Server With Multi-Protocol,Robust And Rich API
LocationIndex Page  >  Document  >  VOD

VOD, also known as video on demand service. At present, there are two ways for us to support VOD service:

1. Since version 1.0.58, TiTopStreamer has integrated VOD feature, which means that a set of TiTopStreamers supports both live streaming and VOD services.

2. For some customers who only have VOD service needs, we also provide a separate application that supports VOD service. It is another product outside of TiTopStreamer, which we call Ti Top Vod.

You can choose between the above two ways according to your own needs. From a functional perspective, they are completely identical without any difference.

We will introduce the use of VOD function below. For users who have already installed TiTopStreamer, you can skip chapters 1, 2, 3, and 4 below, then start directly from chapter 5.

1. Download

Ti Top Vod runs on a Linux system, so if your server can connect to the Internet normally, you can use the wget command to download the installation package:

wget http://www.ttstream.com/download/TiTopVod-1.0.1.tar.gz


If your server is deployed on an internal network and cannot connect to the Internet, please click on the link below to download the installation package. Once the download is successful, you can manually upload it to your server.


2. Install
Note 1:The version number in the installation instructions below is just an example, please replace it with the actual version number

Note 2:The following installation command must be executed as root user!

1). Regarding installation directory: Although you can install Ti Top Vod in any directory, we recommend that you install it in the /usr/local directory, so we will move the installation package to that directory first.
mv TiTopVod-1.0.0.tar.gz /usr/local/TiTopVod-1.0.0.tar.gz
	
2). Extract the installation package and create a soft link:
cd /usr/local
tar xzvf TiTopVod-1.0.0.tar.gz
ln -s /usr/local/TiTopVod-1.0.0 /usr/local/TiTopVod
	
3). install system service:
cd TiTopVod
cd bin
./installsystemd.sh
	
After running the "./installsystem. sh" command, you will see the following prompt:
Created symlink from /etc/systemd/system/multi-user.target.wants/TiTopVod.service to /usr/lib/systemd/system/TiTopVod.service.
	
At this point, the installation is complete! Note: After successfully running the "./installsystem. sh" command, it not only completes the software installation, but also automatically launches the Ti Top Vod software for you!

You can now open the browser and access the default 8086 port. If everything goes smoothly, you should be able to login to the web console pannel of Ti Top Vod.

web manager

Note: The default username and password are located in the "conf/admin. password" file in the installation directory (/usr/local/TiTopVod). Very important: After installation is completed, please first modify the username and password in this file (after modification, there is no need to restart the service).

If you are unable to successfully access this web console pannel, it is recommended that you check the firewall settings of the server.

3. Startup and Shutdown

Firstly, it should be noted that after you have installed the Ti Top Vod software, we have automatically launched it for you.

During the operation and maintenance of the system, you may need to start or stop this software separately. So, below we will introduce the startup method of Ti Top Vod:

Note: The following startup command must be executed as root user!

1). startup TiTopVod service

systemctl start TiTopVod
		
2). shutdown TiTopVod service
systemctl stop TiTopVod
		


4. Uninstall
Please follow the steps below to properly uninstall Ti Top Streamer:

Note: You must execute the following command as root user!

1). Firstly, shutdown the service:
systemctl stop TiTopVod
	

2). Remove the system service:
cd /usr/local/TiTopVod/bin
./uninstallsystemd.sh
	
Note: After running the command ./uninstallsystemd.sh, You will get below response in the console:
Removed symlink /etc/systemd/system/multi-user.target.wants/TiTopVod.service.
	


5. Set the root path of content storage
Firstly, please log in to the web console pannel of Ti Top Vod. Similar to the concept of Ti Top Streamer, Ti Top Vod also supports multi app management. For your convenience, after you complete the installation, it already has an Application called "vod" by default.

Next, you need to specify a storage path for the content file for this Application, which means you must let Ti Top Vod know which path the video file is in. Note that it is recommended that you set the storage path outside of the Ti Top Vod installation path. As shown in the following figure:

web manager

6. HLS Playback URL

At present,Ti Top Vod only support HLS streaming,Below is the url format:

http://[hostAddress]:[port]/applicationName/[streamName]/playlist.m3u8
	

[hostAddress]: It is the host address of the server running Ti Top Vod.

[port]: It is the port of HLS streaming service,the default value is 8082.

[applicationName]: It is a name of application.

[streamName]: It is name of stream in this application, that also is the full name of video file with its path, e.g. some_dir/sample.mp4

Suppose that the name of this application is "vod" and streamName is "sample.mp4", continuing to suppose that the host address is "192.168.10.102" and the port of HLS streaming is "8082", then the HLS streaming url will be:
http://192.168.10.102:8082/vod/sample.mp4/playlist.m3u8
	

7. url anti-theft
Ti Top Vod supports token based url anti-theft technology, through which you can achieve security protection for HLS streams. Here are the implementation steps:

1) Enable the url anti-theft feature, as shown in the following figure::

web manager

Note 1:Tick the checkbox next to "Anti Theft" in the above image to indicate that the anti theft feature is enabled (default is not enabled)

NOte 2:Set a SharedKey, It is a shared key, You can input it yourself or click the "Generate" button to automatically generate it. 2) write code to generate HLS stream URL

In the URL of the HLS stream, apart from the host address and port, other parts are determined based on applicationName, streamName, SharedKey, and expiredTime (expiration time).

The URL generation process is as follows:

A. Firstly, you need to determine a URL expiration time, such as 1 minute later (URL expiration means that when you request Ti Top Vod using this URL, the system will reject the pull request, but it does not affect the connection that has already started pulling)

The URL expiration time is an absolute value, a Unix timestamp, accurate to seconds. That is the number of seconds that have passed since January 1, 1970 (midnight at UTC/GMT). Then convert it to hexadecimal format (lowercase characters)

B. StreamName refers to the complete path and file name of the video file, such as some_dir/sample.mp4. The file path here is the relative path to the root path of the video file storage.

C. Linking sharedKey, applicationName, streamName, and expiredTime in the order described here is equivalent to (sharedKey+applicationName+streamName+expiredTime).

D. calculate the MD5 value of the above string, which is equivalent to md5 (sharedKey+appName+streamName+expiredTime)

E. Then you need to generate two URL query parameters, tiliuSecurityToken and tiliuExpiredTime. The former is the md5 value above, and the latter is the hexadecimal form of the URL expiration time mentioned earlier (with lowercase characters).

Note: The reason for using prefixes like "tiliu" in these two parameters is to avoid confusion with your other custom parameters.

F. Add the above two URL query parameters to the regular HLS stream URL, for example:
http://192.168.10.102:8082/vod/sample.mp4/playlist.m3u8?tiliuSecurityToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&tiliuExpiredTime=xxxxxxxxxx
		
Here is a web page tool that allows you to easily generate HLS stream URLs:

Host Address:

Port:

applicationName:

streamName:

sharedKey:

expiration time:(second)

生成
Note: After clicking this button, a backend call will be initiated, passing in the above parameter values to obtain the hls streaming URL as follows:

hls streaming url will be displayed here

Next, you can try playbacking this stream using the VLC player.

8. As a original site for CDN
If the HLS stream output by your Ti Top Vod is not aimed at end users, but at CDN, then the role of Ti Top Vod is actually a CDN source system.

For the convenience of CDN system caching, Ti Top Vod will not create a Session for HLS requests at this time, and there will be no Session information in the URL. At this point, we also suggest that you do not use url anti-theft Token technology.

Of course, in this case, we are also unable to calculate the concurrent number of HLS streams for you.