【导语】chrome浏览器确实很强,直接支持MP4拖动播放,对于其他播放器,可以使用以下方法来支持拖动播放。拖动的关键在于生成关键帧等元数据信息,便于服务器和播放器支持拖动。

另外,nginx web服务器体验起来,也是很有前途的一个web服务器,值得研究。

flv 视频可以采用两种方式发布:

一、普通的 HTTP 下载方式

二、基于 Flash Media Server 或 Red5 服务器的 rtmp/rtmpt 流媒体方式。

多数知名视频网站都采用的是前一种方式。

两种方式对比如下:

Http Rtmp/rtmpt
生成关键帧后可拖动播放 任意拖动播放
下载完成后不再消耗服务器资源 无缓存,每次播放都会消耗服务器资源

这里说一下怎么用nginx 搭建http 方式的视频点播服务器,主要分为三步:

一、 nginx 安装及配置

1. 下载nginx 最新win32 版本解压到任意目录

2. 打开cmd 进入nginx 目录,使用命令start nginx 启动nginx (默认使用\conf\nginx.conf 配置,可用-c 选项指定要使用的配置文件,更多参数可使用nginx –h 查看)

二、 nginx 对flv 的支持

1. 编辑配置文件\conf\nginx.conf ,加入如下配置:

在http 块加入启动gzip 的配置

gzip on;

gzip_min_length 1100;

gzip_buffers 4 8k;

gzip_types text/plain;

在server 块中加入启用flv 的配置:

limit_rate_after 1m; # 下载1M 后开始限速

limit_rate 100k; # 将速度限制为100k/s

location ~ \.flv {

flv;

}

2. 使用命令nginx –s reload 重新加载配置文件

三、 客户端播放器

1. 下载开源的flash 播放器jwplayer

2. 将文件解压到nginx 下的html 目录

3. 访问http://localhost:8080/player.swf?type=http&file=1.flv即可播放视频

注意:现在视频能播放了,但并不支持拖动功能,因为没有给flv 文件添加“关键帧”,可以的工具有“yamdi” 和“flvtool”,以yamdi win32 版为例,下载解压后进入cmd 执行:

yamdi –i src.flv –o dst.flv

意思是将src.flv 添加关键帧,并输出为dst.flv 。

OK ,这时我们再访问http://localhost:8080/player.swf?type=http&file=dst.flv即可自由拖动播放了。

=========================================================================================

This post is a comparison of the performance of different tools available to tag FLV and MP4 containers with specific metadata (e.g. title, keyframes, generator or other custom fields…). For FLV containers flvtool2, flvtool++ and yamdi are compared. For the MP4 container MP4box, AtomicParsley and ffmpeg are compared.

Here are the IMO three most important FLV taggers tested on a 125MB FLV:

Name Duration Large Files In Memory Custom Tags Command
flvtool2 1.0.6 3min 11s no no yes flvtool2 -UP -band:Test -user:Test -date:1995 -genres:pop test.flv
flvtool++ 1.2.1 3s no yes yes flvtool++ test.flv -tag band “Test” -tag user “Test” -tag date “1995″ -tag genres “pop” test2.flv
yamdi 1.6 1.5s yes no no yamdi -i test.flv -o test2.flv -c “Test”

The performance of flvtool2 is horrendous. For films of 120min it will take hours to process. Therefore: Do not use it! Use Facebooks flvtool++ instead. I guess the bad performance results from it being built in Ruby. Also notice the “Large File” column indicating large file support which officially only yamdi support (by adding compile flag -D_FILE_OFFSET_BITS=64). Another important point is the “In Memory” column indicating that flvtool++ loads the entire file into memory when tagging, which is problematic when tagging large files. Given this results only yamdi should be used for FLV tagging!

Now for the MP4 tagging. Here you can select between a lot of tools from the net, but only a few of them are command line based and available for Unix. The MP4 test file used is 100MB large.

Name Duration Command
AtomicParsely 0.6s AtomicParsley test.mp4 –artist “Test” –genre “Test” –year “1995″
mp4box 0.6s MP4Box -itags Name=Test:Artist=Me:disk=95/100 test.mp4
ffmpeg 0.6 0.8s ffmpeg -i test.mp4 -metadata title=”Test” -metadata artist=”Test” -metadata date=”1995″ -acodec copy -vcodec copy test2.mp4

Given that recent ffmpeg brings the tagging for MP4 out of the box (it doesn’t for FLV though) you do not even need an external tool to add the metadata

自:http://www.aojie.biz/1030

HTTP方式播放FLV/mp4 :nginx+Yamdi/MP4BOX的更多相关文章

  1. Nginx搭建flv mp4流媒体服务器[转]

    Nginx搭建flv mp4流媒体服务器 作者:二蛋 时间:December 1, 2014 分类:Note 环境:Centos 6.4 32bit 一.安装依赖包 1.安装zlib wget htt ...

  2. rtmp和http方式在播放flv方面的各自优势和劣势

    下面是查的一点资料,比较一下用fms的rtmp和web的http播放flv的差别: 1. 区别 用HTTP方式:先通过IIS 将FLV下载到本地缓存,然后再通过NetConnection的本地连接来播 ...

  3. videojs 播放无法通过URI确定格式的视频源(flv/mp4)

    前言 前人坑我千百遍我待前人如初恋.最近公司开源节流搬机房,需要把原来的服务迁移,然后屁颠屁颠的把一个跑了几年没人管的视频网站(知道这个网站的人都走了)迁移到新的机房去. 结果跑起来发现原来里面同时存 ...

  4. Car-eye-http-flv-module 实现nginx-rtmp-mudule HTTP方式的FLV直播功能

    nginx-rtmp-mudule RTMP 是一款优秀的Car-eye-http-flv-module 是在nginx-rtmp-mudule RTMP基础上修改的流媒体服务器,除了支持flash播 ...

  5. centos 6.4 Apache 配置 flv mp4.h264 流媒体拖动

    http://blog.csdn.net/xst686/article/details/9763995 加入流媒体扩展后要重启 httpd flv 流媒体 <textarea style=&qu ...

  6. HTTP协议下可拖动时间轴播放FLV的实现(伪流媒体)

    HTTP协议下实现FLV的播放其实并不复杂,当初实现的原理是使用了flowPlayer插件实现的,效果还不错.但仍有两大问题影响着客户的访问情绪: 1.预加载时页面卡死,似乎没有边下边播. 2.偶尔边 ...

  7. IIS中asp网站播放flv视频技术

    播放flv视频文件需要使用flvplayer.swf程序(32K). HTML嵌入代码: <div id="FlashFile"> <object type=&q ...

  8. 利用开源jPlayer播放.flv视频文件

    最近工作中用到视频播放,在网上搜索对比了好几款开源播放插件后,觉得 jPlayer 是比较不错的,故作此记录! 接下来先快速的展示一下 利用jPlayer播放.flv视频的效果: <!DOCTY ...

  9. FluorineFx 播放FLV 时堆棧溢出解决 FluorineFx NetStream.play 并发时,无法全部连接成功的解决办法

    http://25swf.blogbus.com/tag/FluorineFx/ http://www.doc88.com/p-7002019966618.html  基于Red5的视频监控系统的研究 ...

随机推荐

  1. [安装] mac安装PHP7经历

    背景 前几天在mac上跑workrman,由于workerman需要开启多个进程,多进程需要pcntl扩展的支持,我之前那个brew安装的php71没有这个扩展,就直接卸载了php71,然后想下载源码 ...

  2. //……关于TCP三次握手与四次挥手

    TCP的概述 TCP把连接作为最基本的对象,每一条TCP连接都有两个端点,这种断点我们叫作套接字(socket),它的定义为端口号拼接到IP地址即构成了套接字,例如,若IP地址为192.3.4.16 ...

  3. clip-path实现loading圆饼旋转效果以及其他方法

    一.loading效果 二.clip-path css中的剪切clip-path属性是CSS Masking模块的一部分. 矩形 clip-path:inset(top right bottom le ...

  4. ICPC模板排版工具

    感谢参考:https://www.cnblogs.com/palayutm/p/6444833.html 额外安装texlive, ubuntu环境提供参考: 1.下载镜像包 https://mirr ...

  5. noip模拟赛 蒜头君的兔子

    分析:直接暴力算有30分,像斐波那契那样推式子算有60分,如果想要得到100分就要用一种数列题的常见优化--矩阵了. 当前的兔子数和十年内的兔子数有关,我们需要1个1*11的矩阵,来记录当前为0岁.1 ...

  6. ModelForm组件和forms组件补充

    forms组件补充: forms组件的三个字段:ChoiceField, ModelChoiceField & ModelMultipleChoiceField # forms组件:Choic ...

  7. 【Tomcat】Tomcat性能分析

    一.预研任务介绍和预研目标 任务介绍: Apache Tomcat是目前较为流行的web服务器,以其技术先进.性能稳定著称,其次它还是一个免费开源的项目. Tomcat性能分析的意义在于能为日常工作中 ...

  8. memcache适用和不适用场景[转载]

    适用memcached的业务场景:1)如果网站包含了访问量很大的动态网页,因而数据库的负载将会很高.由于大部分数据库请求都是读操作,那么memcached可以显著地减小数据库负载.2)如果数据库服务器 ...

  9. JAVA配置--JDK环境变量配置

    环境变量是整台电脑的全局变量,(这台电脑上)任何程序都可以读取这个变量. 如果您安装好jdk,但环境变量配置让你感到有一点模糊的话,那么请您看一下这篇,希望对您有帮助 根据打开电脑的属性(R),出现 ...

  10. 将mysql数据库数据导出为.sql文件

    打开Navicat ,在我们要到处的数据上面右击鼠标,然后弹出的快捷菜单上点击“转储SQL 文件”,在再次弹出的子菜单项中选择第一个“数据跟结构”.