Jump to content

Khoách triển:TimedMediaHandler

From mediawiki.org
This page is atranslated versionof the pageExtension:TimedMediaHandlerand the translation is 51% complete.
Outdated translations are marked like this.
MediaWiki khoách triển thủ sách
TimedMediaHandler
Phát hành trạng thái:Ổn định bản
Thật hiện Môi thể,API
Miêu thuật Đề cung đối vu phục vụ khí đoan chuyển mã đích tập thành chi trì, WebM, OGG Theora, Vorbis, Speex ngữ âm dĩ cập phú thời văn bổn
Tác giả Michael Dale, Jan Gerber, Tim Starling, James Heinrich, Brooke Vibber, Derk-Jan Hartman
Tối tân bản bổn 0.6.0
Kiêm dung tính chính sách Khoái chiếu cân tùy MediaWiki phát bố. master phân chi bất hướng hậu kiêm dung.
MediaWiki >= 1.42
Sổ cư khố canh cải Thị
Biểu transcode
Hứa khả hiệp nghị GNU thông dụng công chúng thụ quyền điều khoản 2.0 hoặc canh tân bản bổn
Hạ tái
  • $wgMediaAudioTypes
  • $wgMediaVideoTypes
  • $wgWaitTimeForTranscodeReset
  • $wgTmhEnableMp4Uploads
  • $wgUseFFmpeg2
  • $wgEnableTranscode
  • $wgTranscodeSoftSizeLimit
  • $wgTmhPriorityResolutionThreshold
  • $wgFFmpegVP9RowMT
  • $wgEnableIframeEmbed
  • $wgParserTestMediaHandlers
  • $wgTranscodeBackgroundSizeLimit
  • $wgTranscodeBackgroundTimeLimit
  • $wgEnabledAudioTranscodeSet
  • $wgTmhSoundfontLocation
  • $wgEnabledTranscodeSet
  • $wgMinimumVideoPlayerSize
  • $wgFFmpegThreads
  • $wgTmhFluidsynthLocation
  • $wgTranscodeBackgroundMemoryLimit
  • $wgTmhFileExtensions
  • $wgFFmpegLocation
  • $wgTmhPriorityLengthThreshold
  • $wgTimedTextForeignNamespaces
  • $wgTimedTextNS
  • transcode-reset
  • transcode-status
Quý độ hạ tái lượng 215 (Ranked 29th)
Chính tại sử dụng đích công khai wiki sổ 1,290 (Ranked 218th)
Tiền vãng translatewiki.netPhiên dịch TimedMediaHandler khoách triển
Vấn đề Khai khải đích nhậm vụ·Báo cáo thác ngộ

TimedMediaHandlerKhoách triển duẫn hứa nâm sử dụng dữimageVăn kiện tương đồng đích ngữ pháp tại Wiki hiệt diện trung hiển kỳ âm tần hòa thị tần văn kiện. Tha bao quátVideoJS Player. Chi trì tự mạc hòa tự mạc ( hựu xưng định thời văn bổn ) dĩ cập tại đa cá WebM hòa kỳ tha phái sinh công cụ dĩ cập hứa đa kỳ tha công năng chi gian đích thật thời lưu thiết hoán. TMH phục vụ khí đoan chi trì bao quát dụng ô thượng truyện HTML5 âm tần hòa thị tần đích tuyển hạng, dụng ô truyện đệ nội dung đích đa cá chuyển mã phối trí văn kiện, MIDI văn kiện đích hồi phóng, dụng ô Ogg hòa WebM thị tần đích nguyên sổ cư giải tích, dĩ cập dữ MediaWiki đíchjobQueueHệ thống tập thành dĩ an bài chuyển mã tác nghiệp.

For new and upcoming developments in 2022 and beyond, seeExtension:TimedMediaHandler/2022 work.


Công năng dự lãm

For the player see:VideoJS Player.

Tra khánCommons:Timed TextHiệt diện.

Ngữ pháp giản giới

Tạiimage embed syntaxCơ sở thượng, Timed Media Handler chi trì:

[[File:Video.ogv]]
Dụng nguyên xích thốn hiển kỳ nhất cá thị tần. Hiển kỳ nhất cá tại thị tần trung điểm đề thủ đích tĩnh chỉ đồ tượng, hòa nhất cá dụng lai kích hoạt bá phóng khí đích bá phóng án nữu.
[[File:Audio.oga]]
Vi thanh âm văn kiện hiển kỳ nhất cá chiêm vị phù, bao hàm nhất cá dụng vu kích hoạt bá phóng khí đích bá phóng án nữu.The player will appear inline, or as a pop-up if the audio file has closed captioning/subtitles.
[[File:Midi.mid]]
Căn cư MIDI văn kiện trung đích âm nhạc chỉ lệnh sinh thành sổ tự âm tần, tịnh hiển kỳ khảm nhập thức âm tần bá phóng khí dĩ bá phóng thử âm tần.
[[File:Video.ogv|thumb]]
Tại nhất cá phù động đích súc lược đồ lí hiển kỳ thị tần.<gallery>File:Video.ogv</gallery>
Tại nhất cá đồ phiến khố ( image gallery ) lí khảm nhập thị tần ( mỗi nhất cá tiệt đồ đô hội đạn xuất nhất cá dụng vu hoàn chỉnh thị tần đích đối thoại khuông ).
[[File:Video.ogg|thumbtime=1:25]]
Dụng 1 phân 25 miểu đích nhất trinh họa diện sáp nhập thị tần tác vi chiêm vị đồ hình. Nhất cá đan độc đích sổ tự tương mặc nhận bị lý giải thành miểu sổ. Dã khả dĩ sử dụng HH:MM:SS, lệ như 1:02:22 tương thị thị tần đích 1 tiểu thời 2 phân 22 miểu.Floating-point seconds are supported (but broken on Wikimedia wikis:phab:T228467).
[[File:Video.ogg|start=1:25]]
Temporal media fragmentsdisplays 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 formend=1:30which 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.Dã khả dĩ sử dụng HH:MM:SS, lệ như 1:02:22 tương thị thị tần đích 1 tiểu thời 2 phân 22 miểu.
start=andend=can also be used asquery parametersin the URL for a video's file page.
[[File:Video.ogg|muted]]
Start the media with muted audio.( tại bản bổn 1.39 dẫn nhập )
[[File:Video.ogg|loop]]
Loop the video continuously.( tại bản bổn 1.39 dẫn nhập )
Khí dụng
Ngữ pháp tựnoiconHòanoplayerDĩ khí dụng, bất khởi tác dụng. Quan kiện tự disablecontrols khả năng hội bị khí dụng. ( thỉnh tham kiếnNhậm vụ  T135537) tha thải dụng dĩ hạ nhậm hà trị đích đậu hào phân cách liệt biểu:options,timedText,fullscreen


Khách hộ đoan chi trì

Kỳ lệ thị tần bá phóng khí
Kỳ lệ âm tần bá phóng khí

[[File:Videoonwikipedia.ogv|300px|thumb|...]]
[[File:example.ogg|thumb|...]]
[[File:example.ogg|30px]]
[[File:example.ogg]]

Giá cá bá phóng khí tại đại bộ phân hiện đại lưu lãm khí thượng năng cú công tác, chi trì IE9 cập canh cao bản bổn ( tạiMediaWiki's support matrixLí hữu quan vu hiện đại lưu lãm khí đích miêu thuật ). Di động đoan chi trì tình huống bất nhất, vưu kỳ thị tại iOS thượng.

TimedMediaHandler bao quát dụng ô Ogg âm tần / thị tần đíchJavaScript kiêm dung tính đại mã,Khả tại Safari, Internet Explorer 10/11 hòa Microsoft Edge lưu lãm khí trung sử dụng.

MediaWiki đích đệ tam phương dụng hộ khả năng hoàn hi vọng vi Safari / IE / Edge trung đích bổn địa thị tần hòa âm tần bá phóng thủ động khải dụng MP4 H.264 / AAC chi trì, đãn thị sử dụng giá ta cách thức thời, nâm khả năng nhu yếu MPEG-LA đích chuyên lợi hứa khả tài năng tiến hành hỗ liên võng quảng bá.

An trang

You will want a recent version offfmpegin order to support encoding to WebM (with the latest version of VP9).

  • Hạ táiVăn kiện, tịnh tương giải áp hậu đíchTimedMediaHandlerVăn kiện giáp di động đáoextensions/Mục lục trung.
    Khai phát giả hòa đại mã cống hiến nhân viên ứng tòngGitAn trang khoách triển, thâu nhập:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/TimedMediaHandler
  • Chỉ hữu tòng git an trang tài vận hànhComposerLai an trang PHP y lại, thông quá phát hànhcomposer install --no-devChí khoách triển mục lục.( tham kiếnCông đan T173141Liễu giải tiềm tại vấn đề. )
  • Tương hạ liệt đại mã phóng trí tại nâm đíchLocalSettings.phpĐích để bộ:
    wfLoadExtension('TimedMediaHandler');
    $wgFFmpegLocation='/usr/bin/ffmpeg';// Most common ffmpeg path on Linux
    
  • Vận hànhCanh tân cước bổn,Tha tương tự động sang kiến thử khoách triển tất tu y lại đích sổ cư khố biểu.
  • Configure as required.
  • You may need to increase the allowed memory in$wgMaxShellMemory.
  • YesHoàn thành– tại nâm đích wiki thượng đạo hàng chíSpecial:Version,Dĩ nghiệm chứng dĩ thành công an trang khoách triển.

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

Hạ tái thử khoách triển hậu, thỉnh chú ý, tha nhu yếuComposer.

Sở dĩ, tại tòng Git an trang chi hậu, thiết hoán đáo bao hàm cai khoách triển đích mục lục. Lệ như: "../extensions/TimedMediaHandler/" tịnh vận hànhcomposer install --no-dev,Hoặc tại canh tân thời:composer update --no-dev.

Hoặc giả tối hảo tương"extensions/TimedMediaHandler/composer.json"Thiêm gia đáo tại Wiki căn mục lục hạ đích "composer.local.json" văn kiện trung, lệ như:

{
"extra":{
"merge-plugin":{
"include":[
"extensions/TimedMediaHandler/composer.json"
]
}
}
}

Duy cơ bách khoa môi thể biên mã tuyển hạng đích bỉ giác

As of 2018, Wikimedia sites use VP9.

Sorted by bandwidth tier:

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

Tường tế tuyển hạng:

Danh xưng 160P 240P 360P 480P 720P 1080P 160P 240P 360P 480P 720P 1080P 1440P 2160P
Dung khí WebM
Thị tần Biên mã VP8 VP9
Tối đại khoan độ( tượng tố ) 288 426 640 854 1280 1920 288 426 640 854 1280 1920 2560 4096
Tối đại cao độ( tượng tố ) 160 240 360 480 720 1080 160 240 360 480 720 1080 1440 2160
Bỉ đặc suất (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
Âm tần Biên mã Vorbis Opus
Tần đạo 2 (stereo) (pass-through)
Thải dạng suất (Hz) 44100 48000
Phẩm chất - 1 2 3 - (default)

Phối trí

Bổn bộ phân dĩ quá thời - thỉnh canh tân ngã

Giá lí triển kỳ liễu nhất ta khả năng hữu dụng đích phối trí biến lượng:

// 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;

// 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 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;

// If you use ffmpeg 2 can be set it to true
$wgUseFFmpeg2=false;

Như quả nhu yếu chuyển mã, thỉnh xác nhận nhĩ đích$wgMaxShellMemory,$wgMaxShellTime,$wgMaxShellFileSizeTúc cú đại nhi bảo chứng chuyển mã công tác tiến hành tịnh bảo tồn thâu xuất. Mặc nhận trị ngận khả năng thái tiểu liễu.

Tiến hành chuyển mã công tác

Do vu chuyển mã công tác thị tư nguyên tập trung hình công tác, tha môn bất hội tái thường quy công tác đội liệt trung vận hành ( tra khánNhậm vụ  T29336). Tương phản, tha môn tất tu do $2 tham sổ thỉnh cầu: ConfigureLocalsettings.phpwith:

$wgJobTypesExcludedFromDefaultQueue[]='webVideoTranscode';
$wgJobTypesExcludedFromDefaultQueue[]='webVideoTranscodePrioritized';

Setup dedicatedjobrunnersand request running the jobs by the--typeargument:

php./maintenance/run.phprunJobs--typewebVideoTranscode
php./maintenance/run.phprunJobs--typewebVideoTranscodePrioritized

Is is very important to make sure to run these tasks as thewebserver user.

A single transcode job for a video can easily take an hour or longer, so ensure that the commands have enough time and CPU to run.

Biên mã tiết điểm

Vi liễu năng cú chuyển mã hứa đa thị tần, nhĩ khả năng tưởng yếu vận hành đa cá liên tiếp đáo chủ sổ cư khố tịnh thả trực tiếp phóng vấn nhĩ đích văn kiện đích biên mã tiết điểm. Nâm tương nhu yếu an trang ffmpeg.

Tại Debian hòa Ubuntu hạ đích tối tiểu an trang

aptinstallffmpeg

Plus, add this to yourLocalSettings.php(tested forDevuan ASCII(Archived2018-09-23 at theWayback Machine) only):

$wgFFmpegLocation='/usr/bin/ffmpeg';


Troubleshooting

Bổn bộ phân nhu yếu khoách triển

Please note that versions of TimedMediaHandler before MediaWiki 1.38 did not work with PostgreSQL.Tham kiếnCông đan T157424.

ffmpegfailed to map segment from shared object
You need to increase the allowed memory in$wgMaxShellMemory.
Class 'getID3' not found
You need to install the extension's PHP dependencies using Composer, see theinstallation section.
Unrecognized option 'max_muxing_queue_size'
You may be using ffmpeg 2.You need add$wgUseFFmpeg2=true;to yourLocalSettings.php.
Unrecognized option 'max_muxing_queue_size'
You may be using ffmpeg 2.You need add$wgUseFFmpeg2=true;to yourLocalSettings.php.
[exception] […] /index.php?title=Special:Upload Error: Call to undefined method FSFile::getLocalRefPath()
This extension isincompatiblewithKhoách triển: Khảm nhập thức thị tần.Uninstall it.You may also need to make sure you did thecomposersteps properly.