Page MenuHomePhabricator

Please set X-Content-Duration on OGG Video files
Closed, ResolvedPublic

Description

According to:
https://developer.mozilla.org/en-US/docs/Configuring_servers_for_Ogg_media

Firefox supports reading the X-Content-Duration header to get the length of an Ogg video. This avoids doing a (potentially expensive, esp. with our current infrastructure) Range request to the end of the file when start playing it. The Mozilla documentation page explains the header, its values and the circumstances around using it quite well, so I won't repeat it here.

Swift supports setting arbitrary headers, so we can set that on such videos. We should do so for both new files and existing ones using a batch job.

Note that it appears that this a) does not work in Chrome b) is not needed for WebM videos.


Version: unspecified
Severity: enhancement

Details

Reference
bz41304

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:09 AM
bzimport set Reference to bz41304.

Jan, could you look into this, and either address it if it's an easy fix, or spell out what all needs to change if it's trickier?

jgerber wrote:

Looks like its possible to add this, 3 patches are required to get it to work, with those in place step 4 could be done to set X-Content-Duration to all existing Ogg Files.

  1. Allow X-Content-Duration to be set in swift config https://gerrit.wikimedia.org/r/29768
  1. Allow X-Content-Duration to be set in SwiftCloudFiles https://gerrit.wikimedia.org/r/#/c/29767/
  1. Set X-Content-Duration when adding new Files https://gerrit.wikimedia.org/r/29769
  1. To set it on old files the best might be to run some job looping over all ogg files and doing something like: for ($alloggfiles as $file) { $file->getRepo()->getBackend()->setLength ( $file->getPath(), $file->getLength() ); }

Assigning to Aaron for review and comment.

The Swift config part was deployed today. Aaron, you can start setting the header at your discretion.

This went into 1.21wmf5. All new files uploaded to wikis running 1.21wmf5 will have this header. All pre-existing files will still need a cleanup script run over them (which hasn't been written yet).

I see the script has been merged. What's needed to actually run it?

All wikis on wmf6 now. Script is running now.

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:20 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:21 AM