Https://github.com/illuspas/nginx-rtmp-win32
Http://bashell.sinaapp.com/archives/build-nginx-rtmp-module-on-windows.html
Https://github.com/xaccc/nginx-rtmp-win32
Https://github.com/luowei/nginx-rtmp-sample/blob/master/conf/nginx.new.conf
Https://github.com/luowei/nginx-rtmp-sample
First step: first introduce the relevant technology used
Note: The Jwplayer plug-in used in the project does not support the RTSP protocol, so use the following techniques to turn the art
- FFmpeg is an open-source computer program that can be used to record, convert digital audio, video, and turn it into a stream. Here I only use its video format conversion function, the RTSP protocol to the stream into rtmp
- RTSP protocol ( live stream Transfer Protocol ):
The company uses Hoi Hong's surveillance address for (Rtsp://admin:[email Protected]/h264/ch1/main/av_stream)
3. RTMP protocol ( Real-time message Transfer Protocol ):
RTMP is a network protocol designed for real-time data communication, which is used primarily for audio and video and data communication between the Flash/air platform and the streaming/interactive server that supports the RTMP protocol. The software that supports this protocol includes the Adobe Media server/ultrant media server/red5/nginx ( The nginx I use here) and so on.
4.Jwplayer is an open source Flash video, audio, and image player for use on Web pages.
It supports playback of Adobe Flash player and HTML5 browser which can handle any format (FLV files, H. MP4 features, VP8, WEBM, support mp3,aac,jpg,png and GIF). It also supports a variety of streaming and playlist formats (including RMTP protocol, HTTP Live and more) and a variety of playback options.
5.nginx-rmtp-module is the streaming media plugin for Nginx server:
Nginx itself is an excellent HTTP server, FFmpeg is a very good audio and video solution. These two things through an nginx module Nginx-rtmp-module, Together, you can build a relatively well-functioning streaming media server. This streaming media server can support RTMP and HLS (Live Http stream).
Nginx with FFmpeg to do streaming media server principle is:
Nginx provides rtmp service via RTMP module, FFmpeg pushes an rtmp stream to Nginx, and then the client accesses Nginx to watch the real-time video stream. ( Here I use Jwplayer to access this rtmp address )
The second step: the configuration and application of related software
- nginx-1.5.8 version currently in use
(Now you need to use the Nginx-rtmp.exe program, online can search for the software has integrated rtmp module version of Windows)
2. Open the Conf folder to locate the nginx.conf file, configure rtmp
(Add rtmp{....} )
3. Run the cmd command to start the Nginx.exe service
(Start Nginx.exe: Start the Nginx service and see if there are any nginx.exe in the process)
4. Open Web input: localhost or 127.0.0.1 Native IP
(Show the interface instructions to start successfully)
The third step: the configuration and application of related software after the Nginx service is started, you can execute the ffmpeg command to turn the RTSP protocol into rtmp:
Ffmpeg-i "Rtsp://admin:[email Protected]/h264/ch1/main/av_stream"-F flv-r 25-s 640x480-an "rtmp://192.168.3.138:1935 /myapp/test2 "
- Run cmd: Execute ffmpeg command statement
FFmpeg: Actually is Ffmpeg.exe, when you run the statement, the. exe does not
-I: Behind the camera protocol that I need
-F FLV: Back to the RTMP server I'm going to go to Nginx
-S: Video resolution: (Distribution Rate) is the sharpness of the screen can be adjusted, if the test recommendations on the local 640*480 is good, change the video stream of the analytic CPU will consume a lot
(rtmp service address: RTMP://192.168.3.138:1935/MYAPP/TEST2)
192.168.3.138:nginx Machine IP for startup
1935: Port number (previously configured in nginx.conf)
MyApp: Is the name behind the application
Test2: You can get up, remember when you visit rtmp to be consistent
Enter Execution FFmpeg statement
(Below is the result of my execution, proves that my execution is successful, through the FFmpeg to the RTSP protocol camera's video stream has been running to the Nginx rtmp video streaming server)
Fourth Step: Configure Jwplayer: file name jwplayer6.8.4616[(2014-06-28) (Perfect to Watermark
(Online download resources, here mainly used to jwplayer.js and jwplayer.flash.swf two, index.html there are some parameters introduced, the corresponding introduction of other documents can be Baidu Jwplayer use method)
Note: Jwplayer does not seem to support playback in a local HTML page, to play in a server environment
The project only configures what it needs:
attached: Execute the FFMPEG statement in Java as follows
123456789101112131415161718192021222324 |
public
static
boolean
convertProtocol(String ffmpeg,String rtsp, String rtmp,String s){
// ffmpeg -i "rtsp://admin:[email protected]/h264/ch1/main/av_stream"
// -f flv -r 25 -s 640x480 -an "rtmp://192.168.3.138:1935/myapp/test2"
List<String> commend =
new
ArrayList<String>();
commend.add(ffmpeg);
commend.add(
"-i"
);
commend.add(
"\""
+rtsp+
"\""
);
commend.add(
"-f"
);
commend.add(
"flv"
);
commend.add(
"-r"
);
commend.add(
"25"
);
commend.add(
"-s"
);
commend.add(s);
commend.add(
"-an"
);
commend.add(rtmp);
try
{
ProcessBuilder builder =
new
ProcessBuilder();
//创建系统进程
builder.command(commend);
builder.start();
//启动进程
}
catch
(Exception e) {
e.printStackTrace();
}
return
true
;
}
|
Note: The above-mentioned software can be found on the Internet, if not found or have any problems can I number: CCBABC
Reprint Please specify the source thank you
Windows down Media nginx-rmtp-module server build and Java program call Fmpeg to turn rtsp to rtmp live stream "turn"