Tutorial on Installing Nginx-RTMP Streaming Server on Ubuntu 14

Tutorial on Installing Nginx-RTMP Streaming Server on Ubuntu 14

1. RTMP

RTMP streaming protocol is a real-time audio and video transmission protocol developed by Adobe;

2. Nginx-rtmp

nginx-rtmp is an RTMP service module based on nginx, open source, free

https://github.com/arut/nginx-rtmp-module

3: Installation process in Ubuntu server 14

1. First download and install nginx and nginx-rtmp compilation dependency tools

sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev

2. Create a working directory and switch to it

mkdir ~/working
cd ~/working

3. Download nginx and nginx-rtmp source code

wget http://nginx.org/download/nginx-1.7.5.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

4. Install the unzip tool and decompress the downloaded installation package

sudo apt-get install unzip

5. Unzip the nginx and nginx-rtmp installation packages

tar -zxvf nginx-1.7.5.tar.gz
unzip master.zip

6. Switch to the nginx-directory

cd nginx-1.7.5

7. Add nginx-rtmp template to nginx

./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master

8. Compile and install

make
sudo make install

9. Install nginx init script

sudo wget https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo update-rc.d nginx defaults

10. Start and stop the nginx service and generate the configuration file

sudo service nginx start
sudo service nginx stop

11. Install FFmpeg

sudo apt-add-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg

12. Configure nginx-rtmp server

Open /usr/local/nginx/conf/nginx.conf

Add the following configuration at the end

rtmp {
  server {
      listen 1935;
      chunk_size 4096;

      application live
          live on;
          record off;
          exec ffmpeg -i rtmp://localhost/live/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 350K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 56k rtmp://localhost/live360p/$name;
      }
      application live360p
          live on;
          record off;
    }
  }
}

13. Save the above configuration file and restart the nginx service

sudo service nginx restart

14. If you use a firewall, please allow port tcp 1935

16: Use the client to collect video in real time using the rtmp protocol

Field 1: rtmp://your.vultr.ip/live/
Field 2: stream-key-your-set

For video capture, I use the iPhone5 capture program https://github.com/jgh-/VideoCore

[_session startRtmpSessionWithURL:@"rtmp://192.168.86.246/live/" andStreamKey:@"test"];

17. During the client acquisition process above, you can use the VLC player to open the RTMP real-time stream

rtmp://your.vultr.ip/live/stream-key-you-set

Open the above stream to test the real-time effect

18: More configuration about nginx-rtmp

https://github.com/arut/nginx-rtmp-module/wiki/Directives

Summarize

The above is the tutorial on how to install Nginx-RTMP streaming media server on Ubuntu 14. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Unity3D game engine implements an example of opening WebView in Android
  • Detailed steps for unity3d to publish apk and run it in android virtual machine (unity3d export android apk)
  • Nginx builds rtmp live server implementation code
  • How to play rtmp video file stream in vue project
  • vue-video-player implements real-time video playback (monitoring equipment-rtmp stream)
  • Detailed explanation of configuring Nginx+RTMP+HLS+HTTPFLV server in Ubuntu 18.04 to realize on-demand/live broadcast/recording functions
  • How to use python-librtmp to implement rtmp streaming h264 on Raspberry Pi
  • How to install python librtmp package under Linux system
  • Nginx-rtmp realizes real-time streaming effect of live media
  • Nginx uses nginx-rtmp-module module to realize the live broadcast room function
  • Detailed steps to build nginx+rtmp live server on Mac
  • Android implementation of RTMP push in Unity3D example

<<:  How to modify the mysql table partitioning program

>>:  WeChat applet learning notes: page configuration and routing

Recommend

MySQL 5.7.17 installation and configuration graphic tutorial

The blogger said : I have been writing a series o...

Disable input text box input implementation properties

Today I want to summarize several very useful HTML...

Detailed tutorial on installing VirtualBox and Ubuntu 16.04 under Windows system

1. Software Introduction VirtualBox VirtualBox is...

jQuery plugin to implement minesweeper game (2)

This article shares the second article of using j...

How to add interface listening mask in Vue project

1. Business Background Using a mask layer to shie...

Application of anchor points in HTML

Set Anchor Point <a name="top"><...

Have you really learned MySQL connection query?

1. Inner Join Query Overview Inner join is a very...

Nodejs uses readline to prompt for content input example code

Table of contents Preface 1. bat executes js 2. T...

jQuery implements breathing carousel

This article shares the specific code of jQuery t...

In-depth explanation of MySQL isolation level and locking mechanism

Table of contents Brief description: 1. Four char...

Analysis of implicit bug in concurrent replication of MySQL 5.7

Preface Most of our MySQL online environments use...

JavaScript anti-shake case study

principle The principle of anti-shake is: you can...

Example of how to import nginx logs into elasticsearch

The nginx logs are collected by filebeat and pass...

Detailed explanation of the use of Vue Smooth DnD, a draggable component of Vue

Table of contents Introduction and Demo API: Cont...