GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.mediawiki.org — Extension:TimedMediaHandler - MediaWiki
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 VideoJS Player. It has support for subtitles and captions (aka Timed Text), real-time stream switching between multiple WebM and other derivatives, and many other features. TMH server-side support includes options for uploading HTML5 audio and video, multiple transcode profiles to deliver content, playback of MIDI files, metadata parsing for Ogg and WebM videos, and integration with MediaWiki's job queue system for scheduling transcoding jobs. Feature overviewFor the player see: VideoJS Player. For features of the subtitling system, see Commons:Timed Text page. Syntax synopsisIn addition to the image embed syntax, Timed Media Handler supports:
Client support
[[File:Big Buck Bunny 4K.webm|300px|thumb|...]] [[File:example.ogg|thumb|...]] [[File:example.ogg|30px]] [[File:example.ogg]] The player works on most modern browsers, including mobile devices running Android or iOS 17.4 or higher (see MediaWiki's support matrix). For sites like Wikimedia that do not enable MP4 H.264/AAC output, TimedMediaHandler includes a fallback mode for pre-iOS 17.4 iPhones and iPads creating a low-resolution Motion-JPEG output specifically for old iPhones. This has to be enabled explicitly in configuration by setting: $wgEnabledTranscodeSet['144p.mjpeg.mov'] = true; Third-party users of MediaWiki may also wish to manually enable MP4 H.264/AAC support for full-size video playback in older devices, but when using these formats, you may need a patent license from MPEG-LA for internet broadcasting. InstallationYou will want a recent version of ffmpeg in order to support encoding to WebM (with the latest version of VP9).
The extension will automatically add supported file types (except for mp4) to $wgFileExtensions , so you do not need to add video file types manually. After downloading this extension, please note that it requires Composer .
So, after installation change to the directory containing the extension e.g., "../extensions/TimedMediaHandler/" and run Alternatively, as well as preferably, add the line { "extra": { "merge-plugin": { "include": [ "extensions/TimedMediaHandler/composer.json" ] } } } Comparison of Wikipedia media encoding optionsAs of 2018, Wikimedia sites use VP9. Sorted by bandwidth tier:
Detailed options:
Configuration
This section is out of date -- please update me
Here are some configuration variables that may be useful: // The minimum size for an embedded video player (smaller than this size uses a pop-up player). $wgMinimumVideoPlayerSize = 200; // If transcoding is enabled for this wiki (if disabled, no transcode jobs are added, and no transcode status is displayed). // Note: if remote embedding an asset, we will still check if the remote repo has transcoding enabled and associated flavors for that media embed. $wgEnableTranscode = true; // Exclude transcoding jobs from the default job runner because they take very long to complete $wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscode'; $wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscodePrioritized'; // The total amount of time a transcoding shell command can take: $wgTranscodeBackgroundTimeLimit = 3600 * 8; // Maximum amount of virtual memory available to transcoding processes in KB $wgTranscodeBackgroundMemoryLimit = 2 * 1024 * 1024; // 2GB avconv, ffmpeg2theora mmap resources so virtual memory needs to be high enough // Maximum file size transcoding processes can create, in KB $wgTranscodeBackgroundSizeLimit = 3 * 1024 * 1024; // 3GB // Number of threads to use in avconv for transcoding $wgFFmpegThreads = 1; // The NS for TimedText (registered on MediaWiki.org) // https://www.mediawiki.org/wiki/Extension_namespace_registration // Note commons pre-dates TimedMediaHandler and should set $wgTimedTextNS = 102 in LocalSettings.php $wgTimedTextNS = 710; // Set TimedText namespace for ForeignDBViaLBRepo on a per wikiID basis // $wgTimedTextForeignNamespaces = [ 'commonswiki' => 102 ]; $wgTimedTextForeignNamespaces = []; /** * Default enabled transcodes * * -If set to empty array, no derivatives will be created * -Derivative keys encode settings are defined in WebVideoTranscode.php * * -These transcodes are *in addition to* the source file. * -Only derivatives with a smaller width than the source asset size will be created * -Regardless of source size, at least one WebM and Ogg source will be created from the $wgEnabledTranscodeSet * -Derivative jobs are added to the MediaWiki JobQueue the first time the asset is uploaded * -Derivative should be listed min to max */ // Starting from 1.31 // All valid string values are listed in the extension's extension.json file $wgEnabledTranscodeSet = [ '160p.webm' => true, '240p.webm' => true, '360p.webm' => true, '480p.webm' => true, '720p.webm' => true, '1080p.webm' => true, ]; $wgEnabledAudioTranscodeSet = [ 'ogg' => true, // ogg+vorbis 'opus' => false, // ogg+opus 'mp3' => true, // raw mp3 'm4a' => false, // mp4+aac (mp4a.40.5) ]; // If mp3 source assets can be ingested: $wgTmhEnableMp3Uploads = true; // If mp4 source assets can be ingested: $wgTmhEnableMp4Uploads = false; For transcoding, make sure you have Running transcode jobsBecause transcode jobs are resource intensive, they should not run as part of the normal job queue (see TT29336).
Configure $wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscode'; $wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscodePrioritized'; Setup dedicated jobrunners and request running the jobs by the php ./maintenance/run.php runJobs --type webVideoTranscode php ./maintenance/run.php runJobs --type webVideoTranscodePrioritized It is very important to run these tasks as the webserver user. A single transcode job for a video can easily take an hour or longer, so ensure the commands have enough time and CPU to run. Encoding nodesTo transcode many videos, you might want to run multiple encoding nodes that connect to the master database and access your file store directly. You will need to install ffmpeg. Minimal install under Debian and Ubuntuapt install ffmpeg Plus, add this to your LocalSettings.php (tested for Devuan ASCII (Archived 2018-09-23 at the Wayback Machine) only): $wgFFmpegLocation = '/usr/bin/ffmpeg'; Shellbox isolationFor security reasons, ffmpeg runs in an isolated container using Shellbox at Wikimedia.
You will need their docker image if you want to emulate the Wikimedia setup, including their Debian version, dependencies, etc.
Use You can also create your custom docker image, of course. $ docker pull docker-registry.wikimedia.org/wikimedia/mediawiki-libs-shellbox:video TroubleshootingThis section needs expansion
Please note that versions of TimedMediaHandler before MediaWiki 1.38 did not work with PostgreSQL. See T157424.
See also
Categories:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||