Extensión:TimedMediaHandler

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:TimedMediaHandler and the translation is 47% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎Frysk • ‎Nederlands • ‎català • ‎dansk • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎suomi • ‎русский • ‎中文 • ‎日本語 • ‎한국어
MediaWiki extensions manual
Crystal Clear action run.svg
TimedMediaHandler
Release status: estable
Screenshot of TimedMediaHandler extension with Big Buck Bunny as background video.png
Implementación Media, API
Descripción Compatibilidad integrada con transcodificación desde el servidor, WebM, Ogg Theora, Vorbis, Speex y texto temporizado
Autor(es) Michael Dale, Jan Gerber, Tim Starling, James Heinrich, Brion Vibber, Derk-Jan Hartman
Latest version 0.5.0 (2015-12-08)
Política de compatibilidad release branches
MediaWiki 1.29+
PHP 5.6+
Cambios de la base de datos
Licencia GNU General Public License 2.0 or later
Descarga
Derechos añadidos
transcode-reset, transcode-status
Hooks que usa
ArticleFromTitle
UploadComplete
TitleMove
FileDeleteComplete
BeforePageDisplay
ImageOpenShowImageInlineBefore
ImagePageFileHistoryLine
LoadExtensionSchemaUpdates
UnitTestsList
ArticleContentOnDiff
ImagePageAfterImageLinks
NewRevisionFromEditComplete
ArticlePurge
wgQueryPages
RejectParserCacheValue
Translate the TimedMediaHandler extension if it is available at translatewiki.net
Verificar uso y versión de la matriz.
Asuntos Tareas abiertas · Reportar un bug
Version 1.31 was a breaking change. The extension now requires wfLoadExtension and the WebVideoTranscode PHP constants are now expressed as string values instead

La extensión TimedMediaHandler permite mostrar archivos de audio y vídeo en las páginas de un wiki mediante la misma sintaxis que se usa para añadir imágenes. Incluye el reproductor HTML5 Kaltura y un reproductor VideoJS experimental. Admite subtítulos y leyendas (también conocido como texto cronometrado), conmutación en tiempo real del formato de transmisión (entre WebM y Ogg), entre muchas otras funcionalidades. Las funciones por parte del servidor ofrecidas por TMH incluyen la subida de audio y vídeo de HTML5, varios perfiles de transcodificación para transmitir el contenido, análisis sintáctico de metadatos para archivos Ogg y WebM, y la integración con el sistema de cola de trabajo de MediaWiki para programar tareas de transcodificación.

Resumen de funcionalidades

Sinopsis de sintaxis

Además de la sintaxis de incrustación de imágenes, Timed Media Handler admite:

[[File:Video.ogv|File:Video.ogv]]
Mostrar un vídeo en su dimensión nominal. Muestra un fotograma del punto medio de su longitud con un botón de reproducción que ejecuta un reproductor incrustado.
[[File:Audio.oga|File:Audio.oga]]
Mostrar un marcador de posición para un archivo de sonido, con un botón de reproducción que ejecuta un reproductor incrustado.
[[File:Video.ogv|thumb]]
Mostrar un vídeo en un cuadro de miniatura flotante
<gallery>File:Video.ogv</gallery>
Mostrar un vídeo incrustado en una galería de imágenes (al pulsar en un clip se creará un cuadro emergente con el reproductor completo)
[[File:Video.ogg|thumbtime=1:25]]
Utilizar un fotograma correspondiente a 1 minuto y 25 segundos como la imagen del marcador de posición. Un número entero se toma como la cantidad de desfase en segundos.
[[File:Video.ogg|start=1:25]]
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 end=1:30 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.
Deprecated
The syntax words noicon and noplayer are deprecated and do not function. The keyword disablecontrols will likely be deprecated soon. It takes the following values: options, timedText, fullscreen

Compatibilidad con clientes

Example video player
Example audio player
Wider audio player, showing progress bar

The player works on most modern browsers and supports IE9 and later (The modern browsers as described in MediaWiki's support matrix). Mobile support is spotty, especially on iOS.

As of August 2015, TimedMediaHandler includes a JavaScript compatibility shim for Ogg audio/video that works in Safari, Internet Explorer 10/11, and Microsoft Edge browsers.

Third-party users of MediaWiki may also wish to manually enable MP4 H.264/AAC support for native video and audio playback in Safari/IE/Edge, but when using these formats you may need a patent license from MPEG-LA for internet broadcasting.

Instalación

Also see the README for detailed install instructions. Note that, although MwEmbedSupport was included in TimedMediaHandler for MediaWiki 1.31 and later, for MediaWiki versions prior to that you will need to download it from the archive page.

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


  • Descarga y extrae los archivos en el directorio «TimedMediaHandler» dentro del directorio extensions/ existente.
  • Añade el siguiente código a tu LocalSettings.php (preferiblemente al final):
    // TimedMediaHandler depended on MwEmbedSupport until 1.30
    // MediaWiki 1.27 and earlier
    require_once "$IP/extensions/MwEmbedSupport/MwEmbedSupport.php";
    require_once "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php";
    
    // MediaWiki 1.27 to MediaWiki 1.30
    wfLoadExtension( 'MwEmbedSupport' );
    require_once "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php";
    
    // MediaWiki 1.31 and later
    wfLoadExtension( 'TimedMediaHandler' );
    
  • Ejecuta el script de actualización, que creará automáticamente las tablas que necesita esta extensión en la base de datos.
  • Configure as required.
  • Yes Listo – Navega a Special:Version en tu wiki para verificar que la apariencia se haya instalado correctamente.

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

When installing from Git, please note that this extension requires Composer.

So, after installation from Git change to the directory containing the extension e.g. "../extensions/TimedMediaHandler/" and run composer install --no-dev, or when updating: composer update --no-dev.

Alternatively as well as preferably add the line "extensions/TimedMediaHandler/composer.json" to the "composer.local.json" file in the root directory of your wiki like e.g.
{
	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/TimedMediaHandler/composer.json"
			]
		}
	}
}

Comparación de opciones de codificación de archivos multimedia en Wikipedia

See /VP9 transition for deployment details on planned Wikimedia update from VP8 to VP9.

Sorted by bandwidth tier (grayed items are not currently enabled):

Bitrate Mbit/s WebM VP8 WebM VP9
Super Low 0.08 160p
Very Low 0.16 160p 240p
Low 0.25 240p 360p
Moderate 0.5 360p 480p
Medium 1.0 480p 720p
High 2.0 720p 1080p
Very high 4.0 1080p 1440p
Super high 8.0 2160p

Detailed options:

Nombre 160P 240P 360P 480P 720P 1080P 160P 240P 360P 480P 720P 1080P 1440P 2160P
Contenedor WebM
Vídeo Codificación VP8 VP9
Anchura máxima (píxeles) 288 426 640 854 1280 1920 288 426 640 854 1280 1920 2560 4096
Altura máxima (píxeles) 160 240 360 480 720 1080 160 240 360 480 720 1080 1440 2160
Tasa de bits (Mbit/s) 0.16 0.25 0.5 1.0 2.0 4.0 0.08 0.16 0.25 0.5 1.0 2.0 4.0 8.0
Audio Codificación Vorbis Opus
Canales 2 (stereo) (pass-through)
Frecuencia de muestreo (Hz) 44100 48000
Calidad - 1 2 3 - (default)

Configuración

This section is out of date -- please update me

Here are some configuration variables which may be useful:

// The minimum size for an embed 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;

// The total amout 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 = array( 'commonswiki' => 102 );
$wgTimedTextForeignNamespaces = array();

/**
* 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 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 = [
    'vorbis' => true,
    'mp3' => true,
];

// Before 1.31
$wgEnabledTranscodeSet = [
    WebVideoTranscode::ENC_WEBM_160P,
    WebVideoTranscode::ENC_WEBM_240P,
    WebVideoTranscode::ENC_WEBM_360P,
    WebVideoTranscode::ENC_WEBM_480P,
    WebVideoTranscode::ENC_WEBM_720P,
    WebVideoTranscode::ENC_WEBM_1080P
];

$wgEnabledAudioTranscodeSet = [
    WebVideoTranscode::ENC_OGG_VORBIS,
    WebVideoTranscode::ENC_MP3,
];

// If mp3 source assets can be ingested:
$wgTmhEnableMp3Uploads = true;

// If mp4 source assets can be ingested:
$wgTmhEnableMp4Uploads = false;

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.

Ejecución de tareas de transcodificación

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

php maintenance/runJobs.php --type webVideoTranscode

If running this command causes it to hang forever, you may need to set $wgTranscodeBackgroundTimeLimit = 0; in LocalSettings.php. See task T206957.

Nodos de codificación

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. You will need to install ffmpeg.

Instalación mínima en Ubuntu 12.04

apt-get install ffmpeg