You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Thumbor/Video

From Wikitech-static
Jump to navigation Jump to search

Unlike other file formats that are solely handled by a custom engine, video is handled in Thumbor via a custom loader. This allows us to leverage ffmpeg's seeking capabilities, only fetching the frame we're interested in over the network, rather than the entire video file. Once the frame is extracted, we pass it on to our default (custom) imagemagick engine.

The custom loader reuses the multipage "page" filter to support the seek parameter from the Mediawiki thumbnail URL format. If no explicit seek point is requested, the default is the video's midpoint, just like Mediawiki. If the desired frame fails (explicit seek point or default midpoint), we attempt to fetch the first frame of the video as a last resort.

Ogv and Webm are handled the same. The custom loader decides to trigger or not based on the file extension. This is to avoid having a separate network call just to sniff the content.