sh stream_pi.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh stream_pi.sh相关的知识,希望对你有一定的参考价值。
wget http://nginx.org/download/nginx-1.9.11.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/v1.1.7.tar.gz
tar xzf nginx-1.9.11.tar.gz
tar xzf v1.1.7.tar.gz
pacman -Sy base-devel ffmpeg nginx
cd nginx-1.9.11
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/bin/nginx \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/nginx.lock \
--user=http \
--group=http \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=stderr \
--http-client-body-temp-path=/var/lib/nginx/client-body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-mail \
--with-mail_ssl_module \
--with-ipv6 \
--with-pcre-jit \
--with-file-aio \
--with-http_dav_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_v2_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_addition_module \
--with-http_degradation_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_secure_link_module \
--with-http_sub_module \
--with-threads \
--with-stream \
--add-module=../nginx-rtmp-module-1.1.7
make
cp ./objs/nginx /usr/sbin/nginx
cat >> /etc/nginx/nginx.conf <<_EOF_
rtmp {
server {
listen 1935;
application live {
live on;
}
}
}
_EOF_
nginx -t
systemctl start nginx
# stream local video
ffmpeg -re -i video.mp4 -f flv rtmp://localhost/live/video
# stream local webcam
ffmpeg -f video4linux2 -r 24 -i /dev/video0 -f flv rtmp://localhost/
live/webcam
# stream remote webcam (on MacOSX)
ffmpeg -f qtkit -i 0 -f flv rtmp://192.168.1.151/live/webcam
# view live stream (on MacOSX)
vlc rtmp://192.168.1.151/live/webcam
# stream raspberry pi camera (pi -> bridge -> remote -> local)
nc -vlkp 8888 | ffmpeg -i - -f flv rtmp://datageek.info/live/webcam
/opt/vc/bin/raspivid -o - -t 0 -hf -w 640 -h 360 -fps 25 | nc -v 192.168.1.196 8888
vlc rtmp://datageek.info/live/webcam
以上是关于sh stream_pi.sh的主要内容,如果未能解决你的问题,请参考以下文章
如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作
sh sh_template.sh
sh sh.sh
Linux下面如何运行 SH文件
配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh
shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别