++++++++测试HLS切片功能+++++++++++
修改/usr/local/nginx/conf/nginx.conf的内容如下:
#debug
daemon off;
master_process off;
error_log ./error.log debug;
events{
worker_connections 1024;
}
rtmp{
server {
listen 1935;
chunk_size 4000;
#live
application myapp {
live on;
hls on;
hls_path /tmp/hls;
hls_fragment 2s;
hls_playlist_length 6s;
}
}
}
#HTTP
http{
server {
listen 80;
#welcome
location / {
root html;
index index.html index.htm;
}
#hls
location /hls {
types {
application/vnd.apple.mpegusr m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
}
}
}
使用VLC或iPAD上的播放器进行查看 http://yourip/hls/test.m3u8。
RTMP推流: rtmp://serverip:1935/myapp/stream1
HLS推流: rtmp://serverip:1935/hls/test2
HLS拉流: http://serverip:8080/hls/test2.m3u8