准备软件:
nginx-1.6.0.tar.gz
yamdi-1.9.tar.gz
yamdi 是渐进式流支持模块,抓取视频资源关键帧实现播放时的随意拖动效果
下载地址:http://ncu.dl.sourceforge.net/project/yamdi/yamdi/1.9/yamdi-1.9.tar.gz
flv视频可以通过http或rtmp方式发布。这里用http方式。
安装nginx及mp4支持模块和flv模块:
nginx支持mp4模块下载地址:http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
下载后解压。
安装编译环境:
[root@localhost nginx-1.6.0]# yum install -y zlib zlib-devel pcre pcre-devel
[root@localhost nginx-1.6.0]# useradd -s /sbin/nologin www
[root@localhost nginx-1.6.0]# ./configure --prefix=/usr/local/nginx --add-module=../nginx_mod_h264_streaming-2.2.7 --with-http_ssl_module --user=www --group=www --with-http_flv_module --with-http_stub_status_module
[root@localhost nginx-1.6.0]# make && make install
make -f objs/Makefile
make[1]: Entering directory `/root/nginx-1.6.0′
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -D_LARGEFILE_SOURCE -DBUILDING_NGINX -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \
-o objs/addon/src/ngx_http_h264_streaming_module.o \
../nginx_mod_h264_streaming-2.2.7/src/ngx_http_h264_streaming_module.c
In file included from ../nginx_mod_h264_streaming-2.2.7/src/ngx_http_h264_streaming_module.c:2:
../nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c: In function ‘ngx_streaming_handler’:
../nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c:158: error: ‘ngx_http_request_t’ has no member named ‘zero_in_uri’
make[1]: *** [objs/addon/src/ngx_http_h264_streaming_module.o] Error 1
make[1]: Leaving directory `/root/nginx-1.6.0′
make: *** [build] Error 2
出现一个错误,解决方法:
编辑/root/nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c
[root@localhost src]# vim ngx_http_streaming_module.c
注释掉:
/* TODO: Win32 */
if (r->zero_in_uri)
{
return NGX_DECLINED;
}
重新make通过。
nginx配置文件:
[root@localhost nginx-1.6.0]# grep -v “#” /usr/local/nginx/conf/nginx.conf | grep -v “^$”
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /usr/local/nginx/html;
location ~\.flv {
flv;
}
location ~\.mp4$ {
mp4;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
创建两个视频文件夹/usr/local/nginx/html/flv、/usr/local/nginx/html/mp4 存放视频文件。
安装yamdi实现拖动效果:
[root@localhost yamdi-1.9]# make && make install #两步即可
给视频添加帧:
[root@localhost flv]# yamdi -i 1.flv -o test.flv #给1.flv添加关键帧输出为test.flv
找一个flash播放器,下载地址:http://chinaapp-wordpress.stor.sinaapp.com/uploads/2013/08/player.swf 推荐wget方式下载。
测试:
浏览器访问: http://192.168.0.172/player.swf?type=http&file=flv/test.flv
192.168.0.172 #服务器ip地址
player.swf #flash播放器程序
http #用http方式发布
flv #为路径
test.flv #为视频文件
荒野乱斗国际版 (BrawlStars)最新版本v56.274
下载一波超人内置修改器菜单版 安卓版v1.0.2
下载敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载继承了一座戏园子无限声望铜钱版 内置菜单最新版v1.7
继承了一座戏园子折相思版是游戏的破解版本,在该版本中为玩家提
山河半世橙光清软金手指版 无限鲜花v3.24
山河半世是一款超级好玩的橙光恋爱游戏,在游戏中玩家们需要扮演
蓬莱手游折相思版 安卓版v1.0.0
蓬莱免广告版是游戏的修改版本,在该版本中为玩家去除了广告,玩
当红影后橙光游戏破解版2025 最新版v1.0
当红影后橙光破解版是一款超级好玩的娱乐圈题材的橙光游戏,在这
忽然成了万人迷清软完结版 无限鲜花版v12.15
忽然成了万人迷破解版是一款非常好玩的男性向橙光游戏,在有一天