ubuntu 环境
1、下载nginx
wget
wget
2、编译安装
-
configure --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/local/ --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-mail --with-mail_ssl_module --with-http_xslt_module --add-module=../nginx-rtmp-module-master
make
sudo make install
3、nginx配置
在nginx.conf 内增加
-
rtmp {
-
server {
-
listen 1935;
-
-
application myapp {
-
live on;
-
}
-
application hls {
-
live on;
-
hls on;
-
hls_path /tmp/hls;
-
}
-
}
-
}
4、采集视频
因没摄像头 就用 录制屏幕了
ffmpeg -re -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -vcodec libx264 -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 1024x768 -q 10
rtmp://192.168.11.70:1935/myapp/test1
5、播放
简单用vlc方式
串流里面输入
rtmp://192.168.11.70:1935/myapp/test1
阅读(1856) | 评论(0) | 转发(0) |