Extension:TimedMediaHandler/ru

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

Outdated translations are marked like this.
Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎Frysk • ‎italiano • ‎日本語 • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎sicilianu • ‎中文
Справка по расширениям MediaWikiManual:Extensions
Crystal Clear action run.svg
TimedMediaHandler

Статус релиза:Extension status стабильный

Screenshot of TimedMediaHandler extension with Big Buck Bunny as background video.png
РеализацияTemplate:Extension#type Media, API
ОписаниеTemplate:Extension#description Provides integrated support for server side transcoding, WebM, Ogg Theora, Vorbis, MP3, Speex and Timed Text
Автор(ы)Template:Extension#username Michael Dale, Jan Gerber, Tim Starling, James Heinrich, Brion Vibber, Derk-Jan Hartman
Последняя версияTemplate:Extension#version 0.5.0 (2015-12-08)
Политика совместимостиCompatibility#mediawiki_extensions ветвь релиза
MediaWikiTemplate:Extension#mediawiki 1.23+
PHPTemplate:Extension#php 5.4+
Изменения БДTemplate:Extension#needs-updatephp Да
ЛицензияTemplate:Extension#license GNU General Public License 2.0 or later
Загрузка
Использованные hook'иTemplate:Extension#hook
ArticleFromTitleManual:Hooks/ArticleFromTitle
UploadCompleteManual:Hooks/UploadComplete
TitleMoveManual:Hooks/TitleMove
FileDeleteCompleteManual:Hooks/FileDeleteComplete
BeforePageDisplayManual:Hooks/BeforePageDisplay
ImageOpenShowImageInlineBeforeManual:Hooks/ImageOpenShowImageInlineBefore
ImagePageFileHistoryLineManual:Hooks/ImagePageFileHistoryLine
LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates
UnitTestsListManual:Hooks/UnitTestsList
ArticleContentOnDiffManual:Hooks/ArticleContentOnDiff
ImagePageAfterImageLinksManual:Hooks/ImagePageAfterImageLinks
NewRevisionFromEditCompleteManual:Hooks/NewRevisionFromEditComplete
ArticlePurgeManual:Hooks/ArticlePurge
wgQueryPagesManual:Hooks/wgQueryPages
RejectParserCacheValueManual:Hooks/RejectParserCacheValue

Переведите расширение TimedMediaHandler если оно доступно на translatewiki.net

Проверьте использование и версию.

ПроблемыPhabricator

Открытые задачи · Сообщить об ошибке

Расширение TimedMediaHandler позволяет отображать аудио и видео файлов на страницах Вики, используя тот же синтаксис, что и для файлов изображений. Он включает HTML5 плеер Kaltura и экспериментальных VideoJS плеер. Есть поддержка субтитров и титров (подобно Синхронизированному тексту) и в реальном времени переключаться между несколькими WebM и OGG производными и многие другие функции. ТМХ поддержка на стороне сервера включает в себя опции для загрузки аудио и видео HTML5, несколько профилей транскодирования для доставки Контента, Medata парсинг OGG и WebM видео и интегрируется с системой jobQueue mediawiki для планирования задания

Обзор функций

See Commons:Commons:TimedText page.

Syntax synopsis

В дополнение к image embed syntax, Timed Media Handler поддерживает:

[[File:Video.ogv|File:Video.ogv]]
Отображать видео в его номинальном размере. Отображает неподвижное изображение из середины, с кнопкой воспроизведения, чтобы начать воспроизведение во встроенном плеере.
[[File:Audio.oga|File:Audio.oga]]
Показать заполнитель для звуковых файлов, с кнопкой воспроизведения, чтобы начать воспроизведение во встроенном плеере.
[[File:Video.ogv|thumb]]
Показать видео в плавающем окне в миниатюре
<gallery>File:Video.ogv</gallery>
Показать видео встроенным в галерею изображений (каждый клип будет представлен в виде всплывающего диалогового окна полноразмерного плеера)
[[File:Video.ogg|thumbtime=1:25]]
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.
[[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.
Устаревшие
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

Client support

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

Плеер работает на большинстве современных браузеров и поддерживает IE9 и позже (в современных браузерах, как описано в таблице поддержки mediawiki). Поддержка всех мобильных устройств, особенно на iOS

С августа 2015 года, TimedMediaHandler включает в себя и javascript совместимости ШИМ для OGG аудио/видео, которая работает в Opera, Интернет Explorer 10/11 и браузеров Microsoft Edge.

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.

Установка

Also see the README 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). j^ supplies up-to-date static builds of ffmpeg with WebM support for major OSs at firefogg.org/nightly/


  • Скачайте и распакуйте файл(ы) в папку с названием TimedMediaHandler в вашу папку extensions/.
  • Добавьте следующий код в файл LocalSettings.php (в самый конец):
    // TimedMediaHandler is dependent on mwEmbedSupport
    // MediaWiki 1.27 or earlier
    require_once "$IP/extensions/MwEmbedSupport/MwEmbedSupport.php";
    // After MediaWiki 1.27
    wfLoadExtension( 'MwEmbedSupport' );
    // TimedMediaHandler
    require_once "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php";
    
  • Выполните скрипт обновления структуры БД, который автоматически создаст необходимые таблицы, используемые расширением.
  • Configure as required.
  • YesY Готово - Перейдите на страницу «Special:Version» на своём сайте, чтобы удостовериться в том, что расширение успешно установлено.


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

Comparison of Wikipedia media encoding options

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:

Name 160P 240P 360P 480P 720P 1080P 160P 240P 360P 480P 720P 1080P 1440P 2160P
Container WebM
Video Encoding VP8 VP9
Max width (pixels) 288 426 640 854 1280 1920 288 426 640 854 1280 1920 2560 4096
Max height (pixels) 160 240 360 480 720 1080 160 240 360 480 720 1080 1440 2160
Bitrate (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 Encoding Vorbis Opus
Channels 2 (stereo) (pass-through)
Sampling rate (Hz) 44100 48000
Quality - 1 2 3 - (default)

Configuration

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
 */
$wgEnabledTranscodeSet = array(
    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 = array(
    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.

Running transcode jobs

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


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

Minimal install under Ubuntu 16.04

apt-get install ffmpeg


Road Map

  • Add support for transcoding from arbitrary format uploads.
  • 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 8k videos
  • Upgrade to 2.x branch. (On hold. Planning on switching to video.js.)
  • Change Kaltura player to Video.js as our main video player.
  • Consistent mobile support
  • MPEG-DASH adaptive streaming
  • "GIF mode" for autoplay silent videos
  • MIDI input support
  • Better internal interface for connecting to Score, other extensions

Примечания

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)


August 2015 update

Brion and TheDJ are starting up some new maintenance on TImedMediaHandler:

Done:

  • fixed some regressions in transcode handling
  • added /ogv.js JavaScript compatibility shim for Safari 6.1+, IE 10/11, and Edge
  • increasing Ogg transcode quality (increased bandwidth)
  • support subtitles in ogv.js
  • finish killing broken Cortado Java compatibility shim
  • retooling TMH's ResourceLoader modules for better compatibility
  • fix ogv.js issues
    • missing volume control

Todo 'small':

  • fix more transcode issues

Todo 'medium':

  • get transcoding from VP9/Opus working on Wikimedia servers...
  • transcoding to VP9/Opus WebM with decreased bandwidth
  • add Ogg skeleton to ogg audio transcodes for better seeking
  • integrate lightweight video player into Extension:MobileFrontend
  • rework serving Timed Text

Todo 'large':

Todo 'long-term':

  • get VP9 working fast enough on ogv.js to replace Ogg Theora transcodes