flowplayer streaming mp4 from apache

Raoul picture Raoul · Mar 2, 2011 · Viewed 7.8k times · Source

I'm having some problems getting this to work. I think I've done it right based on http://flowplayer.org/forum/5/14664#post-14830). The clip starts to play fine, but when I skip to a part of the clip which hasn't loaded yet it just goes back to the start of the file/video

Sadly the browser used is IE6 for the most part :(

Apache 2 running on Redhat

I've created an mp4 file with ffmpeg. Run qt-faststart 1.mp4 1.qt.mp4

Installed mod_flvx.c

Added:

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

To Apache httpd.conf

Using the example page:

<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>

Anyone have any suggestions?

Thanks

Answer

tbonci picture tbonci · Mar 2, 2011

First off, you need to see if your apache is configured to correctly seek to parts of the video. You can do that by passing a get parameter like my_vide_path.mp4?start=10 to have it start 10 seconds in. If it successfully starts 10 seconds in, then apache is set up correctly and you need to make flowplayer work. If apache isn't set up correctly, then even the correct flowplayer config won't help.

I doubt your apache is set up correctly though. You're telling apache to handle .flv files and yet you're using mp4s.

I've successfully gotten this to work with the apache module from http://h264.code-shop.com/trac/wiki.

You'll need to add and load the module into apache and tell apache to handle .mp4 files with it.

Next step would be to test with that get parameter ?start=10 to see if it is seeking correctly.

After that, all you need to do is:

<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>

I used the updated flowplayer swf and instead of h264's swf, the flowplayer plugin for psuedostreaming, as it works with the newer version of flowplayer and apparently the h264 one didnt.