科技公司名称大全简单大气,seo最强,东莞市手机网站建设平台,wordpress piklist原创作品#xff0c;允许转载#xff0c;转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://deidara.blog.51cto.com/400447/235562所需要的 播放器#xff0c;我用的开源的 JW FLV Media Player我把我的上传到了blog 大家可以下载…原创作品允许转载转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://deidara.blog.51cto.com/400447/235562 所需要的 播放器我用的开源的 JW FLV Media Player 我把我的上传到了blog 大家可以下载。。 做了一点点改动 shell $ wget http://downloads.sourceforge.net/project/yamdi/yamdi/1.4/yamdi-1.4.tar.gz?use_mirrornchc shell $ wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz shell $ tar zxvf nginx-0.7.64.tar.gz shell $ cd nginx-0.7.64 shell $ groupadd www shell $ useradd -g www www shell $ ./configure --prefix/usr/local/nginx --userwww --groupwww --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-ccgcc --with-cc-opt -O3 shell $ make shell $ make installl shell $ tar zxvf yamdi-1.4.tar.gz shell $ cd yamdi-1.4 shell $ gcc yamdi.c -o yamdi -O3 -Wall shell $ mv yamdi /usr/bin/ 注意我们编译的 yamdi 它起着重要的作用因为一个FLV视频要能够拖拽播放这个FLV在其 metadata中有关键桢的信息但大部分FLV 是没有的。所以我们要甬道开源的yamdi来为视频添加关键帧信息 命令为 shell $ yamdi -i input.flv -o out.flv shell $ cd /usr/local/nginx/conf shell $ cat nginx.conf user www; worker_processes 1; error_log logs/error.log; pid logs/nginx.pid; 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 /var/www; index index.html; charset utf-8; ### 重要部分 location ~ \.flv { flv; } error_page 500 502 503 504 /50x.html; location /50x.html { root html; } } shell $ mkdir -p /var/www shell $ cd /var/www shell $ cat index.html html script typetext/JavaScript src\#\ /script head script typetext/JavaScript /* ![CDATA[ */ function createPlayer() { var flashvars { file:video.flv, type:http, image:preview.jpg, autostart:false, streamer:start } var params { allowfullscreen:true, allowscriptaccess:always } var attributes { id:player1, name:player1 } swfobject.embedSWF(player.swf, placeholder1, 320, 196, 9.0.115, false, flashvars, params, attributes); } /* ]] */ /script /head body οnlοadcreatePlayer(); div idplaceholder1/div /body /html ####重要部分就是黄色字体部分 #### type参数为 http,是表明了http方式播放、访问 #### streamer 参数为 “start”,这个参数用于传递给服务器从特定的关键帧开始播放nginx编译了 flv 模块 所以是支持的。。 好了现在就 打开 IE 来测试吧为了能更好的测试你可以利用 nginx 限速功能这样明显或者你用一个比较大的FLV 来做测试记得要用 yamdi 添加一下关键侦哦~ ps:现在我们的任务就是用户上传各种格式的媒体文件转换成FLV格式然后在由yamdi 添加播放关键侦~~目前就是这样得了~~ 媒体转换文章请看我写的另一篇文章 ffmpeg支持常用的所有格式转换FLV http://deidara.blog.51cto.com/400447/144681 参考 http://linux.cn/home/space-3-do-blog-id-136.html 本文出自 “linuxer” 博客请务必保留此出处http://deidara.blog.51cto.com/400447/235562 转载于:https://www.cnblogs.com/chenhaib/archive/2012/12/21/2827965.html