A simple server building based on Nginx for HLS

Source: Internet
Author: User
Tags nginx server

First, build the Nginx server:

1.1, select Source Directory

Selected Directory/usr/local/hls

Cd/usr/local/hls

1.2, install Pcre Library

Cd/usr/local/hls

To www. pcre. org download pcre-8.37.tar.gz, then copy to/usr/local/hls

TAR-ZXVF pcre-8.37.tar.gz

CD pcre-8.37

./configure

Make

Make install

1.3, install Zlib Library

Cd/usr/local/hls

To www. zlib. NET Download zlib-1.2.8.tar.gz, then copy to/usr/local/hls

TAR-ZXVF zlib-1.2.8.tar.gz CD zlib-1.2.8

./configure

Make

Make install

1.4, install SSL

Cd/usr/local/hls

To www. OpenSSL. org download openssl-1.0.2g.tar.gz, then copy to/usr/local/hls

TAR-ZXVF openssl-1.0.2g.tar.gz

./config

Make

Make install

1.5, install Nginx

Download the stable version of nginx-1.8.1.tar.gz to nginx. org and copy it to/usr/local/hls

TAR-ZXVF nginx-1.8.1.tar.gz

CD nginx-1.8.1

./configure--prefix=/usr/local/nginx

Make

Make install

1.6, start

Make sure that the 80 port of the system is not occupied by other programs.

/usr/local/nginx/sbin/nginx

Check whether the startup was successful:

NETSTAT-ANO|GREP 80 Results Input Description started successfully

Then open the browser to access the IP address of this machine, if the browser appears Welcome to nginx! Indicates that Nginx is installed and running successfully.

.1.7, restart

/usr/local/nginx/sbin/nginx–s Reload

Note: If the virtual machine is turned on, the other computer will be able to access the IP address properly.

Second, generate the m3u8 file and the corresponding TS file:

Generate m3u8 files and for TS files in the same way as the m3u8 file generation method for the HLS (HTTP Live streaming) protocol http://www.cnblogs.com/qazwsxwtc/p/5144604.html blog.

Software: http://download.csdn.net/detail/qazwsxwtc/9413791

Third, build HLS streaming media

3.1, create a new first directory under the/usr/local/nginx/html directory

mkdir First

3.2, enter/usr/local/nginx/html/first

CD First

3.3, copy the -1.ts ~-27.ts and m3u8list.m3u8 to the/usr/local/nginx/html/first directory

Access via mobile browser such as: http://192.168.1.104/first/m3u8list.m3u8

The latter can see the video in VLC input

Play in VLC

Play via Mobile:

A simple server building based on Nginx for HLS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.