Configuring nginx streaming media server under windows, to support hls protocol rtmp live and on-demand

    Before bloggers blog " in the windows set up, configure nginx streaming media server, and push the stream rtmp stream, pull flow testing " in about the live set up nginx streaming media server in the windows, to support rtmp protocol of method. This article describes to support hls protocol rtmp live and on-demand approach.

 

First, the live nginx support hls agreement

    We enter nginx 1.7.11.3 Gryphon conf directory folder under, according to " in the windows set up, configure nginx streaming media server, and push rtmp stream flow, the flow pull test is configured (In that Bowen" in the configuration file in the configuration file has been modified to support the broadcast of the hls). Then nginx 1.7.11.3 Gryphon directory create a new folder m3u8File, as shown below.

 

Then we restart nginx, enter the following command to push the stream at the command prompt:

ffmpeg -re -i video2.mp4 -vcodec copy -acodec copy -f flv rtmp://127.0.0.1/live/test1

 

After the execution of Appeal ordered, and you can see already m3u8 ts files in the output directory m3u8File, as shown below:

We hls streaming through vlc

 

You can see the normal play video, as shown below:

 

Note: Use nginx for slicing hls, inaccurate length (obtained slicing length much greater than the actual length of the slice set) when the slice situation may occur. This may be caused by GoP nginx could not be set, we can use the FFmpeg be replaced hls slice, specific methods can refer to another article bloggers " use FFmpeg command hls slice, inaccurate long time to get the ts files ."

 

Second, the demand nginx support

    我们进入nginx 1.7.11.3 Gryphon文件夹的conf目录下,按照《在windows下搭建、配置nginx流媒体服务器,并进行rtmp流的推流、拉流测试》中的配置文件进行配置(在那篇博文中就已经将配置文件修改为支持点播了)。然后在nginx 1.7.11.3 Gryphon目录新建文件夹vod,如下图所示:

 

在vod目录中放入一个flv文件(貌似nginx的点播只支持flv文件,mp4文件是不支持的),如下图所示:

 

然后在vlc中输入url如下:

 

可以看到在vlc中可以播放媒体文件test.flv了,如下图所示:

ran

发布了54 篇原创文章 · 获赞 55 · 访问量 12万+

Guess you like

Origin blog.csdn.net/u014552102/article/details/103191245