Skip to content

Instantly share code, notes, and snippets.

@shaposhnikoff
Last active August 29, 2015 14:10
Show Gist options
  • Save shaposhnikoff/21b356099146ab9aa3a6 to your computer and use it in GitHub Desktop.
Save shaposhnikoff/21b356099146ab9aa3a6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Собираем сервер
mkdir tmp
cd tmp
wget -c http://nginx.org/download/nginx-1.7.6.tar.gz
tar xzvf nginx*
git clone https://github.com/arut/nginx-rtmp-module.git
cd nginx-1.7.6
./configure --prefix=/opt/nginx-rtmp --add-module=../nginx-rtmp-module --with-http_ssl_module
make
sudo make install
###########################
rtmp {
server {
listen 1935;
ping 30s;
notify_method get;
application octopus {
live on;
}
application myapp {
## exec_record_done /bin/ffmpeg -y -i $path -acodec libmp3lame -ar 44100 -ac 1 -vcodec libx264 $dirname/$basename.mp4;
live on;
hls on;
hls_path /opt/nginx-rtmp/hls_cam;
hls_fragment 30s;
hls_playlist_length 600s;
hls_continuous on;
record_suffix -%d-%b-%y-%T.flv;
record_unique off;
record_notify on;
record_append on;
record off;
record_max_size 100M;
record_path /opt/nginx-rtmp/records;
}
}}
###################
######################################################################
location /hlscam {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /opt/nginx-rtmp/hls_cam;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /opt/nginx-rtmp/html;
}
location /control {
rtmp_control all;
}
location /had {
alias /home/max/bin;
}
########################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment