Extension:TimedMediaHandler/ja

The TimedMediaHandler extension allows you to display audio and video files in wiki pages, using the same syntax as for image files. It includes the Kaltura HTML5 Player, which supports integrated standard timed text support, real time stream switching between multiple WebM and Ogg derivatives and many other features. TMH server side support includes multiple transcode profiles, php based medata parsing via PEAR Ogg / OggHandler and getID3 for WebM files, and integrates with mediaWiki's jobQueue system for scheduling transcoding jobs.

Feature Overview
See Commons:Commons:TimedText and Multimedia_beta page.

Syntax synopsis
In addition to the image embed syntax, Timed Media Handler supports:


 * Video.ogv : Display a video at its nominal size. Displays a still image from the midpoint with a play button to start an embedded player.
 * Audio.oga : Show a placeholder for a sound file, with a play button to start an embedded player.
 * Video.ogv : Show a video in a floating thumbnail box
 * : Show a video embedded in an image gallery ( each clip will popup a dialog for the full player )
 * Video.ogg : Use a frame from 1 minute 25 seconds into the video as the placeholder image. A single number is taken as an offset in seconds.
 * Video.ogg : Temporal media fragments Displays a video clip starting at 1 minute 25 seconds into the video. A single number is taken as an offset in seconds. You can also include an end time of the form  Which would result in a clip of 5 seconds playing from 1:25 to 1:30. If thumbtime is not provided, the start time will be used for the displayed thumbnail.

Client support


See bug 25370 and associated attached screen shot shows the player working in a few different browsers.

インストール
Also see the for detailed install instructions.

You will want a recent version of ffmpeg in order to support encoding to WebM ( with the latest version of VP8) and a copy of ffmpeg2theora to encode ogg videos. j^ supplies up-to-date static builds of ffmpeg with WebM support and of ffmpeg2theora for major OSs at firefogg.org/nightly/

To install this extension, add the following to the end of your LocalSettings.php: This extension also requires schema changes, so run update.php after installing.

The extension will automatically add supported file types (except mp4) to $wgFileExtensions, so you do not need to manually add video file types.

Configuration
Here are the configuration variables and their default settings:

For transcoding, make sure you have $wgMaxShellMemory, $wgMaxShellTime, $wgMaxShellFileSize are large enough to allow encoding jobs to run and save output. Default values are most likely too low.

Running transcode jobs
Because transcode jobs are resource intensive they will not run as part of normal job queue ( see bug 27336 ) Instead they must be requested by the --type argument:

Encoding nodes
To be able to transcode many videos you might want to run multiple encoding nodes that connect to the master db and access your file store directly. If you are using ubuntu lucid (10.04) you should add this ppa and install php5-cli php-pear imagemagick ffmpeg ffmpeg2theora.

Minimal install under Ubuntu 12.04
add-apt-repository ppa:j/timedmediahandler apt-get install php5-cli php-pear imagemagick ffmpeg ffmpeg2theora

In Localsettings.php, add the path for PEAR !

ロードマップ

 * Add api module for listing of derivatives ( done in TimedMediaHandler )
 * Add support for transcoding from arbitrary format uploads.
 * Improve transcoding tracking with database tables for registering failed transcodes, time taken per transcode, allow users to flag files as not playable or a visually broken transcodes.
 * Improve mobile support for uploading and playback ( via native aps if the browser html5 support does not include WebM )
 * Add support for WebM flattening of edited sequences
 * Add support for mp3 uploads and audio transcoding to mp3 and ogg. ( Off by default until mp3 patents expire in 2012 )
 * Add support for IE9 video tag WebM components
 * Add support for 1080p videos
 * Upgrade to 2.x branch.

注記
These notes about the status of TimedMediaHandler were shared by Jan Gerber at the end of his consulting agreement for WMF on 27 September, 2013:

Since you asked in the last meeting to write up an overview of the current state of TimedMediaHandler, here we go:


 * videoscalers:
 * setup like jobrunners, but only processing video transcode jobs (configuration of jobs/memory/threads in puppet and wikimedia-config)


 * imagescalers:
 * extract frames from videos, using avconv for all videos reading videos via http from swift backend


 * proxy caches:
 * must support HTTP 206 Range Requests for video urls (currently requires custom code that is managed in puppet)


 * custom packages for video transcoding (apt.wikimedia.org):
 * ffmpeg2theora (new upstream version to reduce memory by only using one thread)
 * libav (ubuntu version with patch to fix memory leak in ogg decoder)
 * libvpx (new upstream version fixing various issues and quality improvements)


 * custom packages for image scaling (apt.wikimedia.org):
 * vips (new upstream version addressing various performance issues)


 * TimedMediaHandler:
 * Upstream coded included in TMH:
 * mwEmbed (https://github.com/kaltura/mwEmbed) has local changes needs to be merged during next update
 * PEAR File_Ogg (http://pear.php.net/package/File_Ogg) has local changes was part of OggHandler, Tim is upstream maintainer
 * getID3 (http://getid3.org) has small local changes but merged upstream


 * Statistics and monitoring:
 * Transcoding queue and errors:
 * http://commons.wikimedia.org/wiki/Special:TimedMediaHandler
 * https://commons.wikimedia.org/wiki/User:Dispenser/sandbox


 * Ganglia for video scalers:
 * http://ganglia.wikimedia.org/latest/?r=hour&cs=&ce=&s=by+name&c=Video%2520scalers%2520eqiad&tab=m&vn=

Wikimedia status
Deployment-blocker issues in Bugzilla

関連項目

 * ReviewQueue
 * Test Plan