来自apache的流媒体流mp4

时间:2011-03-02 14:07:36

标签: apache streaming mp4 flowplayer

我在解决这个问题时遇到了一些问题。我想我已经基于http://flowplayer.org/forum/5/14664#post-14830完成了这项工作。剪辑开始播放正常,但当我跳到尚未加载的剪辑的一部分时,它只是回到文件/视频的开头

可悲的是,大多数情况下使用的浏览器是IE6 :(

在Redhat上运行的Apache 2

我用ffmpeg创建了一个mp4文件。 运行qt-faststart 1.mp4 1.qt.mp4

已安装mod_flvx.c

添加了:

LoadModule flvx_module modules/mod_flvx.so
AddHandler flv-stream .flv

到Apache httpd.conf

使用示例页面:

<script type="text/javascript">
flowplayer("player", "flash/flowplayer-3.0.3.swf", {
  clip: {
    url: 'http://servername/player/media/1.qt.mp4',
    // default provider: 'h264streaming'
    provider: flashembed.isSupported([9, 115]) ? 'h264streaming' : 'lighttpd',
    scaling: 'fit',
    autoBuffering: true,
    autoplay: false,
    bufferLength: 3
  },
  log: {
    level: 'debug'
  },
  plugins: {
    h264streaming: {
      url: 'flash/flowplayer.h264streaming-3.0.5.swf'
    },
    controls: {
      url: 'flash/flowplayer.controls-3.0.3.swf',

      // which buttons are visible and which not ?
      play:false,
      fullscreen:true,

     // scrubber is a well known nickname to the timeline/playhead combination
      scrubber: true
    }
  }
});
</script>

有人有任何建议吗?

由于

1 个答案:

答案 0 :(得分:1)

首先,您需要查看您的apache是​​否配置为正确搜索部分视频。你可以通过传递一个像my_vide_path.mp4?start = 10这样的get参数让它开始10秒钟。如果它成功启动10秒,那么apache设置正确,你需要让flowplayer工作。如果没有正确设置apache,那么即使是正确的flowplayer配置也无济于事。

我怀疑你的apache设置正确。你告诉apache处理.flv文件然而你正在使用mp4s。

我已经成功地使用了http://h264.code-shop.com/trac/wiki中的apache模块。

您需要将模块添加并加载到apache中,并告诉apache使用它来处理.mp4文件。

下一步是使用get参数测试?start = 10以查看它是否正确搜索。

之后,您需要做的就是:

<script type="text/javascript">
flowplayer("player", "flash/flowplayer-3.0.3.swf", {
  clip: {
    url: 'http://servername/player/media/1.qt.mp4',
    default provider: 'h264streaming'

  },
  plugins: {
    h264streaming: {
      url: 'flash/flowplayer.h264streaming-3.0.5.swf'
    }
  }
});
</script>

我使用了更新的flowplayer swf而不是h264的swf,用于psuedostreaming的flowplayer插件,因为它适用于较新版本的flowplayer,显然h264没有。