Thursday, March 14, 2013

Gallery Server Pro Binary Pack Updated

The Gallery Server Pro Binary Pack is a set of open source utilities that add some great features to your gallery:

  • Video and audio encoding to web-optimized formats
  • Thumbnail extraction for video and TXT, PDF, EPS, and PSD (Photoshop) files
  • Metadata extraction for video and audio formats

These components are GhostScript, ImageMagick, and FFmpeg. Today I gathered the latest versions of them and packaged them together into an updated Gallery Server Pro Binary Pack.

Download the Gallery Server Pro Binary Pack.

Progressive loading for MP4

By far the most exciting new feature in this update is FFmpeg’s new support for creating an MP4 that will play in a browser as soon as a few seconds are buffered rather than waiting for the entire video to download. The benefit of this is that now GSP can create standard-compliant MP4 videos that start playing immediately. Because previous versions of FFmpeg forced the browser to download the entire video before beginning playback, GSP defaulted to creating a Flash Video (.flv), which *did* start playing immediately. But that created its own headaches, as the number of devices unable to run Flash have greatly increased over the last couple years.

The next version of GSP will default to creating H.264 MP4 video from most uploaded videos. But you don’t have to wait for 3.0. Install this binary pack into any 2.4 or later version of GSP and then update the Video & Audio page in site admin to include this FFmpeg argument string for MP4 video conversions:

-y -i "{SourceFilePath}" -b 384k -vcodec libx264 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8 -subq 6 -trellis 0 -refs 5 -bf 0 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -ac 1 -ar 16000 -r 13 -ab 32000 -movflags +faststart "{DestinationFilePath}"

You will also want to swap the positions of the MP4 and FLV rows so that FLV is *below* MP4, thus giving it a lower priority. The above string is close to what I expect to ship in v3. It has been carefully optimized to create a web-friendly H.264 MP4 video that works well on bandwidth-sensitive mobile devices as well as traditional computers. When you are done it will look like this:

3-14-2013 3-07-47 PM

With this change, all uploaded videos will be converted to MP4 as well as ones you sync when the ‘overwrite optimized’ option is enabled.

Remember that the Binary Pack requires full trust environments. You can tell if your site is running in full trust by looking it up on the Site Settings – General page.

No comments: