Catégories
Open-source Video

Compiler la dernière version de X.264 sous Ubuntu

Si vous avez besoin de la toute dernière version de X.264, l’encodeur libre H.264 du groupe de travail VideoLAN, voici une procédure « out-of-the-box ».

On commence par supprimer la version système si celle-ci existe, puis a installer quelques pré-requis:

[shell]
sudo aptitude purge gpac x264 libx264-dev
sudo apt-get install build-essential zlib1g-dev libglut-dev checkinstall
[/shell]

On compile GPAc (qui permet de gérer les fichiers au format .mp4):

[shell]
cd
wget http://superb-east.dl.sourceforge.net/sourceforge/gpac/gpac-0.4.5.tar.gz
wget http://voxel.dl.sourceforge.net/sourceforge/gpac/gpac_extra_libs-0.4.5.tar.gz

tar -zxf gpac-0.4.5.tar.gz
tar -zxf gpac_extra_libs-0.4.5.tar.gz
cd gpac_extra_libs
cp -r * ../gpac/extra_lib
cd ../gpac
chmod +x configure
./configure –disable-opengl –use-js=no –use-ft=no –use-jpeg=no –use-png=no –use-faad=no –use-mad=no –use-xvid=no –use-ffmpeg=no –use-ogg=no –use-vorbis=no –use-theora=no –use-openjpeg=no
make lib
make apps
sudo make install-lib
sudo make install
sudo rm -f /usr/lib/libgpac.so
sudo cp bin/gcc/libgpac.so /usr/lib
[/shell]

Puis on installe la dernière version (GIT) de X.264:

[shell]

cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall –pkgname=x264 –pkgversion "1:0.svn`date +%Y%m%d`+`git rev-list HEAD -n 1 | head -c 7`" –backup=no –default
[/shell]

On teste pour voir si la version est bonne (release 1523 au moment de l’écriture de ce billet):

[shell]

x264 –help
x264 core:92 r1523 25ca5b0
Syntax: x264 [options] -o outfile infile [widthxheight]

[/shell]

Sources:

Catégories
Gstreamer Open-source Systeme

Compiler GStreamer depuis les sources sous GNU/Linux

Edit: j’ai ajouté un script SHELL « qui fait tout pour vous » en fin de billet…

Voici une petite procédure pour compiler la dernière version du framework multimédia GStreamer tout en préservant la version installée depuis les dépôts officiels. La procédure a été validé sur une GNU/Linux Ubuntu 9.04 mais doit facilement être adaptable à d’autres distribution (pour une procèdure équivalente sous Mac OS X, vous pouvez lire ce billet).

GStreamer étant un framework, il se base sur de nombreuses librairies externes. Pour nous simplifier la tache, nous allons utiliser les dépôts pour l’installation de ces librairies:

sudo aptitude build-dep gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse bison flex git

Ensuite on récupère les dernières versions disponibles de GStreamer et de ses plugins:

mkdir ~/src
cd ~/src
wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.10.25.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-0.10.25.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-0.10.17.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-0.10.17.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-0.10.13.tar.gz
wget http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.10.8.tar.gz

On commence par la compilation de GStreamer (core). L’installation se fera dans le répertoire /opt/gstreamer/gstreamer-0.10.24:

tar zxvf gstreamer-0.10.25.tar.gz
cd gstreamer-0.10.25
./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

… puis les plugins « base »:

tar zxvf gst-plugins-base-0.10.25.tar.gz
cd gst-plugins-base-0.10.25
PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-0.10.25/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

… puis les plugins « good »:

tar zxvf gst-plugins-good-0.10.17.tar.gz
cd gst-plugins-good-0.10.17
PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-0.10.25/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

… puis les plugins « bad »:

tar zxvf gst-plugins-bad-0.10.17.tar.gz
cd gst-plugins-bad-0.10.17
PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-0.10.25/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

… les plugins « ugly »:

tar zxvf gst-plugins-ugly-0.10.13.tar.gz
cd gst-plugins-ugly-0.10.13
PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-0.10.25/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

… et enfin les plugins FFMPEG (streaming):

tar zxvf gst-ffmpeg-0.10.8.tar.gz
cd gst-ffmpeg-0.10.8
PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-0.10.25/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-0.10.25
make
sudo make install
cd ..

Puis on créé un lien symbolique entre le répertoire /opt/gstreamer/current et /opt/gstreamer/gstreamer-0.10.25. Ce lien nous permet d’avoir plusieur version de GStreamer sur notre système.

sudo cp /opt/gstreamer/gstreamer-0.10.25/lib/gstreamer-0.10.25/* /opt/gstreamer/gstreamer-0.10.25/lib/

sudo ln -s /opt/gstreamer/gstreamer-0.10.25/lib /opt/gstreamer/current

On teste enfin l’installation:

/opt/gstreamer/gstreamer-0.10.25/bin/gst-inspect –gst-plugin-path=/opt/gstreamer/current

Pour les plus faineant, voici un script sheel automatisant ces quelques taches

[shell]
#!/bin/sh

# A simple script to get/compile/install GStreamer

# Nicolas Hennion – GPL

#

# Remarks: the version will be installed in the /opt/gstreamer folder

# Change this to the latest version

GST_CORE=0.10.25

GST_BASE=0.10.25

GST_GOOD=0.10.17

GST_BAD=0.10.17

GST_UGLY=0.10.13

GST_FFMPEG=0.10.8

# Do not edit under this line

sudo aptitude build-dep gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse

sudo aptitude install bison flex git

if [ ! -e gstreamer-$GST_CORE.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$GST_CORE.tar.gz

fi

if [ ! -e gst-plugins-base-$GST_BASE.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$GST_BASE.tar.gz

fi

if [ ! -e gst-plugins-good-$GST_GOOD.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-$GST_GOOD.tar.gz

fi

if [ ! -e gst-plugins-bad-$GST_BAD.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$GST_BAD.tar.gz

fi

if [ ! -e gst-plugins-ugly-$GST_UGLY.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-$GST_UGLY.tar.gz

fi

if [ ! -e gst-ffmpeg-$GST_FFMPEG.tar.gz ]

then

wget http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-$GST_FFMPEG.tar.gz

fi

sudo mkdir /opt/gstreamer

if [ ! -e gstreamer-$GST_CORE ]

then

tar zxvf gstreamer-$GST_CORE.tar.gz

cd gstreamer-$GST_CORE

./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

if [ ! -e gst-plugins-base-$GST_BASE ]

then

tar zxvf gst-plugins-base-$GST_BASE.tar.gz

cd gst-plugins-base-$GST_BASE

PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-$GST_CORE/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

if [ ! -e gst-plugins-good-$GST_GOOD ]

then

tar zxvf gst-plugins-good-$GST_GOOD.tar.gz

cd gst-plugins-good-$GST_GOOD

PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-$GST_CORE/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

if [ ! -e gst-plugins-bad-$GST_BAD ]

then

tar zxvf gst-plugins-bad-$GST_BAD.tar.gz

cd gst-plugins-bad-$GST_BAD

PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-$GST_CORE/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

if [ ! -e gst-plugins-ugly-$GST_UGLY ]

then

tar zxvf gst-plugins-ugly-$GST_UGLY.tar.gz

cd gst-plugins-ugly-$GST_UGLY

PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-$GST_CORE/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

if [ ! -e gst-ffmpeg-$GST_FFMPEG ]

then

tar zxvf gst-ffmpeg-$GST_FFMPEG.tar.gz

cd gst-ffmpeg-$GST_FFMPEG

PKG_CONFIG_PATH=/opt/gstreamer/gstreamer-$GST_CORE/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ./configure –prefix=/opt/gstreamer/gstreamer-$GST_CORE

make

sudo make install

cd ..

fi

sudo cp /opt/gstreamer/gstreamer-$GST_CORE/lib/gstreamer-$GST_CORE/* /opt/gstreamer/gstreamer-$GST_CORE/lib/

sudo ln -s /opt/gstreamer/gstreamer-$GST_CORE/lib /opt/gstreamer/current

/opt/gstreamer/gstreamer-$GST_CORE/bin/gst-inspect –gst-plugin-path=/opt/gstreamer/current

[/shell]

Catégories
Open-source

Compilation de GStreamer sous Windows

Lorenzo Cammilleri, stagiaire ingénieur, vient de finaliser une procédure pour compiler GStreamer (le framework multimédia) sous Microsoft Windows. Avant de lui laisser le clavier, je vous donne l’adresse de son blog ou il trace sont travail:

http://lorenzocam.wordpress.com/

Ce billet est largement inspiré de cette page ici. Ayant rencontré de nombreux problèmes, Andoni Morales Alastruey a modifié sa page puisqu’il manquait certaines étapes qui sont aussi décrites ici.

Voici la marche à suivre pour pouvoir compiler Gstreamer Winbuilds avec Visual Studio.

Gstreamer

– Télécharger et installer Tortoise SVN: ICI

Dans le menu du click droit de la souris apparaît maintenant “SVN Checkout”.

– Dans un dossier vide, faire SVN Checkout de cette adresse : https://forja.rediris.es/svn/csl-longomatch/GStreamer-WinBuild/trunk

Les fichiers et dossiers vont être progressivement téléchargés.

Outils externes

– Installer Python
– Installer Perl

DirectX SDK

– Télécharger et installer le DirectX SDK

– Ouvrir le fichier C:\Program Files\Microsoft SDKs\Windows\v6.1\Samples\Multimedia\DirectShow\BaseClasses\baseclasses.sln avec Visual Studio

– Compiler en mode Debug_MBCS et Release_MBCS

– Ouvrir le fichier build\vsprops\common.vsprops de l’environnement Gstreamer et changer les macros MicrosoftSDK et DirectX pour spécifier les bons chemins

– Ouvrir le fichier build\GStreamer.sln et compiler en mode ReleaseWdkCrt sans se soucier des erreurs

– Compiler ensuite en mode Release : à ce moment il ne devrait plus y avoir d’erreurs !

Voilà tout !