nignx 直播流

  1. sudo apt update
  2. sudo apt install libnginx-mod-rtmp

打开配置文件nginx.conf,添加RTMP的配置。

rtmp {
server {
listen 1935;
chunk_size 4096;
application vod {
play /mnt/HDD80/vod;
}
application live {
live on;
record all;
record_unique on;
record_interval 5m;
record_suffix .mp4;
record_path /mnt/HDD80/record;
}

}
}

location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}

location /stat.xsl { 
    root /usr/share/doc/libnginx-mod-rtmp/examples/;
}