Photo: Sahara Desert
Download nginx and nginx-rtmp source code: nginx.org/download/ng… Github.com/arut/nginx-…
CD nginx-1.5.10./configure — with-http_ssl_module — add-module=.. /nginx-rtmp-module-master make make install
Browser type localhost:8010 (default 80, 8010 is used because other services are in use) and get the following:
Configure nginx to support RTMP, find nginx.cnf, add the RTMP node after the HTTP node is finished, as follows:
rtmp { server {
listen 1935; // Listen on port 1935
Application yuiop {// why yuiop? You know
live on;
record off;
}
}
}
FFmpeg starts streaming, first pushing a live stream to live
Then start to see if the server stream is viewable and start to pull the stream to play
ffplay rtmp://xxx.xxx.xxx.xxx:1935/yuiop/live
You can also write js code in the web port, also can support playback, the effect is as follows:
Push a stream, pull a stream is not enough, live, however, there are n streams pushing and pulling at the same time, then, push and pull two, it is natural and successful.
If I use my previous example in Android Multimedia Framework Summary (2) MediaPlayer framework and The Case of Playing Network Video, I pass the live broadcast address to MediaPlayer, and you can watch the live broadcast on your phone.
Finally, a family photo, with a 2-3 second delay on both the local PC and the live stream server
The first time to get [not only personal original Android/audio and video technology drygoods, problem depth summary, FrameWork source code analysis, plug-in research, FFmpeg research, live technology, the latest open source project recommendation, and more workplace thinking], welcome to follow my wechat public number, Scan the qr code below or long press to identify the QR code