Различия
Здесь показаны различия между двумя версиями данной страницы.
Следующая версия | Предыдущая версия | ||
abills:docs:other:ipcam:ru [2016/04/30 16:25] kodr создано |
abills:docs:other:ipcam:ru [2016/08/01 17:52] (текущий) anton [Установка yasm x264 ffmpeg fdk-aac] |
||
---|---|---|---|
Строка 4: | Строка 4: | ||
====Установка nginx==== | ====Установка nginx==== | ||
+ | Нужно собрать nginx с модулем ''flv'' | ||
+ | <code> | ||
+ | apt-get install build-essential | ||
+ | apt-get install libpcre3 libpcre3-dev libssl-dev | ||
+ | cd /usr/src/ | ||
+ | wget http://nginx.org/download/nginx-1.9.0.tar.gz | ||
+ | tar -xzvf nginx-1.9.0.tar.gz | ||
+ | cd nginx-1.9.0 | ||
+ | ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module | ||
+ | make | ||
+ | make install | ||
+ | </code> | ||
+ | |||
+ | # nano /etc/nginx/sites-enabled/ipcam | ||
+ | |||
+ | server { | ||
+ | listen 8088; | ||
+ | # rtmp stat | ||
+ | location /hls { | ||
+ | types { | ||
+ | application/vnd.apple.mpegurl m3u8; | ||
+ | } | ||
+ | root /tmp; | ||
+ | add_header Cache-Control no-cache; | ||
+ | add_header 'Access-Control-Allow-Origin' '*'; | ||
+ | } | ||
+ | location = /nginx_status { | ||
+ | stub_status on; | ||
+ | access_log off; | ||
+ | allow 127.0.0.1; | ||
+ | deny all; | ||
+ | } | ||
| | ||
- | apt-get install build-essential | + | location / { |
- | apt-get install libpcre3 libpcre3-dev | + | add_header 'Access-Control-Allow-Origin' '*'; |
+ | } | ||
+ | |||
+ | error_page 500 502 503 504 /50x.html; | ||
+ | location = /50x.html { | ||
+ | root html; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /etc/init.d/nginx restart | ||
+ | ====Установка yasm x264 ffmpeg fdk-aac==== | ||
+ | |||
+ | sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm | ||
+ | | ||
+ | sudo apt-get update | ||
+ | sudo apt-get -y install autoconf build-essential checkinstall git libass-dev libfaac-dev \ | ||
+ | libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev \ | ||
+ | libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev | ||
+ | |||
+ | ===Yasm=== | ||
+ | |||
+ | cd /usr/srс/ | ||
+ | wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | ||
+ | tar xzvf yasm-1.2.0.tar.gz | ||
+ | cd yasm-1.2.0 | ||
+ | ./configure | ||
+ | make | ||
+ | sudo checkinstall --pkgname=yasm --pkgversion="1.2.0" --backup=no \ | ||
+ | --deldoc=yes --fstrans=no --default | ||
+ | |||
+ | ===x264=== | ||
+ | |||
+ | cd /usr/src | ||
+ | git clone --depth 1 git://git.videolan.org/x264 | ||
+ | cd x264 | ||
+ | ./configure --enable-static | ||
+ | make | ||
+ | sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \ | ||
+ | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \ | ||
+ | --fstrans=no --default | ||
+ | |||
+ | ===fdk-aac=== | ||
+ | |||
+ | cd /usr/src | ||
+ | git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git | ||
+ | cd fdk-aac | ||
+ | autoreconf -fiv | ||
+ | ./configure --disable-shared | ||
+ | make | ||
+ | sudo checkinstall --pkgname=fdk-aac --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \ | ||
+ | --deldoc=yes --fstrans=no --default | ||
+ | |||
+ | ===FFmpeg=== | ||
cd /usr/src/ | cd /usr/src/ | ||
- | wget http://nginx.org/download/nginx-1.9.0.tar.gz | + | git clone --depth 1 git://source.ffmpeg.org/ffmpeg |
- | tar -xzvf nginx-1.9.0.tar.gz | + | cd ffmpeg |
- | cd nginx-1.9.0 | + | ./configure --enable-gpl --enable-libass --enable-libfaac --enable-libfdk-aac --enable-libmp3lame \ |
- | ./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf --add-module=../nginx-rtmp-module-master/arut-nginx-rtmp-module-*/ --pid- path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module | + | --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora \ |
- | + | --enable-libvorbis --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 | |
+ | make | ||
+ | sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(date +%Y%m%d%H%M)-git" --backup=no \ | ||
+ | --deldoc=yes --fstrans=no --default | ||
+ | hash -r | ||
| | ||
+ | ====Установка monit==== | ||
+ | | ||
+ | apt-get install monit | ||
+ | |||
+ | В файл /etc/monit/monitrc добавить | ||
+ | |||
+ | set httpd port 8888 and | ||
+ | use address 192.168.1.11 # Адрес сервера | ||
+ | allow 0.0.0.0/0.0.0.0 # разрешенные подсети | ||
+ | allow admin:admin # Логин и Пароль для доступа | ||
+ | |||
+ | /etc/init.d/monit restart | ||
+ |