Nginx to build streaming media FLV Video Server Configuration Example _nginx

Source: Internet
Author: User

FLV video is already the majority of video sites preferred video type, domestic and foreign famous video sharing station YouTube, Youku, potatoes, Sina Blog, Qiyi and so on are all Flash Player Flv/mp4 video.

FLV has two modes of publishing

One, ordinary HTTP way: This method usually needs to download to the local to play, there is buffering, but the download will not occupy the server resources.

Second, streaming media mode: No need to download, can play in real time arbitrary drag and drop progress, user experience good but very consuming server resources.

Installing modules

Add the FLV stream module to the Nginx when compiling the installation

Copy Code code as follows:
./configure--user=www--group=www--prefix=/usr/local/webserver/nginx--with-http_flv_module
Make && make install

Open flv
Copy Code code as follows:
Server
{
Listen 80;
server_name flv.qttc.net;
Index index.html;
Root/web_root/flv_files;
Limit_rate_after 5m;
Limit_rate 1m;
Location ~ \.flv
{
flv
}
Access_log off;
}

Save the reboot just fine.

Parameter description:

Copy Code code as follows:

Limit_rate_after 5m # starts loading unlimited speed until download FLV video size exceeds 5M.
Limit_rate 1m # When more than 5m start to limit the speed of 1m/s download.

The general user just opened the video file need to download a lot of bytes in advance, so that side of the download without waiting for the buffer, without affecting the user experience can save many bandwidth, the two values to fine-tune according to the actual situation.

Drag and drop implementation

Drag-and-drop progress is a frequently triggered behavior of the user, the default FLV does not support drag, if you want to implement this feature requires the installation of additional plug-in modules to achieve. You need to write keyframe information to metadata when making flv.

There are many tools for adding keyframes, such as Yamdi, FlvTool2, and so on, and how to add keyframes can be found in the community of these tools. But in any case is the number of seconds per frame to achieve, the more frames the more smooth, but time-consuming and long, played in the Flash know.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.