AK影讯
精彩分享~

nginx + ffmpeg 搭建m3u8服务器

1、 安装nginx

nginx

官方 http://nginx.org/

nginx-rtmp-module:

官网:https://github.com/arut/nginx-rtmp-module

增加:http_ssl_module:

configure –add-module=<path-to-nginx-rtmp-module>  –with-http_ssl_module

make

sudo make install

2、编译ffmpeg

ffmpeg

官网:http://ffmpeg.org/

x264:http://www.videolan.org/developers/x264.html

先编译 x264

./configure –enable-static

make

sudo make install

编译ffmpeg

./configure –enable-libx264 –enable-gpl

3、启动

启动nginx

sudo /user local/nginx/sbin/nginx

ffmpeg 切片

本地文件:

ffmpeg -i 文件 -c:v libx264 -c:a aac -strict -2 -f hls /html/test.m3u8

ts流:

ffmpeg -i udp://@:1234 -c:v libx264 -c:a aac -strict -2 -f hls /html/test.m3u8

4、vlc 测试

打开网络串流

http://192.168.12.205/test.m3u8

如果不出差错便可以观看

赞(1)
未经允许不得转载:i酷影讯 » nginx + ffmpeg 搭建m3u8服务器