This one seems relatively simple so I thought I would throw it out there-

The new JW player has support for different quality videos to be served to users with different bandwidths--essentially a High version and a Low version. I'm having a lot of rebuffering problems on my site, and flashvideo support of this feature would be sweet.

Comments

ore’s picture

I'm currently building this into the latest version of flashvideo. It probably won't be what the maintainers want but it will do what i want it to. I've fixed a bug in the flashvideo_get_size function where if the extension was already loaded nothing happened.

// Check to see if the extension is loaded.
    if (!extension_loaded($extension)) {

      // If not, then load the extension.
      dl($extension_soname);
}  //// <<=  put the end brace after this so the following lines get executed when the extension is already loaded.

// Set the CWD filepath of the file to be tested.
      $filepath = getcwd() .'/'. $file->filepath;

      // Create the FFMPEG-PHP movie object.
      $movie = new ffmpeg_movie($filepath);

Anyway back to it. Basically I'm making it do the following.
Convert a low res version (640x480) in my case or whatever the video size is set to.
It checks if the original video size is greater than this. if so it marks it as an HD capable video.

Then when a cron run happens that is not processing any other videos (as HD conversion is more strain on the server) the first HD capable video that hasn't had an HD conversion created is processed.
When ever the player loads a file it checks if there is a coverted HD video for that node and if so enables the HD plugin in the player and offers it to the user.

As I say, this is being made for the characteristics of my setup first so people who have lots of videos uploaded and cron runs once a day will find this solution not so good. I have a cron running every 5 mins or so which will work out well.

cheers

mike

vood002’s picture

Neat, Mike, I'll look forward to seeing what you come up with

travist’s picture

Thanks for your work Mike. I do have a question, though. Are you going to require FFMPEG-PHP for this feature to work? It seems that might be necessary in order to get the video resolution. This is really cool, but many people do not have FFMPEG-PHP installed. Can you think of any way to determine the video size without this plugin? If so, then maybe we should explore that route. I look forward to seeing what you come up with.

Thanks again for your efforts.

Travis.

ore’s picture

Hi Travis,

Glad to help out, awesome module for the last couple of years, as you know.

I believe there are two methods used for getting the size in the flashvideo module. one is in flashvideo_get_size which uses the ffmpeg-php you are talking about. The other is in _flashvideo_video_resize which does an input only command to ffmpeg and then uses reg ex to get the dimensions back from it. ill put this method into get_size as a fall back on users not have ffmpeg-php.

I've got the whole lot going (minus a few scenarios) but found there is a bug in the jwplayer where once the low res file is buffered switching to hi-res does not reload the file. this is listed as a bug in their forums. I've made a lot of changes throughout and much of it needs tidying up (hard coded statuses, admin options etc). I'll be fixing a few bugs and getting the rest of the scenarios out tomorrow and putting live on my site so you can test it out in the next days.

cheers

mike