1 Install Nginx to increase nginx-rtmp-module support download good nginx-rtmp-module after decompression, and then add this module Nginx installation (--add-module)
./configure--prefix=/usr/local/nginx--add-module= (nginx-rtmp-module path)
2 after the installation is complete, open nginx configuration file nginx.conf to configure
First add the rtmp configuration to the inside
rtmp {
server {
Listen 1935;
Application Video {
Live on;
}
Application HLS {
Live on;
HLS on;
Hls_path/tmp/hls;
}
}
}
Then, for HLS, you also need to add a location configuration in HTTP
Location/hls {
Types {
Application/vnd.apple.mpegurl m3u8;
VIDEO/MP2T ts;
}
root/tmp;
Add_header Cache-control No-cache;
}
After saving the configuration file, start Nginx, through the NETSTAT-LTN command can see the increase of a 1935 port listening. 8080 is the Nginx default HTTP listening port.
/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf start Nginx to see if it is successful
3 Install ffmpeg required Source package yasm:http://yasm.tortall.net/download.html
Ffmpeg-re-i/app/test.mp4-vcodec copy-vprofile baseline-ar 44100-strict-2-ac 1-f flv-s 640x360-q. 0.0.1:1935/hls/test4
Streaming Media Server Setup