[Switch] using player + Nginx to build a VOD Server solves the problem of slow drag loading.
FlvVideos can be published in two ways:
I. Common HTTP download Methods
Ii. rtmp/rtmpt stream Media mode based on Flash Media Server or Red5 Server.
Most well-known video websites use the previous method.
The two methods are compared as follows:
Http:After the key frame is generated, you can drag and play the video, and the server resources are no longer consumed after the download is complete.
Rtmp/rtmpt:Drag playback and cache-free playback consume server resources each time.
Here we will talk about how to use nginx to build an on-demand video-on-demand server in http mode. There are three steps:
I,NginxInstallation and configuration
1. download the latest nginx win32 version and decompress it to any directory.
2. open cmd to enter the nginx directory, and run start nginx to start nginx (\ conf \ nginx is used by default. conf configuration. You can use the-c option to specify the configuration file to be used. For more parameters, see nginx-h)
II,NginxSupport for flv
1. Edit the configuration file \ conf \ nginx. conf and add the following Configuration:
Add the configuration for starting gzip in the http Block
Gzip on;
Gzip_min_length 1100;
Gzip_buffers 4 8 k;
Gzip_types text/plain;
Add the flv-enabled configuration to the server block:
Limit_rate_after 1 m; # The speed limit starts after 1 M is downloaded.
Limit_rate 100 k; # limit the speed to 100 k/s
Location ~ \. Flv {
Flv;
}
2. Run the nginx-s reload command to reload the configuration file.
III,Client player
1. Download the open-source flash Player player
2. decompress the file to the html directory under nginx.
3. Access http: // localhot/player.swf? Type = http & file = 1. flv to play the video
Note: The video can be played now, but the drag function is not supported. Because "key frames" are not added to the flv file, the tools available are "yamdi" and "flvtool ", take the version of yamdi win32 as an example. Download and unzip the package and run the following command in cmd:
Yamdi-I src. flv-o dst. flv
This means to add a key frame to src. flv and output it as dst. flv.
OK. Then we can access http: // localhot/player.swf? Type = http & file = dst. flv.
Source: http://www.eoeandroid.com/forum.php? Mod = viewthread & tid = 313997.