arthur's blog

Hooks and Queues - Media Mover 2 Improvements

As Media Mover 2 finally moves toward alpha, I've taken the risk of doing some significant refactoring- or at least improvements- to make the transition to Drupal 7 easier as well as to provide a much more robust platform people to start leveraging.

Similar to Drupal 7's [hook_file_load](http://api.drupal.org/api/function/hook_file_load/7), Media Mover now offers hook_media_mover_file_load() and hook_media_mover_file_save(). This allows for easy altering of files as they pass through the system. These are both cache aware so you can still benefit from caching while having the ability to avoid modifying a cached file if your modifications are not dynamic (cached Media Mover files have $file->cached set). Steps and configurations are also alterable on load and save.

Media Mover 2 and Drupal Queue

With folks using [Media Mover](http://drupal.org/project/media_mover) to transcode larger and larger video files, cron time outs have become somewhat of a problem as Drupal waits for FFmpeg to complete its processing. With Media Mover one, configurations are run from cron by default (not required, but out of the box) which means that cron runs as long as the Media Mover configuration takes. While it is possible to limit cron runs, the reality of transcoding a gigabyte file is that it takes time regardless of how much horsepower you can throw at it. Media Mover one was setup to be friendly to multi-machine systems, but the system left some things to be desired.

Pages