HTML5 video & MediaWiki

From HTML5 Video
Jump to: navigation, search
Need help in 2.5, 2.6, 2.8! Thanks


I propose to present in this paper detailed instructions of integration HTML5 video in to MediaWiki 1.18.x on CentOS 6.2.

Contents


Example

Timed Media Handler Embeds

Gallery Embeds

Detailed install instructions

Configuration of CentOS 6.2

# yum update
# yum install nasm
# yum install gcc gcc-c++
# yum install automake autoconf libtool subversion zlib-devel

GIT

# yum install git

Add repositories

The remaining packages available in repositories for CentOS, but are available for Red Hat. We need can be found тут. Add repositories:

# rpm -Uhv http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

And install this%

# yum install SDL-devel a52dec a52dec-devel alsa-lib-devel faac faac-devel faad2 faad2-devel
# yum install freetype-devel giflib gsm gsm-devel imlib2 imlib2-devel 
# yum install lame lame-devel libICE-devel libSM-devel libX11-devel
# yum install libXau-devel libXdmcp-devel libXext-devel libXrandr-devel libXrender-devel libXt-devel
# yum install libid3tag libogg-devel libvorbis-devel mesa-libGL-devel mesa-libGLU-devel 
# yum install xorg-x11-proto-devel xvidcore xvidcore-devel zlib-devel
# yum install amrnb-devel amrwb-devel
# yum install libtheora libtheora-devel
# yum install glibc gcc gcc-c++ autoconf automake libtool
# yum install subversion
# yum install ncurses-devel
# yum install libdc1394 libdc1394-devel
# yum install yasm nasm
# yum install opencore-amr opencore-amr-devel

OGG

libogg-devel.i686 : Files needed for development using libogg
libogg-devel.x86_64 : Files needed for development using libogg
libogg-devel-docs.noarch : Documentation for developing Ogg applications
# yum install libogg libogg-devel

oggz tools

# yum install liboggz oggz-utils liboggz-devel
liboggz-devel.x86_64 : Header files, libraries and development documentation for liboggz.
liboggz-doc.x86_64 : Documentation for liboggz
liboggz-docs.noarch : Documentation for liboggz
oggz-utils.x86_64 : Utilities included with the liboggz library
liboggz.x86_64 : Simple programming interface for Ogg files and streams

wxPython

wxPython-devel.x86_64 : Development files for wxPython add-on modules
wxPython.x86_64 : GUI toolkit for the Python programming language
# yum install  wxPython  wxPython-devel

Vorbis General Audio Compression Codec

libvorbis.i686 : The Vorbis General Audio Compression Codec.
libvorbis.x86_64 : The Vorbis General Audio Compression Codec.
libvorbis-devel.i686 : Development tools for Vorbis applications.
libvorbis-devel.x86_64 : Development tools for Vorbis applications.
libvorbis-devel-docs.noarch : Documentation for developing Vorbis applications
python-vorbis.x86_64 : Python bindings for libvorbis
vorbis-tools.x86_64 : The Vorbis General Audio Compression Codec tools
vorbisgain.x86_64 : Lossless volume-adjusting utility for Ogg Vorbis files
perl-Apache-MP3.noarch : Perl module to generate streamable directories of MP3 and Ogg Vorbis files
tagtool.x86_64 : Manage the information fields in MP3 and Ogg Vorbis files
# yum install libvorbis libvorbis-devel vorbis-tools vorbisgain perl-Apache-MP3 tagtool

Doxygen

doxygen.x86_64 : A documentation system for C/C++
doxygen-doxywizard.x86_64 : A GUI for creating and editing configuration files
# yum install doxygen doxygen-doxywizard


SDL - Simple Direct media Layer

We need libraries и headers

SDL_Pango.x86_64 : Rendering of internationalized text for SDL (Simple DirectMedia Layer)
SDL_Pango-devel.x86_64 : Header files, libraries and development documentation for SDL_Pango.
SDL_gfx-devel.x86_64 : Header files, libraries and development documentation for SDL_gfx
SDL_image.x86_64 : Load images as SDL surfaces
SDL_image-devel.x86_64 : Header files, libraries and development documentation for SDL_image
SDL_mixer-devel.x86_64 : Header files, libraries and development documentation for SDL_mixer.
SDL_net-devel.x86_64 : Header files, libraries and development documentation for SDL_net.
SDL_ttf-devel.x86_64 : Header files, libraries and development documentation for SDL_ttf
SDL.i686 : A cross-platform multimedia library
SDL.x86_64 : A cross-platform multimedia library
SDL-devel.i686 : Files needed to develop Simple DirectMedia Layer applications
SDL-devel.x86_64 : Files needed to develop Simple DirectMedia Layer applications
SDL-static.x86_64 : Files needed to develop static Simple DirectMedia Layer applications
SDL_gfx.x86_64 : Graphic primitives, rotozoomer, framerate control and image filters
SDL_mixer.x86_64 : Simple multi-channel audio mixer
SDL_net.x86_64 : Cross-platform network API
SDL_ttf.x86_64 : Simple DirectMedia Layer - Sample TrueType Font Library
# yum install SDL SDL-devel 
glib-devel.x86_64 : The GIMP ToolKit (GTK+) and GIMP Drawing Kit (GDK) support library

# yum install glib-devel
gtkhtml2.i686 : An HTML widget for GTK+ 2.0
gtkhtml2.x86_64 : An HTML widget for GTK+ 2.0

# yum install smpeg smpeg-devel
# yum install SDL_ttf SDL-static SDL_Pango SDL_Pango-devel 
# yum install SDL_gfx-devel SDL_image SDL_image-devel 
# yum install SDL_mixer-devel SDL_net-devel SDL_ttf-devel 
# yum install SDL_gfx SDL_mixer SDL_net perl-SDL

Open Sound System

We need OSS audio driver and development headers. I don't install this. On CentOS this package is installed by default.

Theora Video Compression Codec

In README of libtheora says that we need:

  1. OGG
  2. Vorbis General Audio Compression Codec
  3. Doxygen
  4. SDL - Simple Direct media Layer
  5. Open Sound System
libtheora.i686 : Theora Video Compression Codec
libtheora.x86_64 : Theora Video Compression Codec
libtheora-devel.i686 : Development tools for Theora applications
libtheora-devel.x86_64 : Development tools for Theora applications
libtheora-devel-docs.noarch : Documentation for developing Theora applications
# yum install libtheora libtheora-devel libtheora-devel-docs

SCons

SCons need for installation ffmpeg2theora.

 # yum install scons

libkate

libkate-devel.x86_64 : Development files for libkate
libkate-docs.x86_64 : Documentation for libkate
libkate-docs.noarch : Documentation for libkate
libkate-utils.x86_64 : Encoder/Decoder utilities for libkate
kate-utils.x86_64 : Encoder/Decoder utilities for libkate
libkate.x86_64 : Libraries to handle the Kate bitstream format
# yum install libkate libkate-utils libkate-devel kate-utils libkate-docs

Installing extensions

Download this two extensions:

  1. Extension:TimedMediaHandler
  2. Extension:MwEmbedSupport

Then add the following to the end of your LocalSettings.php:

# TimedMediaHandler is dependent on mwEmbedSupport
 require( "$IP/extensions/MwEmbedSupport/MwEmbedSupport.php" );
 
 # TimedMediaHandler
 require( "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php" );
 
 # For boxes doing transcoding you should increase the allocated shell memory:
 $wgMaxShellMemory = 102400*64;

Running Transcodes

To transcode the video you need to run webVideoTranscode jobs. So, in

/extensions/TimedMediaHandler/maintenance/

you can find WebVideoJobRunner.php. If you want to have a job runner that checks for new jobs every 5 min, run:

WebVideoJobRunner.php

Installing FFmpeg and FFmpeg2Theora

Based on adding repositories. Add:

# nano /etc/yum.repos.d/linuxtech.repo

With text:

[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET

Save file and update:

# yum update

Instaling FFmpeg:

# yum install ffmpeg ffmpeg-devel ffmpeg-spice-devel gstreamer-ffmpeg ffmpeg-spice-libs 

Installing FFmpeg2Theora:

# yum install ffmpeg2theora

And to confirm what all is doing the right thing

# yum update

Result:

Setting up Update Process
No Packages marked for Update

At this stage, Hurray!

Now we must show our wiki, where the binary of ffmpeg and ffmpeg2theora.

# whereis ffmpeg

Response:

ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

In our LocalSettings.php add after extentions TimedMediaHandler and MwEmbedSupport

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

Similarly, for ffmpeg2theora:

# whereis ffmpeg2theora
ffmpeg2theora: /usr/bin/ffmpeg2theora /usr/share/man/man1/ffmpeg2theora.1.gz

And add in LocalSettings.php

$wgFFmpeg2theoraLocation = '/usr/bin/ffmpeg2theora';

At this stage nothing will not work until we run the update script in your wiki. So:

# cd /var/www/html/имя_вашей_вики/maintenance/
# php update.php

And the long-awaited moment .... player is running, you can upload files ogg, ogv, oga, webm and wiki plays them.

Kaltura html5 player library

Cortado

PEAR File_Ogg

[1] Here we can find and:

# php pyrus.phar install pear/File_Ogg-0.3.1

getID3

Errors