一个树莓派,闲着也是闲着搭建一个rtmp的服务当作直播使用。
环境准备
环境
$ uname -a
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
安装包准备
arut-nginx-rtmp-module-791b613 ngx_cache_purge-master
arut-nginx-rtmp-module-v1.2.1-0-g791b613.tar.gz ngx_cache_purge-master.zip
openresty-1.17.8.2
nginx_upstream_check_module-master openresty-1.17.8.2.tar.gz
nginx_upstream_check_module-master.zip
make & make install
一行命令,但是也有意外发生
cd /home/pi/Downloads/openresty-1.17.8.2/
./configure --prefix=/opt/openresty --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_postgres_module --with-http_realip_module --with-http_xslt_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_perl_module --with-mail --add-module=/home/pi/Downloads/ngx_cache_purge-master/ --add-module=/home/pi/Downloads/nginx_upstream_check_module-master/ --add-module=/home/pi/Downloads/arut-nginx-rtmp-module-791b613
make
make install
虽然 ./configure 时会报错
d build
cd LuaJIT-2.1-20190507
cc: error: unrecognized command line option ‘-msse4.2’
警告但是依旧可以通过 configure 不要安装 –with-pcre 模块 不然configure就过不去了
ls ~/Downloads/openresty-1.17.8.2/build 文件生成
array-var-nginx-module-0.05 lua-resty-upload-0.10
drizzle-nginx-module-0.1.11 lua-resty-upstream-healthcheck-0.06
echo-nginx-module-0.62 lua-resty-websocket-0.07
encrypted-session-nginx-module-0.08 lua-tablepool-0.01
form-input-nginx-module-0.12 memc-nginx-module-0.19
headers-more-nginx-module-0.33 nginx-1.17.8
iconv-nginx-module-0.14 nginx-no_pool.patch
install ngx_coolkit-0.2
lua-cjson-2.1.0.8 ngx_devel_kit-0.3.1
LuaJIT-2.1-20200102 ngx_lua-0.10.17
luajit-root ngx_lua_upstream-0.07
lua-rds-parser-0.06 ngx_postgres-1.0
lua-redis-parser-0.13 ngx_stream_lua-0.0.8
lua-resty-core-0.1.19 opm-0.0.5
lua-resty-dns-0.21 pod
lua-resty-limit-traffic-0.07 rds-csv-nginx-module-0.09
lua-resty-lock-0.08 rds-json-nginx-module-0.15
lua-resty-lrucache-0.10 redis2-nginx-module-0.15
lua-resty-memcached-0.15 redis-nginx-module-0.3.7
lua-resty-mysql-0.21 resty-cli-0.25
lua-resty-redis-0.28 resty.index
lua-resty-shell-0.03 set-misc-nginx-module-0.32
lua-resty-signal-0.02 srcache-nginx-module-0.32
lua-resty-string-0.12 xss-nginx-module-0.06
Configuration 完成
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ using system zlib library
nginx path prefix: "/opt/openresty/nginx"
nginx binary file: "/opt/openresty/nginx/sbin/nginx"
nginx modules path: "/opt/openresty/nginx/modules"
nginx configuration prefix: "/opt/openresty/nginx/conf"
nginx configuration file: "/opt/openresty/nginx/conf/nginx.conf"
nginx pid file: "/opt/openresty/nginx/logs/nginx.pid"
nginx error log file: "/opt/openresty/nginx/logs/error.log"
nginx http access log file: "/opt/openresty/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
cd ../..
Type the following commands to build and install:
make
make install
- make 报错缺啥补啥
usr bin ld cannot find lperl
Cannot find -lperl doing a makefile on c++
安装对应的lib
>> sudo apt-get install libperl-dev
然后 再次从新开始 不知道为什么执行make clean 后configure 命令也不生效了只能删了从新来
- make
ed -e "s|%%PREFIX%%|/opt/openresty/nginx|" \
-e "s|%%PID_PATH%%|/opt/openresty/nginx/logs/nginx.pid|" \
-e "s|%%CONF_PATH%%|/opt/openresty/nginx/conf/nginx.conf|" \
-e "s|%%ERROR_LOG_PATH%%|/opt/openresty/nginx/logs/error.log|" \
< docs/man/nginx.8 > objs/nginx.8
make[2]: Leaving directory '/home/pi/Downloads/openresty-1.17.8.2/build/nginx-1.17.8'
make[1]: Leaving directory '/home/pi/Downloads/openresty-1.17.8.2/build/nginx-1.17.8'
完成 sudo make install pi@raspberrypi:/opt/openresty $ ls bin COPYRIGHT luajit lualib nginx pod resty.index site pi@raspberrypi:/opt/openresty $ pwd /opt/openresty
安装usb摄像头失败
ZC0301 Webcam 这个型号的usb摄像头没法用 这个各种问题一堆 结果没法用 台湾的一个博客也说放弃了
lsusb 可以查看到设备 但是使用 sudo apt-get install fswebcam
fswebcam /dev/video0 ~/image.jpg 照片是全黑的黑屏 调整参数也没有用 检查发现 缺失 linux-headers-5.4.0-28_5.4.0-28.32_all.deb headers 之后又是缺失 gspca sudo modprobe gspca 或是下载编译 下载安装后提示不能在当前内核中进行安装。 这个旧版本的在新的环境里根本无法安装
NEWS support Vimicro vc0323, upto 260 webcams ,Happy Christmas :).
until gspca v4l2 is finished, used:
gspcav1 "Generic Softwares Package for Camera Adapters" version 1.00.20 date: 24/12/2007
for kernel up from 2.6.11 : gspcav1-20071224.tar.gz
for kernel below 2.6.11: spca5xx version 0.60.00-1:
spca5xx-v4l1goodbye.tar.gz
dpkg error with libc-bin sudo apt-get –reinstall install libc-bin
sudo dpkg –configure -a 这个命令很管用